foxGUIbGUI Creator for Ruby + Fox |
Guide Contents
Dialog boxes
foxGUIb lets you design custom pop-up dialogs. From the Main menu, select dialog Box, and design as appropriate. Here is is a trivial example, comprising a dialog with a check button. We have:
Here is DialogDemoExtender.rb. The only novel part is the event code for the button:
require 'fox14' include Fox require "DialogDemo" require "DialogBox" class DialogDemo #events def init button.connect(Fox::SEL_COMMAND){ d=DialogBox.new(@topwin) ## NB code to show dialog ## d.topwin.create() } end # of events end if __FILE__==$0 require 'libGUIb16' app=FX::App.new w=DialogDemo.new app w.topwin.show(Fox::PLACEMENT_SCREEN) app.create app.run end
|