guerrantonio at libero.it wrote:> I wrote this little program:
I am not sure I understand what you are trying to do. If you want
another cascaded menu then it is straightforward. See my modified test
program. Or are you trying to create a separate popup window with
something or other in it? I must say I had no luck doing that. Back to
the Fine Manual.
#!/usr/bin/env ruby
require ''rubygems''
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)
tertiarymenu = FXMenuPane.new(self) # Vedi qui
FXMenuCommand.new(tertiarymenu, "uno")
FXMenuCommand.new(tertiarymenu, "due")
FXMenuCommand.new(tertiarymenu, "tre")
FXMenuCommand.new(tertiarymenu, "quattro")
FXMenuCommand.new(tertiarymenu, "cinque")
FXMenuCascade.new(archivitabellemenu, "Line 11", :popupMenu =>
tertiarymenu)
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")
}
# Ed altre tanto
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
FXApp.new("DataTarget", "FoxTest") do |application|
# 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
end
-----------------------------------------------------------------------------------------------------------------
E felice nuovo anno
Len