PlaneShift

Development => Development Deliberation => Topic started by: IngeniousMask on February 11, 2005, 07:50:00 am

Title: How does a widget know how to draw?
Post by: IngeniousMask on February 11, 2005, 07:50:00 am
First off, I hope I am allowed to ask questions about the general code.  If not, sorry, and I will not do again.

Anyway, I was wondering when a widget knows how to display itself.  I know each widget has a draw() function, but I was wondering when it is called.  Does it get called when the widget is loaded by LoadWidget(), or is it drawn by another function call/event handling.  I have been examining the code and I have been unsucessful in answering my own question.  Any help would be great!

~IngeniousMask
Title:
Post by: IngeniousMask on February 11, 2005, 08:00:52 am
Well, after more searching, I believe i found the answer in the event handling of csCmdProcess.  Any explanation is still wecome though.
Title:
Post by: Karosh_Steinkatz on February 11, 2005, 11:40:26 am
Hmm, it has been a while, but I think to show and hide a widget you use widget->Show(); and widget->Hide(); if that\'s what you mean.
Title:
Post by: acraig on February 11, 2005, 03:44:35 pm
A widget draws when it\'s parent draws.  There is one \'main\' widget which is the desktop which all other windows are children of.  On every frame mainwidget->Draw() is called.  He goes through all his children and if they are visible calls their Draw on it.  This in turn causes all the childs children to be drawn and so on down the chain.
Title:
Post by: IngeniousMask on February 12, 2005, 02:43:25 am
Okay, thanks for the help.  Now I can continue working through the psclinet!