Marshall Elfstrand
2004-Oct-06 20:38 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
I''m fairly new to the Ruby world, particularly WxRuby, so please forgive me if this is ground that''s been covered in the past. I''m trying to load a frame from an XRC file (created using DialogBlocks), and I''m having trouble getting an instance of the Gauge object using the Wx::Window.find_window_by_xxx methods. I''m trying this on Windows XP, using the one-click Ruby installer and the one-click WxRuby installer. In the initialize() method of my Wx::Frame subclass, I have the following code: # Load XRC data. xml = Wx::XmlResource.get() xml.init_all_handlers() xml.load("xrctest.xrc") xml.load_frame_subclass(self, nil, "test_frame") # Attempt to get the gauge from the XRC data by ID. id = Wx::xrcid("test_gauge") # Returns the ID, no problem gauge = Wx::Window.find_window_by_id(id, self) # Returns nil Attempting to get the gauge by name has the same result: gauge = Wx::Window.find_window_by_name("test_gauge", self) # Returns nil I''m successfully retrieving StaticText, TextCtrl, and Button controls, but the Gauge has been really giving me grief. The BitmapButton control exhibits the same behavior. Is this a known issue with wxWidgets and/or wxRuby, or is it a problem with my installation? Any ideas? Thanks much, Marshall
Nick
2004-Oct-07 07:20 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
Whoops - XRC depends on a table to map from the class back to the type, and it''s missing both of those. Lemme see if I can patch that up. Nick Marshall Elfstrand wrote:> I''m fairly new to the Ruby world, particularly WxRuby, so please > forgive me if this is ground that''s been covered in the past. I''m > trying to load a frame from an XRC file (created using DialogBlocks), > and I''m having trouble getting an instance of the Gauge object using > the Wx::Window.find_window_by_xxx methods. I''m trying this on Windows > XP, using the one-click Ruby installer and the one-click WxRuby > installer. > > In the initialize() method of my Wx::Frame subclass, I have the > following code: > > # Load XRC data. > xml = Wx::XmlResource.get() > xml.init_all_handlers() > xml.load("xrctest.xrc") > xml.load_frame_subclass(self, nil, "test_frame") > > # Attempt to get the gauge from the XRC data by ID. > id = Wx::xrcid("test_gauge") # Returns the ID, no problem > gauge = Wx::Window.find_window_by_id(id, self) # Returns nil > > Attempting to get the gauge by name has the same result: > > gauge = Wx::Window.find_window_by_name("test_gauge", self) # > Returns nil > > I''m successfully retrieving StaticText, TextCtrl, and Button controls, > but the Gauge has been really giving me grief. The BitmapButton > control exhibits the same behavior. > > Is this a known issue with wxWidgets and/or wxRuby, or is it a problem > with my installation? Any ideas? > > Thanks much, > Marshall > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Nick
2004-Oct-07 09:52 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
Ok, I think I''ve got it fixed. Shout out to Kevin: Did you ever have a chance to see if you could use ''have_header'' in the extconf file to include/remove the HTML stuff? If so, I might make those BusyCursor/WindowDisabler changes and get ready for a 0.5.1 release. Of course, Curt''s time is limited, so building both wxruby and wxruby-swig releases over a weekend might make him start chanting "all work and no play make Curt go postal.... " :-) Nick Nick wrote:> > > Whoops - XRC depends on a table to map from the class back to the > type, and it''s missing both of those. Lemme see if I can patch that up. > > Nick > > Marshall Elfstrand wrote: > >> I''m fairly new to the Ruby world, particularly WxRuby, so please >> forgive me if this is ground that''s been covered in the past. I''m >> trying to load a frame from an XRC file (created using DialogBlocks), >> and I''m having trouble getting an instance of the Gauge object using >> the Wx::Window.find_window_by_xxx methods. I''m trying this on >> Windows XP, using the one-click Ruby installer and the one-click >> WxRuby installer. >> >> In the initialize() method of my Wx::Frame subclass, I have the >> following code: >> >> # Load XRC data. >> xml = Wx::XmlResource.get() >> xml.init_all_handlers() >> xml.load("xrctest.xrc") >> xml.load_frame_subclass(self, nil, "test_frame") >> >> # Attempt to get the gauge from the XRC data by ID. >> id = Wx::xrcid("test_gauge") # Returns the ID, no problem >> gauge = Wx::Window.find_window_by_id(id, self) # Returns nil >> >> Attempting to get the gauge by name has the same result: >> >> gauge = Wx::Window.find_window_by_name("test_gauge", self) # >> Returns nil >> >> I''m successfully retrieving StaticText, TextCtrl, and Button >> controls, but the Gauge has been really giving me grief. The >> BitmapButton control exhibits the same behavior. >> >> Is this a known issue with wxWidgets and/or wxRuby, or is it a >> problem with my installation? Any ideas? >> >> Thanks much, >> Marshall >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Curt Hibbs
2004-Oct-07 10:02 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gaugeor BitmapButton
Nick wrote:> > Ok, I think I''ve got it fixed. > > Shout out to Kevin: Did you ever have a chance to see if you could use > ''have_header'' in the extconf file to include/remove the HTML stuff? If > so, I might make those BusyCursor/WindowDisabler changes and get ready > for a 0.5.1 release. Of course, Curt''s time is limited, so building both > wxruby and wxruby-swig releases over a weekend might make him start > chanting "all work and no play make Curt go postal.... " :-)Just doing the build should be easy (I''ve got everything all setup). If you could handle the actual release announcement, news postings, etc. then it should be a problem. I made a cheat-sheet of the steps required here: http://wxruby.rubyforge.org/wiki/wiki.pl?Release_HowTo Curt
Curt Hibbs
2004-Oct-07 10:20 UTC
[Wxruby-users] find_window_by_xxx doesn''t findGaugeor BitmapButton
Curt Hibbs wrote:> > Nick wrote: > > > > Ok, I think I''ve got it fixed. > > > > Shout out to Kevin: Did you ever have a chance to see if you could use > > ''have_header'' in the extconf file to include/remove the HTML stuff? If > > so, I might make those BusyCursor/WindowDisabler changes and get ready > > for a 0.5.1 release. Of course, Curt''s time is limited, so building both > > wxruby and wxruby-swig releases over a weekend might make him start > > chanting "all work and no play make Curt go postal.... " :-) > > Just doing the build should be easy (I''ve got everything all > setup). If you > could handle the actual release announcement, news postings, etc. then it > should be a problem. I made a cheat-sheet of the steps required here:I meant to write "should *not* be a problem." -curt> > http://wxruby.rubyforge.org/wiki/wiki.pl?Release_HowTo > > Curt
Marshall Elfstrand
2004-Oct-07 14:46 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
Wow, I didn''t expect a response so quickly! Thanks! I worked up an XRC file with a bunch more controls today, and here''s what I''ve found: I can successfully get objects for wxPanel, wxNotebook, wxStaticText, wxButton, wxSpinButton, wxRadioButton, wxRadioBox, wxComboBox, wxTextCtrl, wxSpinCtrl, wxListBox, wxListCtrl, wxCalendarCtrl, and wxTreeCtrl from the XRC file using Wx::Window.find_window_by_name(). Trying to get objects for wxStaticBitmap, wxStaticLine, wxBitmapButton, wxCheckBox, wxChoice, wxGauge, wxSlider, wxScrollBar, wxCheckList, and wxGenericDirCtrl using Wx::Window.find_window_by_name() results in nil. I haven''t yet tried some of the other windows (grid, splitter, etc.), but I figured I''d mention the ones I''ve found so far in case they also needed to be added to the XRC mapping. I don''t know if it makes any difference, but wxCheckList in the XRC file appears to map to the wxCheckListBox class. Thanks again! Just to confirm, the FAQ says that when WxRuby-SWIG is complete, "ordinary users should notice no difference"; does that mean that there won''t be (significant) API changes from WxRuby to WxRuby-SWIG? Marshall On Oct 7, 2004, at 6:49 AM, Nick wrote:> > Ok, I think I''ve got it fixed. > > Shout out to Kevin: Did you ever have a chance to see if you could use > ''have_header'' in the extconf file to include/remove the HTML stuff? If > so, I might make those BusyCursor/WindowDisabler changes and get ready > for a 0.5.1 release. Of course, Curt''s time is limited, so building > both wxruby and wxruby-swig releases over a weekend might make him > start chanting "all work and no play make Curt go postal.... " :-) > > Nick >
Zach Dennis
2004-Oct-07 15:27 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
Marshall, I''ve been using wxRuby for a little while now and I have never took the time to learn what XML Resources are. What are they? Thanks, Zach p.s. - I know i used to be hooting and hollaring alot on the list, we are currently in a 3 week intense coding session at work. It involves 3-4 days of 11-14 hours of coding and non interruption a day. (We dont'' code for that long straight, but we try to keep our minds in a certain *thought* zone). So I am unable to do any ruby during this time (the coding is in java). Then we take 1-2 day off, then we go back on. After the 3 week period I hope to be back in full swing with wxRuby and ruby.
Nick
2004-Oct-07 15:32 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
> > Thanks again! Just to confirm, the FAQ says that when WxRuby-SWIG is > complete, "ordinary users should notice no difference"; does that mean > that there won''t be (significant) API changes from WxRuby to WxRuby-SWIG?If we''re good, yes. We''re still building up the functionality of wxruby-swig to match wxruby, so right now things like XRC aren''t there yet. But it''s getting there.> Trying to get objects for wxStaticBitmap, wxStaticLine, > wxBitmapButton, wxCheckBox, wxChoice, wxGauge, wxSlider, wxScrollBar, > wxCheckList, and wxGenericDirCtrl using > Wx::Window.find_window_by_name() results in nil.Thanks for putting the testing time in. I''ll make sure to add these too. Nick Marshall Elfstrand wrote:> Wow, I didn''t expect a response so quickly! Thanks! > > I worked up an XRC file with a bunch more controls today, and here''s > what I''ve found: > > I can successfully get objects for wxPanel, wxNotebook, wxStaticText, > wxButton, wxSpinButton, wxRadioButton, wxRadioBox, wxComboBox, > wxTextCtrl, wxSpinCtrl, wxListBox, wxListCtrl, wxCalendarCtrl, and > wxTreeCtrl from the XRC file using Wx::Window.find_window_by_name(). > > Trying to get objects for wxStaticBitmap, wxStaticLine, > wxBitmapButton, wxCheckBox, wxChoice, wxGauge, wxSlider, wxScrollBar, > wxCheckList, and wxGenericDirCtrl using > Wx::Window.find_window_by_name() results in nil. > > I haven''t yet tried some of the other windows (grid, splitter, etc.), > but I figured I''d mention the ones I''ve found so far in case they also > needed to be added to the XRC mapping. I don''t know if it makes any > difference, but wxCheckList in the XRC file appears to map to the > wxCheckListBox class. > > Thanks again! Just to confirm, the FAQ says that when WxRuby-SWIG is > complete, "ordinary users should notice no difference"; does that mean > that there won''t be (significant) API changes from WxRuby to WxRuby-SWIG? > > Marshall > > > On Oct 7, 2004, at 6:49 AM, Nick wrote: > >> >> Ok, I think I''ve got it fixed. >> >> Shout out to Kevin: Did you ever have a chance to see if you could >> use ''have_header'' in the extconf file to include/remove the HTML >> stuff? If so, I might make those BusyCursor/WindowDisabler changes >> and get ready for a 0.5.1 release. Of course, Curt''s time is limited, >> so building both wxruby and wxruby-swig releases over a weekend might >> make him start chanting "all work and no play make Curt go postal.... >> " :-) >> >> Nick >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Nick
2004-Oct-07 15:59 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
> I''ve been using wxRuby for a little while now and I have never took > the time to learn what XML Resources are. What are they?They''re just the best thing ever... and thats not a biased opinion from the guy who added support for it to wxruby. :-) XML resources are the replacement for the old Prolog based resource system, and are similar to Mac OS X nib files and (I suspect) GTK Glade XML. You can provide your dialog/window layout to wxWidgets as an XML resource file. This is a great way to seperate the Window layout and implementation, which tends to run together in awful ways. For more info, see the dialogs 2 tutorial page at http://wxruby.rubyforge.org/wiki/wiki.pl?Using_Dialogs_To_Talk_To_Users_II Julian Smart''s DialogBlocks is a great XRC editor. At $99 for the full version it''s a little pricey (I paid that much for Visual C++), but the free version works with a widget limit and it''s a great way to support wxWidgets. Mr. Smart is also very responsive to bug reports, and makes frequent updates.> p.s. - I know i used to be hooting and hollaring alot on the list, we > are currently in a 3 week intense coding session at work. It involves > 3-4 days of 11-14 hours of coding and non interruption a day. (We > dont'' code for that long straight, but we try to keep our minds in a > certain *thought* zone). So I am unable to do any ruby during this > time (the coding is in java). Then we take 1-2 day off, then we go > back on. After the 3 week period I hope to be back in full swing with > wxRuby and ruby.No worries. Your input is always welcome, but you have to have priorities too. Nick Zach Dennis wrote:> Marshall, > > I''ve been using wxRuby for a little while now and I have never took > the time to learn what XML Resources are. What are they? > > Thanks, > > Zach > > p.s. - I know i used to be hooting and hollaring alot on the list, we > are currently in a 3 week intense coding session at work. It involves > 3-4 days of 11-14 hours of coding and non interruption a day. (We > dont'' code for that long straight, but we try to keep our minds in a > certain *thought* zone). So I am unable to do any ruby during this > time (the coding is in java). Then we take 1-2 day off, then we go > back on. After the 3 week period I hope to be back in full swing with > wxRuby and ruby. > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Marshall Elfstrand
2004-Oct-07 16:32 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
Agreed, XRC files are a wonderful thing. :-) I like them because then the Ruby code isn''t cluttered with all the declarative bits for constructing the GUI, and because there are some nice dialog editor tools to create the interface visually. DialogBlocks doesn''t actually know anything about WxRuby, but since it saves the UI in the language-agnostic XRC format, it can be used to create interfaces for WxRuby with great results. Here''s a fairly thorough XRC reference with some handy examples: http://ldaptool.sourceforge.net/XRCGuide/XRCGuideSingle/ Marshall On Oct 7, 2004, at 12:56 PM, Nick wrote:> >> I''ve been using wxRuby for a little while now and I have never took >> the time to learn what XML Resources are. What are they? > > They''re just the best thing ever... and thats not a biased opinion > from the guy who added support for it to wxruby. :-) > > XML resources are the replacement for the old Prolog based resource > system, and are similar to Mac OS X nib files and (I suspect) GTK > Glade XML. You can provide your dialog/window layout to wxWidgets as > an XML resource file. This is a great way to seperate the Window > layout and implementation, which tends to run together in awful ways. > For more info, see the dialogs 2 tutorial page at > > > http://wxruby.rubyforge.org/wiki/wiki.pl? > Using_Dialogs_To_Talk_To_Users_II > > Julian Smart''s DialogBlocks is a great XRC editor. At $99 for the full > version it''s a little pricey (I paid that much for Visual C++), but > the free version works with a widget limit and it''s a great way to > support wxWidgets. Mr. Smart is also very responsive to bug reports, > and makes frequent updates. > >> p.s. - I know i used to be hooting and hollaring alot on the list, we >> are currently in a 3 week intense coding session at work. It involves >> 3-4 days of 11-14 hours of coding and non interruption a day. (We >> dont'' code for that long straight, but we try to keep our minds in a >> certain *thought* zone). So I am unable to do any ruby during this >> time (the coding is in java). Then we take 1-2 day off, then we go >> back on. After the 3 week period I hope to be back in full swing with >> wxRuby and ruby. > > No worries. Your input is always welcome, but you have to have > priorities too. > > Nick > > > Zach Dennis wrote: > >> Marshall, >> >> I''ve been using wxRuby for a little while now and I have never took >> the time to learn what XML Resources are. What are they? >> >> Thanks, >> >> Zach >> >> p.s. - I know i used to be hooting and hollaring alot on the list, we >> are currently in a 3 week intense coding session at work. It involves >> 3-4 days of 11-14 hours of coding and non interruption a day. (We >> dont'' code for that long straight, but we try to keep our minds in a >> certain *thought* zone). So I am unable to do any ruby during this >> time (the coding is in java). Then we take 1-2 day off, then we go >> back on. After the 3 week period I hope to be back in full swing with >> wxRuby and ruby.
Nick
2004-Oct-07 18:57 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
> > I worked up an XRC file with a bunch more controls today, and here''s > what I''ve found:Would you mind sending that to me? I''m a bit too lazy to write up a test case...> Trying to get objects for wxStaticBitmap, wxStaticLine, > wxBitmapButton, wxCheckBox, wxChoice, wxGauge, wxSlider, wxScrollBar, > wxCheckList, and wxGenericDirCtrl using > Wx::Window.find_window_by_name() results in nil.GenericDirCtrl and ScrollBar aren''t in the wxruby, and probably aren''t going to be added until wxruby-swig comes around. I think I got the others in, but like I said, I''m too le''tired to test. Nick Marshall Elfstrand wrote:> Wow, I didn''t expect a response so quickly! Thanks! > > I worked up an XRC file with a bunch more controls today, and here''s > what I''ve found: > > I can successfully get objects for wxPanel, wxNotebook, wxStaticText, > wxButton, wxSpinButton, wxRadioButton, wxRadioBox, wxComboBox, > wxTextCtrl, wxSpinCtrl, wxListBox, wxListCtrl, wxCalendarCtrl, and > wxTreeCtrl from the XRC file using Wx::Window.find_window_by_name(). > > Trying to get objects for wxStaticBitmap, wxStaticLine, > wxBitmapButton, wxCheckBox, wxChoice, wxGauge, wxSlider, wxScrollBar, > wxCheckList, and wxGenericDirCtrl using > Wx::Window.find_window_by_name() results in nil. > > I haven''t yet tried some of the other windows (grid, splitter, etc.), > but I figured I''d mention the ones I''ve found so far in case they also > needed to be added to the XRC mapping. I don''t know if it makes any > difference, but wxCheckList in the XRC file appears to map to the > wxCheckListBox class. > > Thanks again! Just to confirm, the FAQ says that when WxRuby-SWIG is > complete, "ordinary users should notice no difference"; does that mean > that there won''t be (significant) API changes from WxRuby to WxRuby-SWIG? > > Marshall > > > On Oct 7, 2004, at 6:49 AM, Nick wrote: > >> >> Ok, I think I''ve got it fixed. >> >> Shout out to Kevin: Did you ever have a chance to see if you could >> use ''have_header'' in the extconf file to include/remove the HTML >> stuff? If so, I might make those BusyCursor/WindowDisabler changes >> and get ready for a 0.5.1 release. Of course, Curt''s time is limited, >> so building both wxruby and wxruby-swig releases over a weekend might >> make him start chanting "all work and no play make Curt go postal.... >> " :-) >> >> Nick >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
Kevin Smith
2004-Oct-07 19:38 UTC
[Wxruby-users] find_window_by_xxx doesn''t find Gauge or BitmapButton
Nick wrote:> >> >> Thanks again! Just to confirm, the FAQ says that when WxRuby-SWIG is >> complete, "ordinary users should notice no difference"; does that mean >> that there won''t be (significant) API changes from WxRuby to WxRuby-SWIG? > > > If we''re good, yes. We''re still building up the functionality of > wxruby-swig to match wxruby, so right now things like XRC aren''t there > yet. But it''s getting there.Just to clarify that: Initially, the wxruby-swig API should be "nearly identical" to wxruby. There may be a couple minor necessary tweaks, but the goal is that wxruby code will work just fine under wxruby-swig wherever possible. After we achieve that, we plan to enhance the wxruby-swig API to be even better. Better defaults. More ruby-esqe style. Neat shortcuts and helpers. We plan to drop support for a few of the wxruby classes that duplicate functionality already in ruby. The other minor changes we have made so far are documented in the wxruby-swig README file (near the bottom, under "NOTES". Thanks, Kevin