From: Lyle Johnson Date: 2001-05-17T02:10:09+09:00 Subject: [ruby-talk:15302] Re: Q: GUI framework with direct drawing ca pabilities? > Someone earlier in this thread suggested something like: > > > p = Panel.new( > > Button.new( "Hey, world!" ), ALIGN_LEFT, MORE_CONSTRAINTS, > #... > > Panel.new( > > Slider.new( 0, 10, 5 ), SOME_CONSTRAINTS, #... > > Checkbox.new( "Label" ), CONSTRAINTS, #... > > ), > > login_panel, CONSTRAINTS > > ) > > and commented that: > > > I'm not sure this would work in Ruby, because the callbacks would have to > fit > > in there and would mess up the tree; I did, however, like the fact that > GUIs > > > but with FXRuby, callbacks wouldn't have to affect the tree, since the links > to callbacks > are just one of the "MORE_CONSTRAINTS". > > How hard would it be to implement this style? I am not familiar with MUI so I will probably miss a lot of the point(s) of Sean's original comments. But FOX and FXRuby already have a fairly explicit link between parent and child widgets in a widget's constructor; the first argument to almost every widget's constructor is its parent widget, e.g. aNewButton = FXButton.new(myParent, "buttonText", ...) So if the main benefit that you're getting from the MUI style shown earlier is a *visual* hint of the (tree-like) parent-child hierarchy, I'd prefer to leave things as-is and just use indenting of the source to indicate that structure, i.e. parentFrame = FXHorizontalFrame.new(parentContainer, ...) childWidget1 = FXLabel.new(parentFrame, ...) childWidget2 = FXButton.new(parentFrame, ...) childWidget3 = FXVerticalFrame.new(parentFrame, ...) vertFrameChild1 = some other widget... And as for layout constraints, those are also part of a FOX widget's argument list (i.e. they don't have to be specified separately) and so I think that's also covered. Again, I'm not familiar with MUI yet and so this may be missing the point ;)