Can't draw text in a custom window

I made a window called Window_CommEv and I'm trying to use drawText or drawTextEx, but I can't make it work.

I'm making a menu with commands, copying Window_GameEnd, and I want a line at the start that says something like "Choose option:" or something like that.

Spoiler
[IMG]http://i1135.photobucket.com/albums/m639/Torqus7/sysd2424ata.png[/IMG]
I tried adding drawText in other parts of the code, using drawTextEx, but it doesn't work. I know that if I want to draw text I need a window or a sprite to use a bitmap or something like that, I already have the window, but I couldn't find info about how to continue after that.
the refresh method of the image contains the this.drawTextEx(text,x,y) can we see the refresh method of the custom window please?
can you please put this in a decent ways (code tag) and.......PLEASE make a readable font size? 
Oh, I don't have a refresh method in the custom window. How can I add it? I see there's refresh methods in Window_Base and Window_Help.

It doesn't have to be drawTextEx, I don't actually know what the difference is between that and drawText.

//-----------------------------------------------------------------------------// Window_CommEv//function Window_CommEv() { this.initialize.apply(this, arguments);}Window_CommEv.prototype = Object.create(Window_Command.prototype);Window_CommEv.prototype.constructor = Window_CommEv;Window_CommEv.prototype.initialize = function() { Window_Command.prototype.initialize.call(this, 0, 0); this.updatePlacement(); this.openness = 0; this.open();};Window_CommEv.prototype.windowWidth = function() { return 240;};Window_CommEv.prototype.updatePlacement = function() { this.x = (Graphics.boxWidth - this.width) / 2; this.y = (Graphics.boxHeight - this.height) / 2;};Window_CommEv.prototype.refresh = function() { this.contents.clear(); this.drawTextEx(this._text, this.textPadding(), 0);};Window_CommEv.prototype.makeCommandList = function() { this.drawTextEx("text", 0, 0); if (eval(ENABLED1)){ this.addCommand(COMM_EV_NAME1, 'COMM_EV_1'); } if (eval(ENABLED2)){ this.addCommand(COMM_EV_NAME2, 'COMM_EV_2'); } if (eval(ENABLED3)){ this.addCommand(COMM_EV_NAME3, 'COMM_EV_3'); } if (eval(ENABLED4)){ this.addCommand(COMM_EV_NAME4, 'COMM_EV_4'); } if (eval(ENABLED5)){ this.addCommand(COMM_EV_NAME5, 'COMM_EV_5'); } if (eval(ENABLED6)){ this.addCommand(COMM_EV_NAME6, 'COMM_EV_6'); } if (eval(ENABLED7)){ this.addCommand(COMM_EV_NAME7, 'COMM_EV_7'); } if (eval(ENABLED8)){ this.addCommand(COMM_EV_NAME8, 'COMM_EV_8'); }};I took the refresh from Window_Help, but I'm sure that's not how to do it.
On your window object lets dp something like:

Code:
YourWindowObject.prototype.refresh = function() {    theOriginalWindowObjectThatYourAliasing.call(this);        this.drawtextEx('\\c[9]Hello World\\c[0]');}// Then in your  YourWindowObject.initialize() call this.refresh();
Window_CommEv.prototype.initialize = function() { Window_Command.prototype.initialize.call(this, 0, 0); this.updatePlacement(); this.refresh(); this.openness = 0; this.open();};Window_CommEv.prototype.refresh = function() { Window_Base.call(this); this.drawtextEx('\\c[9]Hello World\\c[0]');}EDIT: I forgot to delete a drawText in other part of the code. Anyways, it freezes when I open the scene, I'll see what I can do about that.

EDIT2: I tried this:

Window_CommEv.prototype.initialize = function() { Window_Command.prototype.initialize.call(this, 0, 0); this.updatePlacement(); this.refresh(); this.openness = 0; this.open();};Window_CommEv.prototype.refresh = function() { Window_Base.prototype.refresh.call(this); this.drawtextEx('\\c[9]Hello World\\c[0]');}Now it doesn't freeze, but there's a "TypeError. Cannot read property 'call' of undefined
Window_CommEv.prototype.initialize = function() { Window_Command.prototype.initialize.call(this, 0, 0); this.updatePlacement(); this.refresh(); this.openness = 0; this.open();};Window_CommEv.prototype.refresh = function() { Window_Base.call(this); this.drawtextEx('\\c[9]Hello World\\c[0]');}EDIT: I forgot to delete a drawText in other part of the code. Anyways, it freezes when I open the scene, I'll see what I can do about that.

in this case remove refresh call from initialize and call it in open. also do not call open in initialize. Pass the instantiated window object to the scene.addChild method
in this case remove refresh call from initialize and call it in open. also do not call open in initialize. Pass the instantiated window object to the scene.addChild method
What do you mean "call it in open"? Open comes from Window_Command, it isn't there. Also don't get that about scene.addChild.

Apart from that, I got it kinda working.

Window_CommEv.prototype.initialize = function() { Window_Command.prototype.initialize.call(this, 0, 0); this.updatePlacement(); this.refresh(); this.openness = 0; this.open();};Window_CommEv.prototype.refresh = function() {    Window_Help.prototype.refresh.call(this);    this.drawTextEx("Hey", 'center', 0);}Changing the drawTextEx from Window_Base to Window_Help.

But when I open the command this happens:

Spoiler
[IMG]http://i1135.photobucket.com/albums/m639/Torqus7/Udntitled.png[/IMG]
The commands are there and can be triggered but there's no text anymore, not even from the commands.
I guess, a newbie's guess

this.drawTextEx("Hey", 1, 1);

the last two arguments should be numeric (in this case changed into 1, 1)

Original thread: https://forums.rpgmakerweb.com/threads/cant-draw-text-in-a-custom-window.48552/