From: Richard Lyman Date: 2004-12-15T05:31:01+09:00 Subject: Re: wxRuby and other GUI toolkits TIMTOWTDI. I do it a bit different than all of the samples. I prefer the following way, since it helps me see the GUI structure when I'm looking at the code. Here are some non-functioning (since they are only part of the application's code) examples. Example 1: FXMenuPane.new(@mainwin){ |hide_and_remind_menu| FXMenuTitle.new(menu_bar,"Hide and Remind",nil,hide_and_remind_menu) FXMenuCommand.new(hide_and_remind_menu,"5 seconds").connect(SEL_COMMAND) do hide_and_remind_sec(5) end FXMenuCommand.new(hide_and_remind_menu,"15 seconds").connect(SEL_COMMAND) do hide_and_remind_sec(15) end FXMenuSeparator.new(hide_and_remind_menu) FXMenuCommand.new(hide_and_remind_menu,"30 minutes").connect(SEL_COMMAND) do hide_and_remind_sec( (60*30) ) end FXMenuSeparator.new(hide_and_remind_menu) FXMenuCommand.new(hide_and_remind_menu,"2 hours").connect(SEL_COMMAND) do hide_and_remind_sec( (60*60*2) ) end FXMenuCommand.new(hide_and_remind_menu,"4 hours").connect(SEL_COMMAND) do hide_and_remind_sec( (60*60*4) ) end FXMenuCommand.new(hide_and_remind_menu,"6 hours").connect(SEL_COMMAND) do hide_and_remind_sec( (60*60*6) ) end FXMenuSeparator.new(hide_and_remind_menu) FXMenuCommand.new(hide_and_remind_menu,"8am tomorrow").connect(SEL_COMMAND) do hide_and_remind(8) end FXMenuCommand.new(hide_and_remind_menu,"10am tomorrow").connect(SEL_COMMAND) do hide_and_remind(10) end FXMenuCommand.new(hide_and_remind_menu,"Noon tomorrow").connect(SEL_COMMAND) do hide_and_remind(12) end FXMenuCommand.new(hide_and_remind_menu,"4pm tomorrow").connect(SEL_COMMAND) do hide_and_remind(16) end FXMenuCommand.new(hide_and_remind_menu,"8pm tomorrow").connect(SEL_COMMAND) do hide_and_remind(20) end } Example 2: FXHorizontalFrame.new(@sql_container,LAYOUT_FILL_X){|hf| FXVerticalFrame.new(hf,0,0,0,0,0,20) FXVerticalFrame.new(hf,LAYOUT_FILL_X){|vf| FXVerticalFrame.new(vf,LAYOUT_FILL_X|TEXTFIELD_NORMAL){|frame_line| @sql=FXText.new(frame_line,nil,0,LAYOUT_FILL_X) @sql.visRows=6 @sql.text="" } FXButton.new(vf,"Execute SQL",nil,nil,0,BUTTON_NORMAL|LAYOUT_RIGHT).connect(SEL_COMMAND)do process_sql(@sql.text) end } FXVerticalFrame.new(hf,0,0,0,0,0,20) } Notice I'm not saying anything bad about wxWidgets. In fact I'm a bt jealous of the native look-n-feel thing... :-) I'm just trying to show that FXRuby has excellent support for... ruby-esque-ness (if that's a word) -Rich On Wed, 15 Dec 2004 04:57:16 +0900, itsme213 wrote: > > "Richard Lyman" wrote in message > > Then why not gravitate toward FXRuby? > > When I last looked at the FXRuby examples (several months ago), I found it > hard to see the basic ui structure, somewhat buried (to me) in the many > configuration parameters. Do you know if that has changed? > >