foxGUIb

GUI 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:

  • DialogDemo.rb is simply a main window with a single button, built with foxGUIb. (not shown)
  • DialogBox.rb is a dialog box built with foxGUIb, containing a check button. (not shown)
  • DialogDemoExtender.rb adds event-handling to display DialogBox.rb

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

 


Guide Contents