[fxruby-users] (no subject)

guerrantonio at libero.it guerrantonio at libero.it
Fri Jan 2 06:04:39 EST 2009


I wrote this little program:
 
********************************************
#!
/usr/bin/env ruby
 
require 'fox16'
require 'fox16/colors'
include Fox
 
class 
Finestra0 < FXMainWindow
 def initialize(app)
  # Initialize base class
  super
(app, "PROGRAMMA", :opts => DECOR_ALL, :x => 20, :y => 20, :width => 600, :
height => 400)
  # Create another integer data target to track the "progress"
  
#@progressTarget = FXDataTarget.new(0)
    #@area = FXCanvas.new(self)
 
  # 
Menubar
  menubar = FXMenuBar.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X)
  # File 
menu
  filemenu = FXMenuPane.new(self)
  archivitabellemenu = FXMenuPane.new
(self)
    FXMenuCommand.new(archivitabellemenu, "Line 11").connect
(SEL_COMMAND) {
      #area = FXCanvas.new(self)
      #area.connect
(SEL_LEFTBUTTONPRESS) do |canvas, sel, ev|
        #finestra = FXWindow.new
(canvas, ev)
        finestra = FXWindow.new(self)
        #finestra.create

        finestra.show
    #end
    }
    FXMenuCommand.new(archivitabellemenu, 
"Line 12")
    FXMenuCommand.new(archivitabellemenu, "Line 13")
    
FXMenuCommand.new(archivitabellemenu, "Line 14")
    FXMenuCommand.new
(archivitabellemenu, "Line 15")
    FXMenuCommand.new(archivitabellemenu, "Line 
16")
    FXMenuCommand.new(archivitabellemenu, "Line 17")
    FXMenuCommand.new
(archivitabellemenu, "Line 18")
    FXMenuCascade.new(filemenu, "Line 1", :
popupMenu => archivitabellemenu)
    FXMenuCommand.new(filemenu, "Line 2")
  
FXMenuCommand.new(filemenu, "Line 3")
  FXMenuCommand.new(filemenu, "Line 4")
  
FXMenuCommand.new(filemenu, "Line 5")
  FXMenuCommand.new(filemenu, "Line 6")
  
FXMenuCommand.new(filemenu, "Line 7")
 
  amministrazionemenu = FXMenuPane.new
(self)
  FXMenuCommand.new(amministrazionemenu, "Line 81")
  FXMenuCommand.new
(amministrazionemenu, "Line 82")
  FXMenuCommand.new(amministrazionemenu, "Line 
83")
  FXMenuCascade.new(filemenu, "Line 8", :popupMenu => amministrazionemenu)

    
  FXMenuSeparator.new(filemenu)  
  FXMenuCommand.new(filemenu, "Line 9")

  FXMenuCommand.new(filemenu, "Informations").connect(SEL_COMMAND) {
      
FXMessageBox.information(self, MBOX_OK,
"GREETING",
"Happy New Year
by 
Italian")
}
  FXMenuSeparator.new(filemenu)  
  FXMenuCommand.new(filemenu, 
"Fine lavoro\tCtl-Z", nil, getApp(), FXApp::ID_QUIT)
  FXMenuTitle.new(menubar, 
"Menu Principale", nil, :popupMenu => filemenu)
  FXHorizontalSeparator.new
(self,
   LAYOUT_SIDE_TOP|SEPARATOR_GROOVE|LAYOUT_FILL_X)
 end
 # Quit
 def 
onCmdQuit(sender, sel, ptr)
  getApp.exit(0)
 end
 
 # Start
 def create
  # 
Create window
  super
  # Show the main window
    #self.create
  show
(PLACEMENT_SCREEN)
 end
end
 
if __FILE__ == $0
 # Make an application
 
application = FXApp.new("DataTarget", "FoxTest")
 # Create main window
 window 
= Finestra0.new(application)
 # Handle interrupts to quit application 
gracefully
 application.addSignal("SIGINT", window.method(:onCmdQuit))
 # 
Create the application
 application.create
 # Run
 application.run
end


*********************************************
and clicking on line 11 I want to 
open another window with another menu.
I tried a lot but to do it but  window 
does not open: someone can help me in this matter?
 
Italian


More information about the fxruby-users mailing list