Game Development Community

dev|Pro Game Development Curriculum

'.setText()' Method for GuiWindowsCtrl

by Mquaker · 02/22/2011 (4:59 pm) · 1 comments

[GuiWindowCtrl.h]
declare 'setText' function into 'class GuiWindowCtrl : public GuiContainer'.
void setText(const char *text);

[GuiWindowCtrl.cpp]
difinition function and ConsoleMethod 'setText' into any place.
void GuiWindowCtrl::setText(const char *text)
{
	mText = StringTable->insert((UTF8*)text, true);   
}

ConsoleMethod( GuiWindowCtrl, setText, void, 3, 3, "() - Sets the window title." )
{
	TORQUE_UNUSED(argc);
	object->setText(argv[2]);
}

recompile.

now, you can use '.setText' Method to GuiWindowCtrl.

ex)
YourWindowCtrlName.setText( "TEST WINDOW" );
or
ParentGuiGroup-->YourWindowCtrlInternalName.setText( "TEST WINDOW" );

#1
02/23/2011 (3:08 pm)
Nice simple & easy resource.

My method is just to simply set .name = ""; before I open the window and it works fine, but this is a nice method too.