Hello All,
I''ve looked back through the wxruby-users archive, and found someone
else was having the same problem when it comes to Accessing XRC and
getting a GTK Error about GtkPizza. I don''t know what the problem is,
as what I''m using, is wxGlade to develop my user interface, and it
creates all the controls in what looks like it should be fine, but it''s
not working. The simplest of my program is:
begin
require ''wx''
rescue LoadError => no_wx_err
begin
require ''rubygems''
require ''wx''
rescue LoadError
raise no_wx_err
end
end
module XrcEnabled
def getXrcControl(id)
return find_window_by_id( Wx::xrcid(id) )
end
end
class ContactList < Wx::Frame
include XrcEnabled
def initialize()
super(nil,-1,"RubyIM")
$xml.load_frame_subclass(self,nil,"ContactList")
# Grab all the controls for what I''m creating
end
end
class RubyIMApp < Wx::App
def on_init
$xml = Wx::XmlResource.get();
$xml.init_all_handlers();
xrc_file = File.join( File.dirname(__FILE__), "xrc",
"ContactList.xrc")
$xml.load(xrc_file)
main = ContactList.new()
main.show(true)
end
end
RubyIMApp.new.main_loop()
The wxGlade xrc file source is:
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated by wxGlade 0.5 on Sat Apr 28 09:32:20 2007 from
/home/eumario/Projects/RubyIM/RubyIM.wxg -->
<resource version="2.3.0.1">
<object class="wxFrame" name="ContactList"
subclass="ContactList">
<style>wxDEFAULT_FRAME_STYLE</style>
<title>Ruby IM - Contact List</title>
<size>297, 732</size>
<object class="wxMenuBar"
name="ContactList_menubar">
<object class="wxMenu" name="clFile">
<label>_File</label>
<object class="wxMenuItem"
name="clfConnect">
<label>_Connect</label>
<help>Connect to IM Server...</help>
</object>
<object class="wxMenuItem"
name="clfDisconnect">
<label>_Disconnect</label>
<help>Disconnect from Server</help>
</object>
<object class="separator"/>
<object class="wxMenuItem"
name="clfExit">
<label>E_xit</label>
<help>Exit from RubyIM</help>
</object>
</object>
<object class="wxMenu" name="clActions">
<label>_Actions</label>
<object class="wxMenu" name="claChat">
<label>_Chat</label>
<object class="wxMenuItem"
name="clacAdd">
<label>_Add</label>
<help>Add a Chatroom to your contact
list...</help>
</object>
<object class="wxMenuItem"
name="clacJoin">
<label>_Join</label>
<help>Join a Chat room</help>
</object>
<object class="wxMenuItem"
name="clacStart">
<label>_Start</label>
<help>Start a new chat...</help>
</object>
<object class="wxMenuItem"
name="clacList">
<label>_List</label>
<help>List Current Existing Chat
Rooms</help>
</object>
</object>
<object class="wxMenu"
name="claContacts">
<label>C_ontacts</label>
<object class="wxMenuItem"
name="claoAdd">
<label>_Add</label>
<help>Add a Contact to your contact
list...</help>
</object>
<object class="wxMenuItem"
name="claoEdit">
<label>_Edit</label>
<help>Edit an existing contact in your Contact
list...</help>
</object>
<object class="wxMenuItem"
name="claoRemove">
<label>_Remove</label>
<help>Remove an Existing contact....</help>
</object>
</object>
<object class="separator"/>
<object class="wxMenuItem"
name="claShowOffline">
<label>_Show Offline</label>
<help>Show Offline Contacts....</help>
<checkable>1</checkable>
</object>
<object class="wxMenuItem"
name="claShowEmpty">
<label>_Show Empty</label>
<help>Show empty groups in your contact
list</help>
<checkable>1</checkable>
</object>
</object>
<object class="wxMenu" name="clTools">
<label>_Tools</label>
<object class="wxMenuItem"
name="cltPrefs">
<label>_Preferences</label>
<help>Client Preferences...</help>
</object>
<object class="wxMenuItem"
name="cltPrivacy">
<label>P_rivacy</label>
<help>Privacy Options...</help>
</object>
<object class="wxMenuItem"
name="cltTransfers">
<label>_Transfers</label>
<help>View your current file
transfers....</help>
</object>
<object class="wxMenuItem"
name="cltDebug">
<label>_Debug</label>
<help>Client debug window...</help>
</object>
<object class="separator"/>
<object class="wxMenuItem"
name="cltMuteSounds">
<label>_Mute Sounds</label>
<help>Mute System Sounds</help>
<checkable>1</checkable>
</object>
</object>
<object class="wxMenu" name="clHelp">
<label>_Help</label>
<object class="wxMenuItem"
name="clhHelp">
<label>_Help</label>
<help>View Help File...</help>
</object>
<object class="wxMenuItem"
name="clhAbout">
<label>_About</label>
<help>About RubyIM...</help>
</object>
</object>
</object>
<object class="wxStatusBar"
name="ContactList_statusbar">
<fields>1</fields>
<style>wxST_SIZEGRIP</style>
<widths>-1</widths>
</object>
<object class="wxToolBar"
name="ContactList_toolbar">
<bitmapsize>32, 31</bitmapsize>
<style>wxTB_FLAT|wxTB_HORIZONTAL</style>
<object class="tool" name="tbAddContact">
<label>Add Contact</label>
<tooltip>Add a Contact</tooltip>
<longhelp>Add a contact to your contact
list</longhelp>
<bitmap>/home/eumario/Projects/RubyIM/images/add_contact.png</bitmap>
</object>
<object class="tool" name="tbAddChat">
<label>Add Chat</label>
<tooltip>Add Chat Room</tooltip>
<longhelp>Add a chat room to your contact
list</longhelp>
<bitmap>/home/eumario/Projects/RubyIM/images/add_chat.png</bitmap>
</object>
</object>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<object class="wxTreeCtrl"
name="Contacts">
<style>wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_HIDE_ROOT|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER</style>
</object>
</object>
</object>
</object>
</resource>
And like before, which according to the wxruby-users archive, this is
the same problem that Alex was dealing with back on wxruby2 0.0.37 back
in December. Any insight will be much appreciated.
Thanks,
Mario Steele