Dear All I am new to FOX and FoxGUIb. I have found FoxGUIb very useful and I have created an application with menus, one of which calls a DialogBox for the user to enter some values. After finishing the user will press OK to save data. Unfortunately I don’t know how to let the DialogBox know tha tonce the OK button is pressed it should exit. It seems I need to send message ID_ACCEPT to some recipient (not sure which) when the button OK is clicked? But no idea how to do that with the code that is generated by FoxGUIb as the button is created in a different way to what I have seen in the examples in the web, and I have no idea how to relate them ( I''m afraid I haven''t really understood the FXButton API) The dialog box examples I have seen do something like the following: # Accept accept = FXButton.new(buttons, "&Accept", nil, self, ID_ACCEPT, FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) However the FoxGUIb creates a button doing: FX::Button.new(@verticalframe7){|w| @button_ok=w w.wdg_name=''button_ok'' w.text="Ok" w.width=21 w.y=4 w.height=21 w.layoutHints=40 w.x=26 w.selector=FX::DialogBox::ID_QUIT @button_ok.connect(Fox::SEL_COMMAND){ lat = textfield_lat.text lon = textfield_lon.text heading =textfield_heading.text #How do I indicate that I want to accept and exit?:? } } So in this last example, how do I exit the dialog when button is clicked? Thanks very much for your help Eduardo ___________________________________________________________ The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
Ernest Ellingson
2006-Dec-09 21:51 UTC
[fxruby-users] Exiting a DialogBox created with FoxGUIb
e aldaz wrote:> Dear All > > I am new to FOX and FoxGUIb. I have found FoxGUIb very > useful and I have created an application with menus, > one of which calls a DialogBox for the user to enter > some values. After finishing the user will press OK to > save data. > > Unfortunately I don’t know how to let the > DialogBox know tha tonce the OK button is pressed it > should exit. It seems I need to send message ID_ACCEPT > to some recipient (not sure which) when the button OK > is clicked? But no idea how to do that with the code > that is generated by FoxGUIb as the button is created > in a different way to what I have seen in the examples > in the web, and I have no idea how to relate them ( > I''m afraid I haven''t really understood the FXButton > API) > > The dialog box examples I have seen do something like > the following: > > # Accept > accept = FXButton.new(buttons, "&Accept", nil, > self, ID_ACCEPT, > FRAME_RAISED|FRAME_THICK|LAYOUT_RIGHT|LAYOUT_CENTER_Y) > > > However the FoxGUIb creates a button doing: > > FX::Button.new(@verticalframe7){|w| > @button_ok=w > w.wdg_name=''button_ok'' > w.text="Ok" > w.width=21 > w.y=4 > w.height=21 > w.layoutHints=40 > w.x=26 > w.selector=FX::DialogBox::ID_QUIT > > @button_ok.connect(Fox::SEL_COMMAND){ > lat = textfield_lat.text > lon = textfield_lon.text > heading > =textfield_heading.text > #How > do I indicate that I want to accept and exit?:? > > } > } > > So in this last example, how do I exit the dialog when > button is clicked? > > Thanks very much for your help > Eduardo > > > Hi Eduardo:Take a look at the example dialog.rb in the examples dir that came with FXRuby. There they have a function def onCmdShowDialogModal(sender, sel, ptr) That example should solve your problem. If you don''t have the examples file look here http://www.fxruby.org/ In the documentation, there are examples. The dialog.rb example is there along with the code. Ernie
Axel Etzold
2006-Dec-17 22:15 UTC
[fxruby-users] [fxruby] howto show a warning message that disappears again?
Dear all, I have an application in which I want to show a warning message "this will take some time..." if somebody presses a button. I have tried to do this with FXSplashWindow, but without much success so far: --- btn.connect(SEL_COMMAND) { msg=FXSplashWindow.new(self,''warn.gif'', opts=SPLASH_DESTROY, ms=5000,text=''this will take some time'') system(...) } --- Now, I get: 306:in `initialize'': No matching function for overloaded ''new_FXSplashWindow'' (ArgumentError) from f57.rb:306:in `initialize'' from /usr/local/lib/ruby/gems/1.8/gems/fxruby-1.6.1/lib/fox16/responder2.rb:57:in `onHandleMsg'' from f57.rb:1073:in `runme'' from f57.rb:1087 ------------------------------- What am I doing wrong ? Thanks in advance, Axel -- "Ein Herz f?r Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de Unser Dankesch?n: Ihr Name auf dem Segel der 1. deutschen America''s Cup-Yacht!