From: "Hal E. Fulton" Date: 2002-08-08T16:26:36+09:00 Subject: Re: [OT] GUI's and the Rouge, Part IV ----- Original Message ----- From: "Tom Sawyer" To: "ruby-talk ML" Sent: Thursday, August 08, 2002 2:15 AM Subject: Re: [OT] GUI's and the Rouge, Part IV > On Wed, 2002-08-07 at 20:25, Lyle Johnson wrote: > > Could you maybe defer the construction of the actual FOX widget until it's > > added to a parent (or however it is in GUtopIa that you associate child > > widgets with parent containers)? I'm not familiar enough with the GUtopIa > > architecture to know if this is doable or not. > > i thought about this, breifly. i will consider it some more. > > quick example on how children are assoc. to parents: > > abutton = GUtopIa::Button.new > > awindow = GUtopIa::Window.new > awindow.body = [ [ abutton ] ] > > so as you can see from this, the button needs to have some sort of > existence prior to being told were it will show up. we have done it this > way to allow for greater flexibility with regards to layout definition > (ie. in the example above GUtopIa knows this is a grid layout b/c of the > double array structure of body) and also for the ability to easily and > dynamically reassign widget locations. (in fox you do this with the > reparent method) > > so i hesitate to adjust the way GUtopIa handles this, just for fox's > sake. the "foo" window may be a kludge, but it seems to work okay --i > don't see any problems with doing this, but perhaps there are? I don't know if there are problems or not. Thought I'd comment even though I don't understand the overview that well. If what I say is junk, just ignore it. If you're wanting to delay instantiating the widgets, I would say you *might* replace the widget itself with (say) an array that contained enough information to create that widget -- the class and any parameters to new. abutton = [GUtopIa::Button, any, params, we, might, need] awindow = GUtopIa::Window.new awindow.body = [ [ abutton ] ] Code could easily tell that abutton was an array rather than a widget, and later could do abutton = abutton[0].new(*abutton[1..-1]) # Now I'm a real button Just a crazy thought. Past my bedtime here. Hal