Just window once and throw it away! They are disposable!?!

Hey guys, pretty sure I'm either blind, stupid or both.

I've been perusing Trihan's AMAZING tutorials on ruby. Let me just say they awesome by the way. Much learning, such code. They got me experimenting with Scenes and Windows trying to come up with things I could do. Anyways, I have hit a brick wall with this code I made:

Spoiler: My scene and window
Code:
class CommandScene < Scene_MenuBase
 
  def start
    
    super
    command = BattleMenu.new
    command.set_handler(:atkcom,      method(:stuff))
    command.set_handler(:ratkcom,     method(:stuff))
    command.set_handler(:spccom,      method(:stuff))
    command.set_handler(:passcom,     method(:stuff))

  end
 
  def stuff

    puts "hi"

  end
 
end

 

class BattleMenu < Window_Selectable #or Command (same results)
 
  def initialize
    super(0, 0,100, Graphics.height - y)
    #main
    #activate
    #refresh
  end
 
 
  def main
    add_command("Attack",          :atkcom)
    add_command("Ranged Attack",   :ratkcom)
    add_command("Special",         :spccom)
    add_command("Pass",            :passcom)
  end
 
end

Everything seems fine with this, as far as I can tell, and I can even get the scene to switch and window to appear as expected, but that is where things get weird. As soon as the code hits the constructor for the window I am greeted by that evil ping noise and a invitation back to the script editor, which points at my new window's "super" or w/e other line I put there, that is signed off by some mysterious stranger named "disposed window".
upload_2017-9-17_2-6-8.png


I would like to meet this "disposed window" scoundrel in person and give them a piece of my mind, but I'm honestly not sure where they call home? Looking through the code I can trace the problem back to the Scene_Base where I find some interesting things:
Spoiler: Scene_Base
upload_2017-9-17_2-9-57.png
If I am reading this right, the Scene_Base does:
1 & 2. some start up procedures okay cool
3. waits for the scene to transition to the new one sounds good
4. Runs a pre_terminate method (that is empty even in a fresh project) wait... what?
5. and then terminates (disposes) all the windows in the scene (the new scene?) WHAT?! WHY!?!

This order of operations confuses the heck out of me. It seems that no matter what I do what ever window I create for my new scene is IMMEDIATELY disposed. I tried running the window without calling a new scene and get the same issue. Would appreciate it if someone could slap me upside the head and show me what letter/syntax I messed up that is causing this because every built in scene works fine, so it cannot be an issue with the Scene_Base.
did you write a completely new script or did you edit the original script?
My script is all hand typed. I'm calling on it using an event that uses a SceneManager.call(CommandScene) line in script. I attempted copying and pasting Trihan's code into my script to see if I could call on it and not an issue was had that day. so it is something I have done for sure.
well the error could be either a simple syntax error, placement error, or an incompatibility error
First issue solved. The arguments in my window's constructor had an undefined y variable (I'm blind, like I said)
super(0, 0,100, Graphics.height - y)

However this has led me to a new issue. After some experimentation and changes, the code now looks like so:

Spoiler: Code:
Code:
class CommandScene < Scene_MenuBase
 
  def start
 
    super
    command = BattleMenu.new
    command.set_handler(:atkcom,      method(:stuff))
    command.set_handler(:ratkcom,     method(:stuff))
    command.set_handler(:spccom,      method(:stuff))
    command.set_handler(:passcom,     method(:stuff))
  end
 
  def stuff
    puts "hi"
  end
 
end

 

class BattleMenu < Window_Command
 
  def initialize
    super(0, 0)
    main
    self.index = 0
    activate
    refresh
  end
 
  def main
    make_command_list
  end
 
  def make_command_list
    add_command("Attack",          :atkcom)
    add_command("Ranged Attack",   :ratkcom)
    add_command("Special",         :spccom)
    add_command("Pass",            :passcom)
  end
 
  def refresh
    super
  end
 
end

This leaves me with a menu that does not react to input at all and the game seems to be frozen. I am going to keep playing with it and hunting through the methods of the parent classes (and "Slip into Ruby" Thanks Trihan) to see what I can learn. I would still appreciate insight into this if anyone experienced in setting up Window_Command child classes has some time to spare. If not I'll just keep chugging along.

Spoiler: Unresponsive menu
upload_2017-9-17_4-17-4.png

Original thread: https://forums.rpgmakerweb.com/threads/just-window-once-and-throw-it-away-they-are-disposable.84086/