PlaneShift
Development => Development Deliberation => Topic started 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
-
Well, after more searching, I believe i found the answer in the event handling of csCmdProcess. Any explanation is still wecome though.
-
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.
-
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.
-
Okay, thanks for the help. Now I can continue working through the psclinet!