Grioni Stefano
2010-Aug-26 13:21 UTC
[wxruby-development] Problems with Wx::XmlResource documentation
Hello, I have just started using WxWidgets, as I now need to design cross-plateform GUIs for an application and I have been experiencing some troubles finding my way through the existing documentation (several broken links, lack of description about some methods,...) I am therefore compiling a little patch correcting the mistakes I found. There are however some things I just don''t get, and I would like to have your point of view about them. - In the online doc of xmlresource class (http://wxruby.rubyforge.org/doc/xmlresource.html) , there is a link named "XML-based resource system overview" that is broken. Do you wanna remove such link of did the resource just move elsewhere, and so the link just has to be fixed? - Several methods ( like "add_handler" seem to be removed from the actual class, do you want me to remove them from the page as well?) - I really don''t understand what the "init_all_handlers" is supposed to do. In fact I created a handler in my xrc for a "choice" : <object class="wxChoice" name="choice_box"> <handler event="EVT_CHOICE">change_something</handler> <selection>0</selection> <content> <item>Swiss Production Only</item> <item>World Production comparison</item> <item>World Consumption comparison</item> <item>Swiss detailed charts</item> </content> <font> <style>normal</style> <family>default</family> <weight>normal</weight> <face>MS Shell Dlg 2</face> <underlined>0</underlined> <size>12</size> </font> </object> But in fact, nothing happens when I change the selected item in the menu (despite the fact that I actually have a "change_something" method). I would be glad to bring my little help to the project so that future devs won''t ask themselves the same questions, I just need a little infos in order to see how this things were imagined. Bests, Stefano -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-development/attachments/20100826/94dffc92/attachment.html>
Pascal Hurni
2010-Aug-31 06:37 UTC
[wxruby-development] Problems with Wx::XmlResource documentation
Hi, Welcome to wxruby! AFAICT the classes docs were initially created by parsing the original WxWidget code or doc. Then they were modified to match ruby behaviour where it matches. Thus the XmlResource doc is out of date because as you discovered several methods are not implemented. Got from the SWIG files: // Can''t write XRC handlers in Ruby %ignore wxXmlResource::AddHandler; %ignore wxXmlResource::ClearHandlers; %ignore wxXmlResource::InsertHandler; So these methods are not available in ruby, I think you may submit a ticket with a patch removing the doc for these methods. We certainly can re-doc them the day we support handlers. Once again AFAIK, handlers & events are ignored for the moment. So you may not register an event method like shown on your XML. Personnaly I patched and subclassed some items in wxruby (all from ruby code, no C patches) that simplifies working with XRC (sorry folks I''m not on the xrcise side). These patches may be a little outdated (back to version ~1.9.7). Best Regards, Pascal Le 26.08.10 15:21, Grioni Stefano a ?crit :> > Hello, > > I have just started using WxWidgets, as I now need to design > cross-plateform GUIs for an application and I have been experiencing > some troubles finding my way through the existing documentation > (several broken links, lack of description about some methods,...) > > I am therefore compiling a little patch correcting the mistakes I > found. There are however some things I just don''t get, and I would > like to have your point of view about them. > > - In the online doc of xmlresource class > (http://wxruby.rubyforge.org/doc/xmlresource.html) , there is a link > named "XML-based resource system overview" that is broken. Do you > wanna remove such link of did the resource just move elsewhere, and so > the link just has to be fixed? > > - Several methods ( like "add_handler" seem to be removed from the > actual class, do you want me to remove them from the page as well?) > > - I really don''t understand what the "init_all_handlers" is supposed > to do. In fact I created a handler in my xrc for a "choice" : > > <object class="wxChoice" name="choice_box"> > > <handler event="EVT_CHOICE">change_something</handler> > > <selection>0</selection> > > <content> > > <item>Swiss Production Only</item> > > <item>World Production comparison</item> > > <item>World Consumption comparison</item> > > <item>Swiss detailed charts</item> > > </content> > > <font> > > <style>normal</style> > > <family>default</family> > > <weight>normal</weight> > > <face>MS Shell Dlg 2</face> > > <underlined>0</underlined> > > <size>12</size> > > </font> > > </object> > > But in fact, nothing happens when I change the selected item in the > menu (despite the fact that I actually have a "change_something" method). > > I would be glad to bring my little help to the project so that future > devs won''t ask themselves the same questions, I just need a little > infos in order to see how this things were imagined. > > Bests, > > Stefano > > > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-development/attachments/20100831/477ee494/attachment-0001.html>
Grioni Stefano
2010-Aug-31 18:25 UTC
[wxruby-development] Problems with Wx::XmlResource documentation
Hi, Thanks for your answer. However how comes that the init_all_handlers method exists? Is it some work-in-progress or may I prune it as well ? Bests, Stefano ________________________________________ From: wxruby-development-bounces at rubyforge.org [wxruby-development-bounces at rubyforge.org] On Behalf Of Pascal Hurni [pascal_hurni at fastmail.fm] Sent: Tuesday, August 31, 2010 8:37 AM To: Internal/technical wxruby discussions Subject: Re: [wxruby-development] Problems with Wx::XmlResource documentation Hi, Welcome to wxruby! AFAICT the classes docs were initially created by parsing the original WxWidget code or doc. Then they were modified to match ruby behaviour where it matches. Thus the XmlResource doc is out of date because as you discovered several methods are not implemented. Got from the SWIG files: // Can''t write XRC handlers in Ruby %ignore wxXmlResource::AddHandler; %ignore wxXmlResource::ClearHandlers; %ignore wxXmlResource::InsertHandler; So these methods are not available in ruby, I think you may submit a ticket with a patch removing the doc for these methods. We certainly can re-doc them the day we support handlers. Once again AFAIK, handlers & events are ignored for the moment. So you may not register an event method like shown on your XML. Personnaly I patched and subclassed some items in wxruby (all from ruby code, no C patches) that simplifies working with XRC (sorry folks I''m not on the xrcise side). These patches may be a little outdated (back to version ~1.9.7). Best Regards, Pascal Le 26.08.10 15:21, Grioni Stefano a ?crit : Hello, I have just started using WxWidgets, as I now need to design cross-plateform GUIs for an application and I have been experiencing some troubles finding my way through the existing documentation (several broken links, lack of description about some methods,?) I am therefore compiling a little patch correcting the mistakes I found. There are however some things I just don?t get, and I would like to have your point of view about them. - In the online doc of xmlresource class (http://wxruby.rubyforge.org/doc/xmlresource.html) , there is a link named ?XML-based resource system overview? that is broken. Do you wanna remove such link of did the resource just move elsewhere, and so the link just has to be fixed? - Several methods ( like ?add_handler? seem to be removed from the actual class, do you want me to remove them from the page as well?) - I really don?t understand what the ?init_all_handlers? is supposed to do. In fact I created a handler in my xrc for a ?choice? : <object class="wxChoice" name="choice_box"> <handler event="EVT_CHOICE">change_something</handler> <selection>0</selection> <content> <item>Swiss Production Only</item> <item>World Production comparison</item> <item>World Consumption comparison</item> <item>Swiss detailed charts</item> </content> <font> <style>normal</style> <family>default</family> <weight>normal</weight> <face>MS Shell Dlg 2</face> <underlined>0</underlined> <size>12</size> </font> </object> But in fact, nothing happens when I change the selected item in the menu (despite the fact that I actually have a ?change_something? method). I would be glad to bring my little help to the project so that future devs won?t ask themselves the same questions, I just need a little infos in order to see how this things were imagined. Bests, Stefano _______________________________________________ wxruby-development mailing list wxruby-development at rubyforge.org<mailto:wxruby-development at rubyforge.org> http://rubyforge.org/mailman/listinfo/wxruby-development
Pascal Hurni
2010-Aug-31 21:38 UTC
[wxruby-development] Problems with Wx::XmlResource documentation
Hi, init_all_handlers also exists in WxWidgets but has no sense for wxRuby, hence the comment in the doc telling that from version 1.9.6 it is not necessary to call it (it''s already called once for you). I think we should keep the method and the related doc as is. In order to not break backward compatibility and to let experienced WxWidgets developers easily transpose their knowledge to wxRuby. Best Regards, Pascal Le 31.08.10 20:25, Grioni Stefano a ?crit :> Hi, > > Thanks for your answer. > However how comes that the init_all_handlers method exists? Is it some work-in-progress or may I prune it as well ? > > Bests, > > Stefano > ________________________________________ > From: wxruby-development-bounces at rubyforge.org [wxruby-development-bounces at rubyforge.org] On Behalf Of Pascal Hurni [pascal_hurni at fastmail.fm] > Sent: Tuesday, August 31, 2010 8:37 AM > To: Internal/technical wxruby discussions > Subject: Re: [wxruby-development] Problems with Wx::XmlResource documentation > >
Mario Steele
2010-Aug-31 23:39 UTC
[wxruby-development] Problems with Wx::XmlResource documentation
Hello Stefano, On Tue, Aug 31, 2010 at 2:25 PM, Grioni Stefano <stefano.grioni at epfl.ch>wrote:> Hi, > > Thanks for your answer. > However how comes that the init_all_handlers method exists? Is it some > work-in-progress or may I prune it as well ? >The method init_all_handlers initializes all handlers that WxWidget''s use, such as Images, Media, so on and so forth. This method is actually called when Wx::main_loop is called, but users can run the method before the main loop, so as to allow for loading of certain resources before going into the main loop, such as a splash screen, or such. We don''t support all init*handler functions in the wxWidgets library, as it''s generally covered by a main one, and it''s automatically called upon without the need for the user to call them manually. We would need to see a valid reason to allow the function to be wrapped into wxRuby, that can''t be covered by something that already exists. The other part, where your importing an XRC File, in most general cases the XRC members for function calls on events, is generally used in generation of the C/C++ Code by the XRC WYSIWYG designer. It lays forth the ground work in the C++ files that it generates, and nothing further is connected. I believe trying to get event handlers to connect with Methods in Ruby, would be a bit harder to get working, as we have to get the class and symbol name, in order to correctly make the connection. Some people don''t define method call-backs in the same class as the GUI Element. Which is part of what makes wxRuby so much more dynamic, instead of having a singular static way of doing things, there are many ways in which to connect things together. hth, Mario Bests,> > Stefano > ________________________________________ > From: wxruby-development-bounces at rubyforge.org [ > wxruby-development-bounces at rubyforge.org] On Behalf Of Pascal Hurni [ > pascal_hurni at fastmail.fm] > Sent: Tuesday, August 31, 2010 8:37 AM > To: Internal/technical wxruby discussions > Subject: Re: [wxruby-development] Problems with Wx::XmlResource > documentation > > Hi, > > Welcome to wxruby! > > AFAICT the classes docs were initially created by parsing the original > WxWidget code or doc. Then they were modified to match ruby behaviour where > it matches. Thus the XmlResource doc is out of date because as you > discovered several methods are not implemented. > > Got from the SWIG files: > // Can''t write XRC handlers in Ruby > %ignore wxXmlResource::AddHandler; > %ignore wxXmlResource::ClearHandlers; > %ignore wxXmlResource::InsertHandler; > > So these methods are not available in ruby, I think you may submit a ticket > with a patch removing the doc for these methods. We certainly can re-doc > them the day we support handlers. > > Once again AFAIK, handlers & events are ignored for the moment. So you may > not register an event method like shown on your XML. > > Personnaly I patched and subclassed some items in wxruby (all from ruby > code, no C patches) that simplifies working with XRC (sorry folks I''m not on > the xrcise side). These patches may be a little outdated (back to version > ~1.9.7). > > Best Regards, > > Pascal > > Le 26.08.10 15:21, Grioni Stefano a ?crit : > Hello, > > I have just started using WxWidgets, as I now need to design > cross-plateform GUIs for an application and I have been experiencing some > troubles finding my way through the existing documentation (several broken > links, lack of description about some methods,?) > > I am therefore compiling a little patch correcting the mistakes I found. > There are however some things I just don?t get, and I would like to have > your point of view about them. > > > - In the online doc of xmlresource class ( > http://wxruby.rubyforge.org/doc/xmlresource.html) , there is a link named > ?XML-based resource system overview? that is broken. Do you wanna remove > such link of did the resource just move elsewhere, and so the link just has > to be fixed? > > - Several methods ( like ?add_handler? seem to be removed from > the actual class, do you want me to remove them from the page as well?) > > - I really don?t understand what the ?init_all_handlers? is > supposed to do. In fact I created a handler in my xrc for a ?choice? : > > <object class="wxChoice" name="choice_box"> > > <handler > event="EVT_CHOICE">change_something</handler> > > <selection>0</selection> > > <content> > > <item>Swiss Production Only</item> > > <item>World Production comparison</item> > > <item>World Consumption comparison</item> > > <item>Swiss detailed charts</item> > > </content> > > <font> > > <style>normal</style> > > <family>default</family> > > <weight>normal</weight> > > <face>MS Shell Dlg 2</face> > > <underlined>0</underlined> > > <size>12</size> > > </font> > > </object> > > But in fact, nothing happens when I change the selected item in the menu > (despite the fact that I actually have a ?change_something? method). > > > > > > I would be glad to bring my little help to the project so that future devs > won?t ask themselves the same questions, I just need a little infos in > order to see how this things were imagined. > > > > Bests, > > > > Stefano > > > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org<mailto:wxruby-development at rubyforge.org> > http://rubyforge.org/mailman/listinfo/wxruby-development > > > _______________________________________________ > wxruby-development mailing list > wxruby-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-development >-- Mario Steele Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet http://www.trekfederation.com http://geo99.ruby-im.net -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-development/attachments/20100831/7a1a3a01/attachment.html>
Grioni Stefano
2010-Sep-01 10:16 UTC
[wxruby-development] Problems with Wx::XmlResource documentation
Hello, I am not sure to fully understand what you mean. If I come back to my case of choice-box. I would like to call the "change_something" method each time the choice of the menu is changed. What would be the correct way to do it? Because I first have to retrieve such Choice object (and I did not see anywhere in the documentation an explanation about how to perform this) and then call evt_choice(my_choice_object, : change_something) in order to bound them together. Right? Wouldn''t it just be easier to perform it automatically on init? I mean, when the xrc is parsed, and an handler tag is encountered, everything we need is already there, so why just not call the method at that time? I feel that I am mis-understanding the logic behind your choice, so excuse me for such questions. Bests, Stefano From: wxruby-development-bounces at rubyforge.org [mailto:wxruby-development-bounces at rubyforge.org] On Behalf Of Mario Steele Sent: mercredi 1 septembre 2010 01:39 To: Internal/technical wxruby discussions Subject: Re: [wxruby-development] Problems with Wx::XmlResource documentation Hello Stefano, On Tue, Aug 31, 2010 at 2:25 PM, Grioni Stefano <stefano.grioni at epfl.ch<mailto:stefano.grioni at epfl.ch>> wrote: Hi, Thanks for your answer. However how comes that the init_all_handlers method exists? Is it some work-in-progress or may I prune it as well ? The method init_all_handlers initializes all handlers that WxWidget''s use, such as Images, Media, so on and so forth. This method is actually called when Wx::main_loop is called, but users can run the method before the main loop, so as to allow for loading of certain resources before going into the main loop, such as a splash screen, or such. We don''t support all init*handler functions in the wxWidgets library, as it''s generally covered by a main one, and it''s automatically called upon without the need for the user to call them manually. We would need to see a valid reason to allow the function to be wrapped into wxRuby, that can''t be covered by something that already exists. The other part, where your importing an XRC File, in most general cases the XRC members for function calls on events, is generally used in generation of the C/C++ Code by the XRC WYSIWYG designer. It lays forth the ground work in the C++ files that it generates, and nothing further is connected. I believe trying to get event handlers to connect with Methods in Ruby, would be a bit harder to get working, as we have to get the class and symbol name, in order to correctly make the connection. Some people don''t define method call-backs in the same class as the GUI Element. Which is part of what makes wxRuby so much more dynamic, instead of having a singular static way of doing things, there are many ways in which to connect things together. hth, Mario Bests, Stefano ________________________________________ From: wxruby-development-bounces at rubyforge.org<mailto:wxruby-development-bounces at rubyforge.org> [wxruby-development-bounces at rubyforge.org<mailto:wxruby-development-bounces at rubyforge.org>] On Behalf Of Pascal Hurni [pascal_hurni at fastmail.fm<mailto:pascal_hurni at fastmail.fm>] Sent: Tuesday, August 31, 2010 8:37 AM To: Internal/technical wxruby discussions Subject: Re: [wxruby-development] Problems with Wx::XmlResource documentation Hi, Welcome to wxruby! AFAICT the classes docs were initially created by parsing the original WxWidget code or doc. Then they were modified to match ruby behaviour where it matches. Thus the XmlResource doc is out of date because as you discovered several methods are not implemented. Got from the SWIG files: // Can''t write XRC handlers in Ruby %ignore wxXmlResource::AddHandler; %ignore wxXmlResource::ClearHandlers; %ignore wxXmlResource::InsertHandler; So these methods are not available in ruby, I think you may submit a ticket with a patch removing the doc for these methods. We certainly can re-doc them the day we support handlers. Once again AFAIK, handlers & events are ignored for the moment. So you may not register an event method like shown on your XML. Personnaly I patched and subclassed some items in wxruby (all from ruby code, no C patches) that simplifies working with XRC (sorry folks I''m not on the xrcise side). These patches may be a little outdated (back to version ~1.9.7). Best Regards, Pascal Le 26.08.10 15:21, Grioni Stefano a ?crit : Hello, I have just started using WxWidgets, as I now need to design cross-plateform GUIs for an application and I have been experiencing some troubles finding my way through the existing documentation (several broken links, lack of description about some methods,...) I am therefore compiling a little patch correcting the mistakes I found. There are however some things I just don''t get, and I would like to have your point of view about them. - In the online doc of xmlresource class (http://wxruby.rubyforge.org/doc/xmlresource.html) , there is a link named "XML-based resource system overview" that is broken. Do you wanna remove such link of did the resource just move elsewhere, and so the link just has to be fixed? - Several methods ( like "add_handler" seem to be removed from the actual class, do you want me to remove them from the page as well?) - I really don''t understand what the "init_all_handlers" is supposed to do. In fact I created a handler in my xrc for a "choice" : <object class="wxChoice" name="choice_box"> <handler event="EVT_CHOICE">change_something</handler> <selection>0</selection> <content> <item>Swiss Production Only</item> <item>World Production comparison</item> <item>World Consumption comparison</item> <item>Swiss detailed charts</item> </content> <font> <style>normal</style> <family>default</family> <weight>normal</weight> <face>MS Shell Dlg 2</face> <underlined>0</underlined> <size>12</size> </font> </object> But in fact, nothing happens when I change the selected item in the menu (despite the fact that I actually have a "change_something" method). I would be glad to bring my little help to the project so that future devs won''t ask themselves the same questions, I just need a little infos in order to see how this things were imagined. Bests, Stefano _______________________________________________ wxruby-development mailing list wxruby-development at rubyforge.org<mailto:wxruby-development at rubyforge.org><mailto:wxruby-development at rubyforge.org<mailto:wxruby-development at rubyforge.org>> http://rubyforge.org/mailman/listinfo/wxruby-development _______________________________________________ wxruby-development mailing list wxruby-development at rubyforge.org<mailto:wxruby-development at rubyforge.org> http://rubyforge.org/mailman/listinfo/wxruby-development -- Mario Steele Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet http://www.trekfederation.com http://geo99.ruby-im.net -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/wxruby-development/attachments/20100901/8b8629d1/attachment-0001.html>