Greetings,
I am trying to get a very simple .xrc file to load with no
interaction. This does run, but it will not exit cleanly. Can someone
please help me? I have been making progress, but I just cannot seem to
get that last bit. I am very new to wxruby.
Thanks,
Zignus
samples.xrc
<?xml version="1.0" encoding="ISO-8859-1"?> wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU 400,300 Sample 1 wxHORIZONTAL wxALIGN_CENTER_VERTICAL|wxALL 5 wxVERTICAL wxALIGN_CENTER_HORIZONTAL|wxALL 5 Ok wxALIGN_CENTER_HORIZONTAL|wxALL 5 Cancel wxALIGN_CENTER_HORIZONTAL|wxALL 5 Message... wxALIGN_CENTER_HORIZONTAL|wxALL 5 zignus was herezignus.sample.rbw
require ‘wxruby’
Application class.
class XrcApp < Wx::App
def on_init
Wx::init_all_image_handlers() # Initializes handlers for all
supported controls/windows. In wxRuby versions 1.9.6 and later, this is
called automatically for you, so there is no need to call this method
xml = Wx::XmlResource.get() #Loads resources from the XML file
file. If this file does not exist, or contains invalid XML, an exception
will be raised; if successful, the loaded file name will be returneed.
xml.init_all_handlers() #Initializes handlers for all supported
controls/windows. In wxRuby versions 1.9.6 and later, this is called
automatically for you, so there is no need to call this method
xml.load(“samples.xrc”) #Loads resources from the XML file file.
If this file does not exist, or contains invalid XML, an exception will
be raised; if successful, the loaded file name will be returneed.
#
# Show the main frame.
#
frame = Wx::Frame.new(nil, -1, “Sample” ) #create the window
frame.set_client_size(Wx::Size.new(200,200)) #sets the size of
the window
#sizer = Wx::BoxSizer.new(Wx::VERTICAL)
xml.load_dialog_subclass(frame, nil, ‘SAMPLE_DIALOG’) #loads in
the .xrc into the window! Yea!!
#frame.set_sizer(sizer)
frame.show()
end
end
=begin
=end
XrcApp.new().main_loop() #Create a new object with no name from
‘XrcApp’ class and places in a loop.