From fabio.petrucci at gmail.com Wed Jul 4 05:05:53 2007 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Wed, 4 Jul 2007 11:05:53 +0200 Subject: [Wxruby-users] loading menu using XmlResource Message-ID: Hi, i'm evaluating XmlResource: loading frame, dialogs and access widgets is ok but i'm not able to load menu bar and menu using the corresponding methods XmlResource#load_menu_barXmlResource#load_menui get the error saying 'XML resource 'Opzioni' (class 'wxMenu') not found!' trying to load a menu and 'XML resource 'ID_MENUBAR' (class 'wxMenuBar') not found!' trying to load a menu bar. Here is my xml: 300,300 wxnc 1 ... ... ..any hints? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070704/7258b7e2/attachment.html From mario at ruby-im.net Wed Jul 4 09:10:19 2007 From: mario at ruby-im.net (Mario Steele) Date: Wed, 04 Jul 2007 08:10:19 -0500 Subject: [Wxruby-users] loading menu using XmlResource In-Reply-To: References: Message-ID: On Wed, 04 Jul 2007 04:05:53 -0500, Fabio Petrucci wrote: > Hi, > i'm evaluating XmlResource: loading frame, dialogs and access widgets is > ok > but i'm not able to load menu bar and menu using the corresponding > methods > > XmlResource#load_menu_barXmlResource#load_menui get the error saying 'XML > resource 'Opzioni' (class 'wxMenu') not found!' trying to load a menu and > 'XML resource 'ID_MENUBAR' (class 'wxMenuBar') not found!' trying to > load a > menu bar. > > Here is my xml: > > > > > > 300,300 > wxnc > > > > > > > > > > name="ID_CONNETTI_AVVIO_MENU_ITEM"> > > 1 > > > > ... > ... > > > ..any hints? > > Thanks! Hey Fabio, I ran into this problem myself, when I was working with wxNotebook, and the subsiquent tabs that are within the notebook. Turns out, that XmlResource will only load Top level items, such as wxFrame, since it's a top level item. It will not recourse through the frame to get the subsiquent items. What you will need to do, is use the Method to retrive the menu bar from the frame, and find_menu off the menu bar, to retrive the ID's of it. It's what I had to use myself to retrive my menus in my code. Example Code: class MyFrame < Wx::Frame def initialize(parent) super() xml.load_frame_subclass(self,nil,"ID_NOTIFIER") MenuExit = self.get_menu_bar.find_menu_item("File","Esci") MenuCheck = self.get_menu_bar.find_menu_item("Opzioni","Connetti all'avvio") end end Just my example of how I did it. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From fabio.petrucci at gmail.com Wed Jul 4 10:22:39 2007 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Wed, 4 Jul 2007 16:22:39 +0200 Subject: [Wxruby-users] loading menu using XmlResource In-Reply-To: References: Message-ID: On 7/4/07, Mario Steele wrote: > > On Wed, 04 Jul 2007 04:05:53 -0500, Fabio Petrucci > wrote: > > > Hi, > > i'm evaluating XmlResource: loading frame, dialogs and access widgets is > > ok > > but i'm not able to load menu bar and menu using the corresponding > > methods > > > > XmlResource#load_menu_barXmlResource#load_menui get the error saying > 'XML > > resource 'Opzioni' (class 'wxMenu') not found!' trying to load a menu > and > > 'XML resource 'ID_MENUBAR' (class 'wxMenuBar') not found!' trying to > > load a > > menu bar. > > > > Here is my xml: > > > > > > > > > > > > > 300,300 > > wxnc > > > > > > > > > > > > > > > > > > > > > name="ID_CONNETTI_AVVIO_MENU_ITEM"> > > > > 1 > > > > > > > > ... > > ... > > > > > > ..any hints? > > > > Thanks! > > Hey Fabio, > > I ran into this problem myself, when I was working with wxNotebook, and > the subsiquent tabs that are within the notebook. Turns out, that > XmlResource will only load Top level items, such as wxFrame, since it's a > top level item. It will not recourse through the frame to get the > subsiquent items. What you will need to do, is use the Method to retrive > the menu bar from the frame, and find_menu off the menu bar, to retrive > the ID's of it. It's what I had to use myself to retrive my menus in my > code. > > Example Code: > > class MyFrame < Wx::Frame > def initialize(parent) > super() > xml.load_frame_subclass(self,nil,"ID_NOTIFIER") > MenuExit = self.get_menu_bar.find_menu_item("File","Esci") > MenuCheck = self.get_menu_bar.find_menu_item > ("Opzioni","Connetti > all'avvio") > end > end > > > Just my example of how I did it. > > > -- > Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > Thank you Mario, i had the same problem loading notebook's pages into subclass of the same type (for a cleaner code) but i had to give up. For the menu i think to adopt your solution. thanks again. fabio. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070704/ef6807be/attachment-0001.html From alex at pressure.to Wed Jul 4 11:54:32 2007 From: alex at pressure.to (Alex Fenton) Date: Wed, 04 Jul 2007 16:54:32 +0100 Subject: [Wxruby-users] loading menu using XmlResource In-Reply-To: References: Message-ID: <468BC2B8.7010707@pressure.to> Hi Fabio Fabio Petrucci wrote: > Hi, > i'm evaluating XmlResource: loading frame, dialogs and access widgets > is ok but i'm not able to load menu bar and menu using the > corresponding methods I think the problem with the XRC file you attached is that it describes a Wx::Frame, not a Wx::MenuBar. I don't think it's permitted to load a MenuBar from within a bigger XRC description of another class. I've attached below a modified version of your XRC that works for me using load_menu_bar. You should also check that you're using #load(filename) to load up the correct file first. If you wanted to load a complete frame layout including a MenuBar, as in your original file, you should use load_frame (or load_frame_subclass) instead. hth alex 1 From alex at pressure.to Wed Jul 4 12:12:00 2007 From: alex at pressure.to (Alex Fenton) Date: Wed, 04 Jul 2007 17:12:00 +0100 Subject: [Wxruby-users] loading menu using XmlResource In-Reply-To: References: Message-ID: <468BC6D0.1060405@pressure.to> Mario Steele wrote: > I ran into this problem myself, when I was working with wxNotebook, and > the subsiquent tabs that are within the notebook. Turns out, that > XmlResource will only load Top level items, such as wxFrame, since it's a > top level item. Sorry, I missed your answer Mario - I think this is the problem with Fabio's XRC - ie that the root item in the XRC must be the one being loaded. But I think you should be able to load individual tabs within a Notebook using load_panel or load_panel_subclass. For convenience, I've altered XmlResource#load so that it raises an exception if loading a file failed (eg file didn't exist, or invalid XML), rather than failing silently. a From auguusstt at gmail.com Thu Jul 5 05:54:50 2007 From: auguusstt at gmail.com (peng.chen) Date: Thu, 5 Jul 2007 17:54:50 +0800 Subject: [Wxruby-users] when can publish the next version? Message-ID: when can publish the next version? i am waiting... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070705/a6ca2f84/attachment.html From alex at pressure.to Thu Jul 5 08:18:04 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 05 Jul 2007 13:18:04 +0100 Subject: [Wxruby-users] when can publish the next version? In-Reply-To: References: Message-ID: <468CE17C.20307@pressure.to> peng.chen wrote: > when can publish the next version? > Should be a couple of weeks. The big memory management fixes and overhaul of the event handling is done, there's some new classes added, but there's one or two crashers and other bugs I need to fix before release. Because it's got more stable and doesn't leak memory everywhere, I'm planning to release the next version as wxruby 1.9.0 - ie a beta release in advance of wxruby 2.0 alex From fabio.petrucci at gmail.com Thu Jul 5 11:17:40 2007 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Thu, 5 Jul 2007 17:17:40 +0200 Subject: [Wxruby-users] when can publish the next version? In-Reply-To: <468CE17C.20307@pressure.to> References: <468CE17C.20307@pressure.to> Message-ID: On 7/5/07, Alex Fenton wrote: > > peng.chen wrote: > > when can publish the next version? > > > Should be a couple of weeks. The big memory management fixes and > overhaul of the event handling is done, there's some new classes added, > but there's one or two crashers and other bugs I need to fix before > release. > > Because it's got more stable and doesn't leak memory everywhere, I'm > planning to release the next version as wxruby 1.9.0 - ie a beta release > in advance of wxruby 2.0 > > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > I'm looking forward to grab the new gem :) Take your time... and keep up the good work!! fabio. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070705/8ff11a9d/attachment.html From mario at ruby-im.net Thu Jul 5 21:32:04 2007 From: mario at ruby-im.net (Mario Steele) Date: Thu, 05 Jul 2007 20:32:04 -0500 Subject: [Wxruby-users] loading menu using XmlResource In-Reply-To: <468BC6D0.1060405@pressure.to> References: <468BC6D0.1060405@pressure.to> Message-ID: On Wed, 04 Jul 2007 11:12:00 -0500, Alex Fenton wrote: > Mario Steele wrote: >> I ran into this problem myself, when I was working with wxNotebook, and >> the subsiquent tabs that are within the notebook. Turns out, that >> XmlResource will only load Top level items, such as wxFrame, since it's >> a >> top level item. > Sorry, I missed your answer Mario - I think this is the problem with > Fabio's XRC - ie that the root item in the XRC must be the one > being loaded. > > But I think you should be able to load individual tabs within a Notebook > using load_panel or load_panel_subclass. > > For convenience, I've altered XmlResource#load so that it raises an > exception if loading a file failed (eg file didn't exist, or invalid > XML), rather than failing silently. > > a > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users This is what I am saying Alex, wxRuby's XmlResource loader, will not allow you to load subitems on demand. Trust me, I've looked through the code, and it's one of the downfalls to using wxGlade with wxRuby2, it will not load sub-controls on demand. I was using it, so I could have a single control definition in the XRC for my client, and it wouldn't generate copies of the tab on demand, but it wouldn't do that, so I had to go to generating it manually. Mario Steele -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From auguusstt at gmail.com Thu Jul 5 21:54:05 2007 From: auguusstt at gmail.com (peng.chen) Date: Fri, 6 Jul 2007 09:54:05 +0800 Subject: [Wxruby-users] when can publish the next version? In-Reply-To: References: <468CE17C.20307@pressure.to> Message-ID: Greate work,waiting , Can you fix treeCtrl.on_compare_items on next release? On 7/5/07, Fabio Petrucci wrote: > > On 7/5/07, Alex Fenton wrote: > > > > peng.chen wrote: > > > when can publish the next version? > > > > > Should be a couple of weeks. The big memory management fixes and > > overhaul of the event handling is done, there's some new classes added, > > but there's one or two crashers and other bugs I need to fix before > > release. > > > > Because it's got more stable and doesn't leak memory everywhere, I'm > > planning to release the next version as wxruby 1.9.0 - ie a beta release > > in advance of wxruby 2.0 > > > > alex > > > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > I'm looking forward to grab the new gem :) > > Take your time... and keep up the good work!! > > fabio. > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070706/fe7244e5/attachment.html From alex at pressure.to Fri Jul 6 03:17:37 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 06 Jul 2007 08:17:37 +0100 Subject: [Wxruby-users] when can publish the next version? In-Reply-To: References: <468CE17C.20307@pressure.to> Message-ID: <468DEC91.3050701@pressure.to> peng.chen wrote: > Can you fix treeCtrl.on_compare_items on next release? > I don't believe this method is broken - it's used successfully in samples/treectrl/treectrl.rb to do the reverse sort, and I'm finding it fine in my own code. See also: https://rubyforge.org/tracker/index.php?func=detail&aid=11708&group_id=35&atid=218 If you still think it needs fixing, please send in a non-working example thanks alex From auguusstt at gmail.com Sun Jul 8 22:12:58 2007 From: auguusstt at gmail.com (peng.chen) Date: Mon, 9 Jul 2007 10:12:58 +0800 Subject: [Wxruby-users] when can publish the next version? In-Reply-To: <468DEC91.3050701@pressure.to> References: <468CE17C.20307@pressure.to> <468DEC91.3050701@pressure.to> Message-ID: on_compare_items is not broken? or lack something? run it : -------------------------------------------- require "wx" class MyTreeCtrl < Wx::TreeCtrl def initialize(parent) super parent, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::TR_DEFAULT_STYLE | Wx::TR_EDIT_LABELS #|Wx::TR_MULTIPLE evt_right_down do |event| menu = Wx::Menu.new() sort_id=2001 sort=Wx::MenuItem.new(menu, sort_id,"sort") menu.append_item(sort) self.evt_menu(sort_id){ do_sort(false) } r_sort_id=2002 r_sort=Wx::MenuItem.new(menu, r_sort_id,"reverse sort") menu.append_item(r_sort) self.evt_menu(r_sort_id){ do_sort(true) } popup_menu(menu, Wx::Point.new(event.get_x(), event.get_y())) end end def do_sort(reverse_sort) return if get_selection<0 puts "sort:#{reverse_sort}:#{get_selection}" sort_children(get_selection) end def on_compare_items(item1,item2) puts "on_compare_items" #nothing output! if @reverse_sort # just exchange 1st and 2nd items return super(item2, item1) else return super(item1, item2) end end end class MyFrame < Wx::Frame def initialize(title) super(nil, -1, title) @tree=MyTreeCtrl.new(self) @root = @tree.add_root("The Root Item") 0.upto(10) do |x| child= @tree.append_item(@root, "Item " + x.to_s()) @tree.sort_children(child) end end end class MyApp < Wx::App def on_init $frame = MyFrame.new("Minimal wxRuby App") $frame.show return true end def on_fatal_exception puts("on_fatal_exception") end def on_exit puts("on_exit") return super end end a = MyApp.new a.main_loop() GC.start On 7/6/07, Alex Fenton wrote: > > peng.chen wrote: > > Can you fix treeCtrl.on_compare_items on next release? > > > I don't believe this method is broken - it's used successfully in > samples/treectrl/treectrl.rb to do the reverse sort, and I'm finding it > fine in my own code. > > See also: > > https://rubyforge.org/tracker/index.php?func=detail&aid=11708&group_id=35&atid=218 > > If you still think it needs fixing, please send in a non-working example > > thanks > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070709/71ffa0af/attachment-0001.html From auguusstt at gmail.com Sun Jul 8 22:15:20 2007 From: auguusstt at gmail.com (peng.chen) Date: Mon, 9 Jul 2007 10:15:20 +0800 Subject: [Wxruby-users] when can publish the next version? In-Reply-To: References: <468CE17C.20307@pressure.to> <468DEC91.3050701@pressure.to> Message-ID: samples\treectrl\treectrl.rb "sort" and "Reverse sort" menu can not work too -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070709/991a89f5/attachment.html From alex at pressure.to Tue Jul 10 07:20:48 2007 From: alex at pressure.to (Alex Fenton) Date: Tue, 10 Jul 2007 12:20:48 +0100 Subject: [Wxruby-users] when can publish the next version? In-Reply-To: References: <468CE17C.20307@pressure.to> <468DEC91.3050701@pressure.to> Message-ID: <46936B90.1030608@pressure.to> Hi peng I tried your sample on Windows and it's not working for me (but it was on OS X). I wonder if this is because of the different inheritance chain or something. Unfortunately I've had my laptop nicked so can't look into it further for a little while. But will hopefully fix for 0.41 a peng.chen wrote: > on_compare_items is not broken? > or lack something? > > run it : From ac251404 at ohio.edu Tue Jul 10 12:08:48 2007 From: ac251404 at ohio.edu (Alex Ciarlillo) Date: Tue, 10 Jul 2007 12:08:48 -0400 Subject: [Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong? Message-ID: <4693AF10.9040501@ohio.edu> Some odd bug cropped up when I made a bunch of code changes to my app recently. I started getting the following everytime I closed the app: ---------------------------------- [BUG] Segmentation fault ruby 1.8.6 (2007-03-13) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ---------------------------------------------- So I just started commenting everything out that wasn't completely necessary until it stopped. Here is the line which is responsible: class MyFrame < Wx::Frame def initialize(*args) super(*args) ### cut a bunch of commented out code that appears fine ### @statbar = StatusBar.new(self, -1) ### cut a bunch more code ### end end If I comment out the statbar line the app exits fine, if I leave it in I get the seg fault. Anyone have an idea why? Am I initializing it incorrectly or something? thanks, -alex From mario at ruby-im.net Wed Jul 11 00:37:07 2007 From: mario at ruby-im.net (Mario Steele) Date: Tue, 10 Jul 2007 23:37:07 -0500 Subject: [Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong? In-Reply-To: <4693AF10.9040501@ohio.edu> References: <4693AF10.9040501@ohio.edu> Message-ID: Hello Mr. Ciarlillo, First thing I notice, is that StatusBar.new isn't with the Wx namespace, are you ensuring that the Wx namespace is being included in the top source? If it is, then class MyFrame < Wx::Frame is not needed, it can be changed to class MyFrame < Frame. Otherwise, I see no problems with the Initialization of the StatusBar class. May be a memory bug, which will be solved with the 1.9 Pre-Beta release. Speaking of which, Mr. Fenton, are you going to include wxScintilla compiled into the 1.9/2.0 Beta releases? Just kinda curious there, cause I'm thinking of starting up a new project for a complete IDE, including a wxDialog Editor, similar to what wxGlade does, maybe even allow it to generate the wxRuby2 Code itself. Dunno, maybe allow preference to the developer on how that is setup. L8ers, Mario Steele On Tue, 10 Jul 2007 11:08:48 -0500, Alex Ciarlillo wrote: > Some odd bug cropped up when I made a bunch of code changes to my app > recently. I started getting the following everytime I closed the app: > ---------------------------------- > [BUG] Segmentation fault > ruby 1.8.6 (2007-03-13) [i386-mswin32] > > > This application has requested the Runtime to terminate it in an unusual > way. > Please contact the application's support team for more information. > ---------------------------------------------- > > So I just started commenting everything out that wasn't completely > necessary until it stopped. Here is the line which is responsible: > > class MyFrame < Wx::Frame > def initialize(*args) > super(*args) > ### cut a bunch of commented out code that appears fine ### > @statbar = StatusBar.new(self, -1) > ### cut a bunch more code ### > end > end > > If I comment out the statbar line the app exits fine, if I leave it in I > get the seg fault. Anyone have an idea why? Am I initializing it > incorrectly or something? > > thanks, > -alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From auguusstt at gmail.com Wed Jul 11 07:33:06 2007 From: auguusstt at gmail.com (peng.chen) Date: Wed, 11 Jul 2007 19:33:06 +0800 Subject: [Wxruby-users] when can publish the next version? In-Reply-To: <46936B90.1030608@pressure.to> References: <468CE17C.20307@pressure.to> <468DEC91.3050701@pressure.to> <46936B90.1030608@pressure.to> Message-ID: HI ALEX Thanks, Expecting very much that, next time i'll report bug I will add the Os system description On 7/10/07, Alex Fenton wrote: > > Hi peng > > I tried your sample on Windows and it's not working for me (but it was > on OS X). I wonder if this is because of the different inheritance chain > or something. > > Unfortunately I've had my laptop nicked so can't look into it further > for a little while. But will hopefully fix for 0.41 > > a > > peng.chen wrote: > > on_compare_items is not broken? > > or lack something? > > > > run it : > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070711/78044b60/attachment.html From ac251404 at ohio.edu Wed Jul 11 11:01:41 2007 From: ac251404 at ohio.edu (Alex Ciarlillo) Date: Wed, 11 Jul 2007 11:01:41 -0400 Subject: [Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong? In-Reply-To: References: <4693AF10.9040501@ohio.edu> Message-ID: <4694F0D5.7030206@ohio.edu> I have included Wx namespace, but I also tried with Wx not included and using the Wx:: prefix. No luck. Thanks -AC Mario Steele wrote: > Hello Mr. Ciarlillo, > > First thing I notice, is that StatusBar.new isn't with the Wx namespace, > are you ensuring that the Wx namespace is being included in the top > source? If it is, then class MyFrame < Wx::Frame is not needed, it can be > changed to class MyFrame < Frame. Otherwise, I see no problems with the > Initialization of the StatusBar class. May be a memory bug, which will be > solved with the 1.9 Pre-Beta release. Speaking of which, Mr. Fenton, are > you going to include wxScintilla compiled into the 1.9/2.0 Beta releases? > Just kinda curious there, cause I'm thinking of starting up a new project > for a complete IDE, including a wxDialog Editor, similar to what wxGlade > does, maybe even allow it to generate the wxRuby2 Code itself. Dunno, > maybe allow preference to the developer on how that is setup. > > L8ers, > > Mario Steele > > On Tue, 10 Jul 2007 11:08:48 -0500, Alex Ciarlillo > wrote: > > >> Some odd bug cropped up when I made a bunch of code changes to my app >> recently. I started getting the following everytime I closed the app: >> ---------------------------------- >> [BUG] Segmentation fault >> ruby 1.8.6 (2007-03-13) [i386-mswin32] >> >> >> This application has requested the Runtime to terminate it in an unusual >> way. >> Please contact the application's support team for more information. >> ---------------------------------------------- >> >> So I just started commenting everything out that wasn't completely >> necessary until it stopped. Here is the line which is responsible: >> >> class MyFrame < Wx::Frame >> def initialize(*args) >> super(*args) >> ### cut a bunch of commented out code that appears fine ### >> @statbar = StatusBar.new(self, -1) >> ### cut a bunch more code ### >> end >> end >> >> If I comment out the statbar line the app exits fine, if I leave it in I >> get the seg fault. Anyone have an idea why? Am I initializing it >> incorrectly or something? >> >> thanks, >> -alex >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > > > From alex at pressure.to Thu Jul 12 13:27:17 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Jul 2007 18:27:17 +0100 Subject: [Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong? In-Reply-To: <4693AF10.9040501@ohio.edu> References: <4693AF10.9040501@ohio.edu> Message-ID: <1184261237.5711.2.camel@Belial> Hi Alex On Tue, 2007-07-10 at 12:08 -0400, Alex Ciarlillo wrote: > Some odd bug cropped up when I made a bunch of code changes to my app > recently. I started getting the following everytime I closed the app: > ---------------------------------- > [BUG] Segmentation fault > ruby 1.8.6 (2007-03-13) [i386-mswin32] Looks like a GC-related bug - when the App closes, Ruby does a last sweep, which sometimes turns up bugs. Does it help if you call set_status_bar(@statbar) Unfortunately I had my laptop nicked the other day so it'll take a little while before I can debug this. I've added it as a bug on the Rubyforge tracker. cheers alex From ac251404 at ohio.edu Thu Jul 12 13:40:28 2007 From: ac251404 at ohio.edu (Alex Ciarlillo) Date: Thu, 12 Jul 2007 13:40:28 -0400 Subject: [Wxruby-users] Seg Fault caused by StatusBar. Am I doing something wrong? In-Reply-To: <1184261237.5711.2.camel@Belial> References: <4693AF10.9040501@ohio.edu> <1184261237.5711.2.camel@Belial> Message-ID: <4696678C.50507@ohio.edu> I tried you're suggestion and it did not work, but I did it get working. I had to use the create_status_bar method of the frame, so I changed the line to: @statbar = self.create_status_bar and it works fine now. Hopefully that tells you something. Thanks! -AC Alex Fenton wrote: > Hi Alex > > On Tue, 2007-07-10 at 12:08 -0400, Alex Ciarlillo wrote: > >> Some odd bug cropped up when I made a bunch of code changes to my app >> recently. I started getting the following everytime I closed the app: >> ---------------------------------- >> [BUG] Segmentation fault >> ruby 1.8.6 (2007-03-13) [i386-mswin32] >> > > Looks like a GC-related bug - when the App closes, Ruby does a last > sweep, which sometimes turns up bugs. Does it help if you call > > set_status_bar(@statbar) > > Unfortunately I had my laptop nicked the other day so it'll take a > little while before I can debug this. I've added it as a bug on the > Rubyforge tracker. > > cheers > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From alex at pressure.to Thu Jul 12 17:03:47 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Jul 2007 22:03:47 +0100 Subject: [Wxruby-users] Wx::Scintilla In-Reply-To: References: <4693AF10.9040501@ohio.edu> Message-ID: <46969733.80501@pressure.to> Hey Mario Mario Steele wrote: > Speaking of which, Mr. Fenton, are > you going to include wxScintilla compiled into the 1.9/2.0 Beta releases? > Just kinda curious there, cause I'm thinking of starting up a new project > for a complete IDE, including a wxDialog Editor, similar to what wxGlade > does, maybe even allow it to generate the wxRuby2 Code itself. That sounds like a really cool project, and Wx::Scintilla is a great component - perhaps it might tempt the FreeRide people to switch over cos I think FxRuby really has little to offer versus wxRuby. But I don't personally feel able to put the time into it right now - at the moment all the other devs are tied up and I want to work on some other stuff so I'm looking to do the minimal stability fixes at the mo. Sorry. I'd happily help others and/or accept patches. best alex From bureaux.sebastien at neuf.fr Thu Jul 12 18:56:35 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 13 Jul 2007 00:56:35 +0200 Subject: [Wxruby-users] bmp => xpm Message-ID: <000501c7c4d7$e6338fa0$0201a8c0@SN111194970311> Salut Alex, je voudrais savoir comment faire pour passer le format bmp, par exemple, en format xpm? Est-ce qu'il est possible de lire des formats bmp(entre autre) avec StaticBitmap? C'est toi en photo dans l'exemple de StaticBitmap? merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070713/c3a5c873/attachment.html From alex at pressure.to Fri Jul 13 02:54:58 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 13 Jul 2007 07:54:58 +0100 Subject: [Wxruby-users] bmp => xpm In-Reply-To: <000501c7c4d7$e6338fa0$0201a8c0@SN111194970311> References: <000501c7c4d7$e6338fa0$0201a8c0@SN111194970311> Message-ID: <469721C2.6020906@pressure.to> Salut Sebastien wrote: > je voudrais savoir comment faire pour passer le format bmp, par > exemple, en format xpm? On peut ouvrir le format bmp et l'enregistrer comme xpm: image = Wx::Image.new('bitmap.bmp') image.save_file('bitmap_comme_xpm.xpm', Wx::BITMAP_TYPE_XPM) > Est-ce qu'il est possible de lire des formats bmp(entre autre) avec > StaticBitmap? Oui, ouvrez le fichier bmp avec Wx::Image: bitmap = Wx::Bitmap.new( Wx::Image.new('bitmap.bmp') ) sbmp = Wx::StaticBitmap.new(self, -1, bitmap) > C'est toi en photo dans l'exemple de StaticBitmap? hehe! - non - je crois que c'est un des developpeurs de wxPython. alex From bureaux.sebastien at neuf.fr Fri Jul 20 17:49:37 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 20 Jul 2007 23:49:37 +0200 Subject: [Wxruby-users] Wx::StaticText Message-ID: <000501c7cb17$de5a3a90$0201a8c0@SN111194970311> Salut alex. J'ai une question a propos de wx::statictext(wxruby2) est-il possible de mettre les accents pour la langue fran?aise?, car pour l'instant je ne peut pas mettre l'accentuation alors que ?a marche bien avec "wxruby". merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070720/fde1a7e2/attachment.html From alex at pressure.to Sat Jul 21 10:36:54 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 21 Jul 2007 15:36:54 +0100 Subject: [Wxruby-users] Wx::StaticText In-Reply-To: <000501c7cb17$de5a3a90$0201a8c0@SN111194970311> References: <000501c7cb17$de5a3a90$0201a8c0@SN111194970311> Message-ID: <46A21A06.60003@pressure.to> Salut Sebastien Sebastien wrote: > J'ai une question a propos de wx::statictext(wxruby2) > est-il possible de mettre les accents pour la langue fran?aise?, car > pour l'instant je ne peut pas mettre l'accentuation alors que ?a > marche bien avec "wxruby". Oui, un des plus importants avantages de wxruby2 est qu'il mieux soutient les langues non-anglais. Mais on doit se servir de UTF-8 pour ecrire le logiciel en Ruby. Voyez la notice de votre *?diteur, et enregistrer votre fichiers ruby avec le codage 'UTF8'. Donc, au**pr?s du **d?but de votre logiciel, mettez $KCODE = 'u' cheers alex * From bureaux.sebastien at neuf.fr Sat Jul 21 11:19:44 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Sat, 21 Jul 2007 17:19:44 +0200 Subject: [Wxruby-users] Wx::StaticText Message-ID: <000501c7cbaa$9203f440$0201a8c0@SN111194970311> J'avais d?j? essayer avec $KCODE = 'u' ,mais ?a ne marche pas. J'ai essayer plusieurs endroit diff?rent pour le placement de $KCODE = 'u' et en encodant en utf-8 avec scite. Quand je met un accent, la string n'appara?t pas. C'est peut ?tre moi qui ne fait pas ce qu'il faut! Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070721/d59b8fcd/attachment.html From alex at pressure.to Sat Jul 21 11:58:20 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 21 Jul 2007 16:58:20 +0100 Subject: [Wxruby-users] Wx::StaticText In-Reply-To: <000501c7cbaa$9203f440$0201a8c0@SN111194970311> References: <000501c7cbaa$9203f440$0201a8c0@SN111194970311> Message-ID: <46A22D1C.80003@pressure.to> Sebastien wrote: > J'avais d?j? essayer avec $KCODE = 'u' ,mais ?a ne marche pas. > J'ai essayer plusieurs endroit diff?rent pour le placement de $KCODE > = 'u' et en encodant en utf-8 avec scite. > Quand je met un accent, la string n'appara?t pas. Le petit exemple au-dessus marche pour moi (Linux/GTK). Est-ce-qu'il marche quand vous essayez le sample samples/text/unicode.rb? alex __ $KCODE = 'u' require 'wx' class FrenchFrame < Wx::Frame def initialize(title) super(nil, -1, title) Wx::StaticText.new(self, -1, 'A-t-il r?ussi?') end end class FrenchApp < Wx::App def on_init frame = FrenchFrame.new("A-t-il r?ussi") # required frame.show() end end app = FrenchApp.new app.main_loop() From bureaux.sebastien at neuf.fr Sat Jul 21 12:10:15 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Sat, 21 Jul 2007 18:10:15 +0200 Subject: [Wxruby-users] Wx::StaticText Message-ID: <000501c7cbb1$a1336b60$0201a8c0@SN111194970311> Je vient d'essayer, l'application s'ouvre mais il n'y a pas de texte Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070721/c1f9ca76/attachment.html From bureaux.sebastien at neuf.fr Sat Jul 21 12:17:29 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Sat, 21 Jul 2007 18:17:29 +0200 Subject: [Wxruby-users] Wx::StaticText Message-ID: <000501c7cbb2$a2e82ad0$0201a8c0@SN111194970311> Voila ce que ?a fait quand j'encode en utf-8 $KCODE = 'u' require 'wx' class FrenchFrame < Wx::Frame def initialize(title) super(nil, -1, title) Wx::StaticText.new(self, -1, 'A-t-il r?si?') end end class FrenchApp < Wx::App def on_init frame = FrenchFrame.new("A-t-il r?si") # required frame.show() end end app = FrenchApp.new app.main_loop() et le message d'erreur: >rubyw essai.rbw essai.rbw:1: Invalid char `\357' in expression essai.rbw:1: Invalid char `\273' in expression essai.rbw:1: Invalid char `\277' in expression >Exit code: 1 Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070721/65b8c892/attachment.html From alex at pressure.to Sat Jul 21 12:59:56 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 21 Jul 2007 17:59:56 +0100 Subject: [Wxruby-users] Wx::StaticText In-Reply-To: <000501c7cbb2$a2e82ad0$0201a8c0@SN111194970311> References: <000501c7cbb2$a2e82ad0$0201a8c0@SN111194970311> Message-ID: <46A23B8C.4080706@pressure.to> D'accord, je vient d'essayer mon exemple sur WinXP, et il marche l? aussi. Est-ce que vous etes sur que vous avez enregistr? le fichier comme UTF-8, et que vous avez entr? chaque lettre correctement? On Sat, 21 Jul 2007 18:17:29 +0200, Sebastien wrote: > > Voila ce que ?a fait quand j'encode en utf-8 > ... > > Wx::StaticText.new(self, -1, 'A-t-il r?si?') > ... > > essai.rbw:1: Invalid char `\357' in expression > > essai.rbw:1: Invalid char `\273' in expression > > essai.rbw:1: Invalid char `\277' in expression > Il me semble que quand vous avez coll? l'exemple au Scite, les lettres ont devenu cass?. Veuillez essayer encore un fois, mais entrez les mots fran?ais par clavier. merci alex From bureaux.sebastien at neuf.fr Sat Jul 21 13:40:04 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Sat, 21 Jul 2007 19:40:04 +0200 Subject: [Wxruby-users] Wx::StaticText Message-ID: <000501c7cbbe$2c8f1db0$0201a8c0@SN111194970311> j'ai ressayer, ?a y est ?a marche. en fait, il faut que je fasse copier/coller, ensuite il faut que j'encode en utf-8 et donc voil? ce que ?a fait: Wx::StaticText.new(self, -1, 'A-t-il r??ussi?') et ensuite il faut que je r?encode en 8-bit et la je cr?er mon fichier "essai.rbw" et ?a marche. En fait je ne faisait pas les choses dans le bon ordre et je croyais qu'il fallait que je reste en utf-8 alors qu'il faut que je repasse en 8-bit. C'est bon. Je n'avais jamais encod? avant ?a.Maintenant je sais le faire. merci Juste une question ? part, vous vous trouvez dans quel pays? Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070721/a5b7de12/attachment.html From alex at pressure.to Sat Jul 21 13:53:13 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 21 Jul 2007 18:53:13 +0100 Subject: [Wxruby-users] Wx::StaticText In-Reply-To: <000501c7cbbe$2c8f1db0$0201a8c0@SN111194970311> References: <000501c7cbbe$2c8f1db0$0201a8c0@SN111194970311> Message-ID: <46A24809.8060909@pressure.to> Sebastien wrote: > j'ai ressayer, ?a y est ?a marche Tres bon. > Je n'avais jamais encod? avant ?a.Maintenant je sais le faire. Avec UTF-8 et wxruby2, on peut faire un logiciel qui affiche plusieurs langues etrangeres ensemble, par exemple, Japonais, Chinois etc. Avec l'ancien wxruby 0.6.0, on ne peut utiliser que sa propre langue. > Juste une question ? part, vous vous trouvez dans quel pays? J'habite au Royaume Uni - pas loin de France... alex From bureaux.sebastien at neuf.fr Wed Jul 25 05:34:16 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Wed, 25 Jul 2007 11:34:16 +0200 Subject: [Wxruby-users] taskbaricon Message-ID: <000501c7ce9e$f94fa710$0201a8c0@SN111194970311> Salut alex, j'ai un petit souci. quand j'utilise "demotaskbaricon" avec traducteur-wxruby, que j'ouvre mon application(donc l'icone appara?t dans la barre de lancement rapide) et que je ferme mon application, l'icone dispara?t tout de suite. Mais quand je l'utilise avec l'exemple Wizard et que je ferme mon application l'icone reste affich? dans la barre de lancement rapide. il faut que je pointe dessus avec le curser pour qu'il se retire. Pourquoi? je cherche la solution, mais en vain!!! si tu peut m'aiguiller.merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070725/cb9e19da/attachment.html From alex at pressure.to Wed Jul 25 11:44:32 2007 From: alex at pressure.to (Alex Fenton) Date: Wed, 25 Jul 2007 16:44:32 +0100 Subject: [Wxruby-users] taskbaricon In-Reply-To: <000501c7ce9e$f94fa710$0201a8c0@SN111194970311> References: <000501c7ce9e$f94fa710$0201a8c0@SN111194970311> Message-ID: <46A76FE0.8050303@pressure.to> Salut Sebastien wrote: > Salut alex, j'ai un petit souci. > quand j'utilise "demotaskbaricon" avec traducteur-wxruby, que j'ouvre > mon application(donc l'icone appara?t dans la barre de lancement > rapide) et que je ferme mon application, l'icone dispara?t tout de suite. > Mais quand je l'utilise avec l'exemple Wizard et que je ferme mon > application l'icone reste affich? dans la barre de lancement rapide. > il faut que je pointe dessus avec le curser pour qu'il se retire. > Pourquoi? Peut-etre on appelle "remove_icon()"? alex From bureaux.sebastien at neuf.fr Wed Jul 25 12:17:59 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Wed, 25 Jul 2007 18:17:59 +0200 Subject: [Wxruby-users] taskbaricon Message-ID: <000501c7ced7$5e3ec150$0201a8c0@SN111194970311> j'ai essayer mais le probl?me persiste. Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070725/de7acf17/attachment.html From alex at pressure.to Wed Jul 25 18:20:44 2007 From: alex at pressure.to (Alex Fenton) Date: Wed, 25 Jul 2007 23:20:44 +0100 Subject: [Wxruby-users] taskbaricon In-Reply-To: <000501c7ced7$5e3ec150$0201a8c0@SN111194970311> References: <000501c7ced7$5e3ec150$0201a8c0@SN111194970311> Message-ID: <46A7CCBC.5070908@pressure.to> Sebastien wrote: > j'ai essayer mais le probl?me persiste. C'est difficile de vous aider plus sans avoir vu aucun ?chantillon de code. Pouvez-vous envoyer un logiciel enti?re mais court qui montre le probl?me et rien d'autre, et d?crire ce que vous avez deja essay?? Merci alex From bureaux.sebastien at neuf.fr Thu Jul 26 06:34:29 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Thu, 26 Jul 2007 12:34:29 +0200 Subject: [Wxruby-users] taskbaricon Message-ID: <000501c7cf70$8f04c610$0201a8c0@SN111194970311> Salut alex, voil? le bout de code que j'utilise: require 'rubygems' require 'wx' include Wx $KCODE = 'u' Icone_sortie = 1 class Cocktails < App def on_init @icone = Icone.new(self) @cadre = Wizard.new(nil, -1, "Cocktails-wxruby") evt_close {|event| on_sortie(event)} page0 = WizardPageSimple.new($cadre) @cadre.run_wizard(page0) def on_sortie(event) @icone.remove_icon() destroy() exit() end end class Icone < TaskBarIcon def initialize(cadre) super() icone = creation_icone('beussico.bmp') set_icon(icone, 'Cocktails-wxruby') evt_menu(Icone_sortie) {exit} end def create_popup_menu menu = Menu.new menu.append(Icone_sortie, "Quittez Cocktails-wxruby") return menu end def creation_icone(image) chemin = File.join( File.dirname(__FILE__), 'images', image) redimension = Icon.new redimension.copy_from_bitmap(Bitmap.new(Image.new(chemin))) return redimension end end end Cocktails.new.main_loop() et donc quand je ferme mon application, l'ic?ne reste dans la barre de lancement rapide et il faut que je pointe dessus avec mon curser pour qu'il se retire. J'ai aussi essayer de placer la m?thode "def on_sortie(event)" dans la classe "Icone", mais le probl?me persiste. Par contre quand j'utilise "demotaskbaricon" dans une application qui contient une "frame" ?a marche corectement. Merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070726/64ca4ffa/attachment.html From alex at pressure.to Thu Jul 26 06:55:57 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 26 Jul 2007 11:55:57 +0100 Subject: [Wxruby-users] taskbaricon In-Reply-To: <000501c7cf70$8f04c610$0201a8c0@SN111194970311> References: <000501c7cf70$8f04c610$0201a8c0@SN111194970311> Message-ID: <46A87DBD.1010501@pressure.to> Le suivant marche pour moi. Je pense qu'on doit faire disparaitre l'icone, avec 'remove_icon', n'importe quellle maniere sort l'App - par 'evt_menu' du icone, ou par le fin du Wizard. Notez que si on se sert de "evt_close", on doit appeller 'event.skip' pour que le wizard soit vraiment ferme. alex class Cocktails < App def on_init @cadre = Wizard.new(nil, -1, "Cocktails-wxruby") @icone = Icone.new(@cadre) @cadre.evt_close { | e | @icone.remove_icon; e.skip } evt_wizard_finished(@cadre.get_id) { @icone.remove_icon; @cadre.close } evt_wizard_cancel(@cadre.get_id) { @icone.remove_icon; @cadre.close } page0 = WizardPageSimple.new($cadre) @cadre.run_wizard(page0) end end From bureaux.sebastien at neuf.fr Thu Jul 26 07:48:24 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Thu, 26 Jul 2007 13:48:24 +0200 Subject: [Wxruby-users] taskbaricon Message-ID: <000501c7cf7a$dfde0e20$0201a8c0@SN111194970311> J'ai compris. En fait il faut que j'initialise chaque bouton et donc maintenant l'ic?ne dispara?t. ok. merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070726/724cac0a/attachment.html From bureaux.sebastien at neuf.fr Fri Jul 27 09:43:40 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 27 Jul 2007 15:43:40 +0200 Subject: [Wxruby-users] taskbaricon Message-ID: <000501c7d054$24790650$0201a8c0@SN111194970311> Salut Alex, j'ai encore un petit probl?me. En fait quand je construit "Cocktailswxruby.exe" avec "rubyscript2exe", et que j'ex?cute mon ex?cutable, ?a ne m'affiche pas l'image de l'ic?ne dans la barre de lancement rapide.(il y a un message d'erreur qui s'affiche) Voil? le bout de code que j'utilise pour cr?er mon ".exe": rubyscript2exe Cocktailswxruby.rbw --rubyscript2exe-rubyw Apparament ?a ne trouve pas le chemin de l'image. Je cherche mais je n'arrive toujours pas ? trouv? la solution. merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070727/edea9e26/attachment.html From fabio.petrucci at gmail.com Fri Jul 27 14:34:20 2007 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 27 Jul 2007 20:34:20 +0200 Subject: [Wxruby-users] Wx::ListItem data Message-ID: Hi all, i have a question: i need a Wx::ListItem to wrap my content but i get a strange result... irb(main):001:0> require 'wx' => true irb(main):002:0> li = Wx::ListItem.new => # irb(main):003:0> li.set_data(3) => nil irb(main):004:0> li.get_data => 7 any hint? thank you, fabio. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070727/d814fe55/attachment.html From alex at pressure.to Sat Jul 28 07:40:28 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 28 Jul 2007 12:40:28 +0100 Subject: [Wxruby-users] Wx::ListItem data In-Reply-To: References: Message-ID: <46AB2B2C.7050700@pressure.to> Fabio Petrucci wrote: > i need a Wx::ListItem to wrap my content but i get a strange result... > > irb(main):001:0> require 'wx' > => true > irb(main):002:0> li = Wx::ListItem.new > => # > irb(main):003:0> li.set_data(3) > => nil > irb(main):004:0> li.get_data > => 7 Thanks for the report. We were missing a little wrapper round the function. This is fixed in SVN and will be in the upcoming release. cheers alex From ruby at schmidtwisser.de Sat Jul 28 08:55:33 2007 From: ruby at schmidtwisser.de (Gregor Schmidt) Date: Sat, 28 Jul 2007 14:55:33 +0200 Subject: [Wxruby-users] Modeless Dialog causes Application to hang on exit Message-ID: <2a50c7540707280555y6530ad6ev46bfa65d10c614d6@mail.gmail.com> Hello, my name is Gregor and I'm new to this list and to wxRuby/wxDialogs. That's why I wanted to introduce myself shortly. I'm a Ruby fan for 2 years now and I'm doing a lot of web development with Rails and a little Camping and I'm currently writing my Master's Thesis around Ruby. You may follow my thoughts on my blog www.nach-vorne.de if you want to. I'm trying to get warm with GUI application development with Ruby, of course and I like wxRuby since it gives my a native looking app on Mac (my development platform) and Windows (the target platform). I'm running OS X, Ruby 1.8.6, wxWidgets 2.84 and wxruby2-preview-0.0.40 But let's speak about the current problem, I'm facing. I'm having a problem, which was already mentioned on this list back in 2004 (http://rubyforge.org/pipermail/wxruby-users/2004-June/000612.html) but I cannot find any hint on a solution. I try building a modeless dialog (a plain WxDialog) with some controls and Ok Cancel buttons. I'm registering the Ok Click Event to store something in the database and closing the dialog using close or hide (I tried both). The dialog closes as expected. But unfortunately the whole application does not close, after I used the dialog. It may only be "closed" using Ctrl+C on the command line. To reproduce the problem you may use the code for SearchDialog in the "Using Dialog to talk to the User II" Tutorial. It acts the same. Thanks for any hints. Regards Gregor From alex at pressure.to Sat Jul 28 09:34:36 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 28 Jul 2007 14:34:36 +0100 Subject: [Wxruby-users] Modeless Dialog causes Application to hang on exit In-Reply-To: <2a50c7540707280555y6530ad6ev46bfa65d10c614d6@mail.gmail.com> References: <2a50c7540707280555y6530ad6ev46bfa65d10c614d6@mail.gmail.com> Message-ID: <46AB45EC.6010902@pressure.to> Hi Gregor Schmidt wrote: > my name is Gregor and I'm new to this list and to wxRuby/wxDialogs. > That's why I wanted to introduce myself shortly. > Welcome. Be interested > I try building a modeless dialog (a plain WxDialog) with some controls > and Ok Cancel buttons. I'm registering the Ok Click Event to store > something in the database and closing the dialog using close or hide > (I tried both). The dialog closes as expected. But unfortunately the > whole application does not close, after I used the dialog. It may only > be "closed" using Ctrl+C on the command line. > > To reproduce the problem you may use the code for SearchDialog in the > "Using Dialog to talk to the User II" Tutorial. It acts the same > I get the same issue with that sample on Linux. I think the solution is to call dialog.destroy() when you are sure that the dialog is no longer needed and before the App exits. An App won't exit cleanly if there are still windows hanging around, even if they aren't visible. For most windows (eg Frames and modal dialogs) this isn't a problem, because when a window is closed it implies that the window is no longer needed, and wxWidgets disposes of it. So, no explicit 'destroy' call is needed. But for modeless dialogs, the dialog could be re-shown at a later point, so destroy has to be called explicitly. AFAIK this is the same in wxPython. HTH alex From ruby at schmidtwisser.de Sat Jul 28 10:30:50 2007 From: ruby at schmidtwisser.de (Gregor Schmidt) Date: Sat, 28 Jul 2007 16:30:50 +0200 Subject: [Wxruby-users] Modeless Dialog causes Application to hang on exit In-Reply-To: <2a50c7540707280728o18332141u43d8d050f807cfc4@mail.gmail.com> References: <2a50c7540707280555y6530ad6ev46bfa65d10c614d6@mail.gmail.com> <46AB45EC.6010902@pressure.to> <2a50c7540707280728o18332141u43d8d050f807cfc4@mail.gmail.com> Message-ID: <2a50c7540707280730i4b1b03ddp7404aa16c8f06549@mail.gmail.com> Hello, Thanks for the hint. Now it closes correctly. I'm now registering an event handler for the close event of the dialog and destroy it in there. Perhaps somebody should update the example accordingly to demonstrate a correct solution. Cheers Gregor From alex at pressure.to Sat Jul 28 11:29:09 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 28 Jul 2007 16:29:09 +0100 Subject: [Wxruby-users] Modeless Dialog causes Application to hang on exit In-Reply-To: <2a50c7540707280730i4b1b03ddp7404aa16c8f06549@mail.gmail.com> References: <2a50c7540707280555y6530ad6ev46bfa65d10c614d6@mail.gmail.com> <46AB45EC.6010902@pressure.to> <2a50c7540707280728o18332141u43d8d050f807cfc4@mail.gmail.com> <2a50c7540707280730i4b1b03ddp7404aa16c8f06549@mail.gmail.com> Message-ID: <46AB60C5.6040002@pressure.to> Gregor Schmidt wrote: > Thanks for the hint. Now it closes correctly. I'm now registering an > event handler for the close event of the dialog and destroy it in > there. > Just a note that an alternative is to create the Dialog with the Frame as the parent, instead of nil i.e. dialog = SearchDialog.new(my_frame) Then when the Frame is closed, the Dialog is automatically disposed of too. So no explicit destroy is needed. It's just if it's a free-floating top level window with no parent that it will hang. > Perhaps somebody should update the example accordingly to demonstrate > a correct solution. > Will do. Some of the wiki tutorials are in need of some TLC. alex From ruby at schmidtwisser.de Sat Jul 28 11:36:23 2007 From: ruby at schmidtwisser.de (Gregor Schmidt) Date: Sat, 28 Jul 2007 17:36:23 +0200 Subject: [Wxruby-users] Modeless Dialog causes Application to hang on exit In-Reply-To: <46AB60C5.6040002@pressure.to> References: <2a50c7540707280555y6530ad6ev46bfa65d10c614d6@mail.gmail.com> <46AB45EC.6010902@pressure.to> <2a50c7540707280728o18332141u43d8d050f807cfc4@mail.gmail.com> <2a50c7540707280730i4b1b03ddp7404aa16c8f06549@mail.gmail.com> <46AB60C5.6040002@pressure.to> Message-ID: <2a50c7540707280836i2588431esbf586d26a4d6373a@mail.gmail.com> On 7/28/07, Alex Fenton wrote: > Gregor Schmidt wrote: > > Thanks for the hint. Now it closes correctly. I'm now registering an > > event handler for the close event of the dialog and destroy it in > > there. > > > Just a note that an alternative is to create the Dialog with the Frame > as the parent, instead of nil i.e. Okay, this is what I really wanted. Thanks again. Cheers, Gregor From alex at pressure.to Sun Jul 29 18:25:49 2007 From: alex at pressure.to (Alex Fenton) Date: Sun, 29 Jul 2007 23:25:49 +0100 Subject: [Wxruby-users] wxruby2 beta 1.9.0 released Message-ID: <46AD13ED.4020307@pressure.to> Hi I'm pleased to announce the release of wxruby2 version 1.9.0. This is a significant milestone for wxruby as this is the first release that we consider near to production quality. We hope that this 1.9.x series of releases will soon lead to a stable wxruby 2.0. = INSTALLATION The easiest way to install is using a ready-to-use binary gem for your platform: gem install wxruby Or download source or binaries from http://rubyforge.org/frs/?group_id=35 Important - if you've previously installed any of the wxruby2-preview series of gems, please uninstall these before installing 1.9.0 We hope to offer an OS X/PPC build at some point soon. = CHANGES Though there are a lot of code changes in this release, most of them dealt with internals. But though there's not that much shiny new functionality, we hope you'll like the improved stability, performance and integration with Ruby. * Completely overhauled the memory management system, fixing several widespread memory leaks, and crashers * Reworked the event handling system to allow user-defined event types to be written in ruby; added several missing events * Added HyperlinkCtrl * Enable custom ArtProviders to be written in Ruby * Many class-specific enhancements from the 2.8 API and bugfixes to problem methods * The usual additions and corrections to the docs and samples Full details are in the Changelog in the package. = KNOWN ISSUES There are a small number of method-specific bugs still outstanding; these are listed on the rubyforge Bug Tracker. Please add to this list and help us create a top-quality wxruby2. = DEVELOPMENT PLAN The plan is to tackle outstanding and newly-found bugs in this release and keep making 1.9.x releases until we have something we can call 2.0 Though wxruby2 doesn't support the whole wxWidgets 2.8 API, at the moment it isn't planned to add any more classes for 2.0. We feel the need for a stable, production-ready version of wxruby is greater than that for any particular class. But feel free to make a case for a class that you think MUST be in there, and we're still open to receiving patches ... = CREDITS Thanks to Sean Long for numerous code fixes and enhancements, as well as much time testing and providing builds. Thanks also to bug reporters and contributors on the mailing lists. Kevin Smith, who created wxruby2 and led the project for several years recently stepped down from the wxruby dev team. He deserves massive credit for all his work; without his efforts there would almost certainly not be this release today. We wish him all the best. cheers alex From mario at ruby-im.net Mon Jul 30 01:51:47 2007 From: mario at ruby-im.net (Mario Steele) Date: Mon, 30 Jul 2007 00:51:47 -0500 Subject: [Wxruby-users] wxruby2 beta 1.9.0 released In-Reply-To: <46AD13ED.4020307@pressure.to> References: <46AD13ED.4020307@pressure.to> Message-ID: Hey Alex, Great work you guys on the 1.9.0 beta release. I think I notice a dramatic improvement in load time from the begining of execution. Before it was like a second or so, before the app would load on my computer, now it's less then 300th of a second. Major improvement there. I found a little quirk in the way 1.9.0 works, compared to preview 0.0.40 works, and I think it's in the way you now handle Events. After reviewing the problem, and writting an email to the list, I found the fault in my logic. Before, I was using a method named connect in my app to make a connection to a Server, when the user prompted for it. Ofcourse, this now clashes with your current setup, which now runs with the ideal of evaluating defs for evt_* methods, then hard lining connecting them to the connect() method for events. Which threw me off guard. I ended up renaming the method I was using, and it works perfectly now. I'm going to give the TreeCtrl another try, and seperate the code specifically for it, so _IF_ I run into the same problem, I have a way to show you guys what's it is doing. Also, another plus, as I'm writting this email, there's definatly major improvement in performance. With preview 0.0.40, I was seeing slow times for processing text, and entering it into a RichEdit ctrl, and it seem to always take a few milliseconds to display the text. Now, it's just boom, it's there. Love it. I'll report back with any bugs, or quirks I find, so others will be able to see what has changed, and know what to expect. Mario Steele On Sun, 29 Jul 2007 17:25:49 -0500, Alex Fenton wrote: > Hi > > I'm pleased to announce the release of wxruby2 version 1.9.0. This is a > significant milestone for wxruby as this is the first release that we > consider near to production quality. We hope that this 1.9.x series of > releases will soon lead to a stable wxruby 2.0. > > = INSTALLATION > > The easiest way to install is using a ready-to-use binary gem for your > platform: > > gem install wxruby > > Or download source or binaries from http://rubyforge.org/frs/?group_id=35 > > Important - if you've previously installed any of the wxruby2-preview > series of gems, please uninstall these before installing 1.9.0 > > We hope to offer an OS X/PPC build at some point soon. > > = CHANGES > > Though there are a lot of code changes in this release, most of them > dealt with internals. But though there's not that much shiny new > functionality, we hope you'll like the improved stability, performance > and integration with Ruby. > > * Completely overhauled the memory management system, fixing several > widespread memory leaks, and crashers > * Reworked the event handling system to allow user-defined event types > to be written in ruby; added several missing events > * Added HyperlinkCtrl > * Enable custom ArtProviders to be written in Ruby > * Many class-specific enhancements from the 2.8 API and bugfixes to > problem methods > * The usual additions and corrections to the docs and samples > > Full details are in the Changelog in the package. > > = KNOWN ISSUES > > There are a small number of method-specific bugs still outstanding; > these are listed on the rubyforge Bug Tracker. Please add to this list > and help us create a top-quality wxruby2. > > = DEVELOPMENT PLAN > > The plan is to tackle outstanding and newly-found bugs in this release > and keep making 1.9.x releases until we have something we can call 2.0 > > Though wxruby2 doesn't support the whole wxWidgets 2.8 API, at the > moment it isn't planned to add any more classes for 2.0. We feel the > need for a stable, production-ready version of wxruby is greater than > that for any particular class. But feel free to make a case for a class > that you think MUST be in there, and we're still open to receiving > patches ... > > = CREDITS > > Thanks to Sean Long for numerous code fixes and enhancements, as well as > much time testing and providing builds. Thanks also to bug reporters and > contributors on the mailing lists. > > Kevin Smith, who created wxruby2 and led the project for several years > recently stepped down from the wxruby dev team. He deserves massive > credit for all his work; without his efforts there would almost > certainly not be this release today. We wish him all the best. > > cheers > alex > > > > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From alex at pressure.to Mon Jul 30 12:43:39 2007 From: alex at pressure.to (Alex Fenton) Date: Mon, 30 Jul 2007 17:43:39 +0100 Subject: [Wxruby-users] wxruby2 beta 1.9.0 released In-Reply-To: References: <46AD13ED.4020307@pressure.to> Message-ID: <46AE153B.6090903@pressure.to> Hi Mario Mario Steele wrote: > Great work you guys on the 1.9.0 beta release. Thanks for your kind words. The quality of this release is down to patient people like yourself and other on wxruby-users reporting wrong things with the preview releases as much as to the patches Sean and I have added. So a big thank you to you and everyone else who's pushed wxruby2 along. > I think I notice a > dramatic improvement in load time from the begining of execution. Before > it was like a second or so, before the app would load on my computer, now > it's less then 300th of a second. Although it wasn't a focus for this release, by sharing more code and stripping out redundant stuff, we managed to reduce the compiled lib's size slightly whilst adding functionality. So I'm seeing a 5%ish improvement in first-shot load time, but I'd expect that anything much more radical is down to OS caching. > Ofcourse, this now clashes with your current setup, which now runs with > the ideal of evaluating defs for evt_* methods, then hard lining > connecting them to the connect() method for events. Which threw me off > guard. There is now a connect(..) method in all EvtHandler classes, as per the wxWidgets API, making custom events possible. Classes inheriting from EvtHandler, including Wx::App, shouldn't define connect(..) but I don't think there should be other implications. > Also, another plus, as I'm writting this email, there's definatly major > improvement in performance. With preview 0.0.40, I was seeing slow times > for processing text, and entering it into a RichEdit ctrl, and it seem to > always take a few milliseconds to display the text. That's really interesting - and nice - to know. As I say, performance was much less of a priority than correctness and ruby integration for this release. But it's certainly possible that the changes to memory management and event handling are more efficient than the predecessors. all the best alex From mario at ruby-im.net Mon Jul 30 14:12:02 2007 From: mario at ruby-im.net (Mario Steele) Date: Mon, 30 Jul 2007 13:12:02 -0500 Subject: [Wxruby-users] wxruby2 beta 1.9.0 released In-Reply-To: <46AE153B.6090903@pressure.to> References: <46AD13ED.4020307@pressure.to> <46AE153B.6090903@pressure.to> Message-ID: Hey Alex, On 7/30/07, Alex Fenton wrote: > Although it wasn't a focus for this release, by sharing more code and > stripping out redundant stuff, we managed to reduce the compiled lib's > size slightly whilst adding functionality. So I'm seeing a 5%ish > improvement in first-shot load time, but I'd expect that anything much > more radical is down to OS caching. Well, I don't know what to tell you Alex, it's performance improved considerably. I may have to grab wxruby2-preview again, just to measure the difference between load times on these two versions, so there's some solid stats to show. > There is now a connect(..) method in all EvtHandler classes, as per the > wxWidgets API, making custom events possible. Classes inheriting from > EvtHandler, including Wx::App, shouldn't define connect(..) but I don't > think there should be other implications. I don't know, I'm using a Wx::Panel, and for some reason, it's attempting to use connect() on my Class, not the Wx::EvtHandler.connect() call. > That's really interesting - and nice - to know. As I say, performance > was much less of a priority than correctness and ruby integration for > this release. But it's certainly possible that the changes to memory > management and event handling are more efficient than the predecessors. It had to make some kind of major improvement on it, cause I'm definatly seeing improvement here. all the best alex _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070730/6fb990fb/attachment-0001.html From alex at pressure.to Mon Jul 30 16:50:00 2007 From: alex at pressure.to (Alex Fenton) Date: Mon, 30 Jul 2007 21:50:00 +0100 Subject: [Wxruby-users] taskbaricon In-Reply-To: <000501c7d054$24790650$0201a8c0@SN111194970311> References: <000501c7d054$24790650$0201a8c0@SN111194970311> Message-ID: <46AE4EF8.6090808@pressure.to> Sebastien wrote: > Salut Alex, j'ai encore un petit probl?me. > En fait quand je construit "Cocktailswxruby.exe" avec > "rubyscript2exe", et que j'ex?cute mon ex?cutable, ?a ne m'affiche pas > l'image de l'ic?ne dans la barre de lancement rapide.(il y a un > message d'erreur qui s'affiche) (for non-french speakers, Sebastien asked how to make an executable file compiled using rubyscript2exe plus wxruby find images for icons etc) Salut. Vous devez dire votre ex?cutable ou se trouve les fichiers ic?nes (non experiment?): def find_icon(img) # si le logiciel est fait avec rubyscript2exe, cherche un chemin pres de le .exe if defined? RUBYSCRIPT2EXE_APPEXE icon_chemin = File.dirname(RUBYSCRIPT2EXE_APPEXE) else icon_chemin = File.dirname($0) end img_file = File.join(icon_chemin, 'icons', img) # donc, creer un wx::Icon ou Wx::Bitmap end (or you can use Wx::ArtProvider to deal with the custom paths) Or, on peut se servir de Wx:::ArtProvider class RubyScript2ExeArtProvider < Wx::ArtProvider def initialize super if defined?(RUBYSCRIPT2EXE_APPEXE) @basedir = File.dirname(RUBYSCRIPT2EXE_APPEXE) else @basedir = File.dirname($0) end end def create_bitmap(file, size, client) bmp_file = File.join(@basedir, fize) Wx::Bitmap.new(bmp_file) end end ... Wx::ArtProvider.push(Rubyscript2ExeArtProvider) ... my_icon = Wx::ArtProvider.get_bitmap('icon_que_je_veux') alex From mario at ruby-im.net Mon Jul 30 22:22:30 2007 From: mario at ruby-im.net (Mario Steele) Date: Mon, 30 Jul 2007 21:22:30 -0500 Subject: [Wxruby-users] taskbaricon In-Reply-To: <46AE4EF8.6090808@pressure.to> References: <000501c7d054$24790650$0201a8c0@SN111194970311> <46AE4EF8.6090808@pressure.to> Message-ID: I just wanted to also toss in my two cents on this, about rubyscript2exe. It's a great app for Linux and Windows, but I prefer Exerb for Windows, and RubyScript2EXE for Linux, just so you guys know, what other options are out there. ;-) I like Exerb, because it reads all the code directly from the Executable, as well as the SO' files. They are stored in the RES File that's bound to the Executable. Doesn't extract them or anything, before executing it. Now if we could just get something like that on Linux and MacOS X, then we'll be in luck. Anyways, Laters, Mario Steele On Mon, 30 Jul 2007 15:50:00 -0500, Alex Fenton wrote: > Sebastien wrote: >> Salut Alex, j'ai encore un petit probl?me. >> En fait quand je construit "Cocktailswxruby.exe" avec >> "rubyscript2exe", et que j'ex?cute mon ex?cutable, ?a ne m'affiche pas >> l'image de l'ic?ne dans la barre de lancement rapide.(il y a un >> message d'erreur qui s'affiche) > (for non-french speakers, Sebastien asked how to make an executable file > compiled using rubyscript2exe plus wxruby find images for icons etc) > > Salut. Vous devez dire votre ex?cutable ou se trouve les fichiers ic?nes > (non experiment?): > > def find_icon(img) > # si le logiciel est fait avec rubyscript2exe, cherche un chemin pres > de le .exe > if defined? RUBYSCRIPT2EXE_APPEXE > icon_chemin = File.dirname(RUBYSCRIPT2EXE_APPEXE) > else > icon_chemin = File.dirname($0) > end > img_file = File.join(icon_chemin, 'icons', img) > # donc, creer un wx::Icon ou Wx::Bitmap > end > > (or you can use Wx::ArtProvider to deal with the custom paths) > > Or, on peut se servir de Wx:::ArtProvider > > class RubyScript2ExeArtProvider < Wx::ArtProvider > def initialize > super > if defined?(RUBYSCRIPT2EXE_APPEXE) > @basedir = File.dirname(RUBYSCRIPT2EXE_APPEXE) > else > @basedir = File.dirname($0) > end > end > > def create_bitmap(file, size, client) > bmp_file = File.join(@basedir, fize) > Wx::Bitmap.new(bmp_file) > end > end > > ... > > Wx::ArtProvider.push(Rubyscript2ExeArtProvider) > > ... > > my_icon = Wx::ArtProvider.get_bitmap('icon_que_je_veux') > > > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From alex at pressure.to Tue Jul 31 01:20:39 2007 From: alex at pressure.to (Alex Fenton) Date: Tue, 31 Jul 2007 06:20:39 +0100 Subject: [Wxruby-users] wxruby2 beta 1.9.0 released In-Reply-To: References: <46AD13ED.4020307@pressure.to> <46AE153B.6090903@pressure.to> Message-ID: <46AEC6A7.1070003@pressure.to> Mario Steele wrote: > > > There is now a connect(..) method in all EvtHandler classes, as per the > > wxWidgets API, making custom events possible. Classes inheriting from > > EvtHandler, including Wx::App, shouldn't define connect(..) but I don't > > think there should be other implications. > > I don't know, I'm using a Wx::Panel, and for some reason, it's > attempting to use connect() on my Class, not the > Wx::EvtHandler.connect() call. Sorry, I meant to say - user-defined subclasses of any EvtHandler (including subclasses of Panel) shouldn't normally include a connect method because it's called internally by evt_xxx methods. In theory we could make the evt_xxx methods call #connect in EvtHandler rather than the subclass (using instance_method(:connect).bind(self).call(...) ) but it would be kind of weird not to be able to override the method in Ruby, for example for debugging or tracing. > > That's really interesting - and nice - to know. As I say, performance > > was much less of a priority than correctness and ruby integration for > > this release. But it's certainly possible that the changes to memory > > management and event handling are more efficient than the predecessors. > > It had to make some kind of major improvement on it, cause I'm > definatly seeing improvement here. I haven't tried the release builds on Windows yet - I'm usually developing using a debug build which are slower. But no way am I going to complain about perceptible performance improvements, even if I can't explain them! cheers alex From mario at ruby-im.net Tue Jul 31 01:31:54 2007 From: mario at ruby-im.net (Mario Steele) Date: Tue, 31 Jul 2007 00:31:54 -0500 Subject: [Wxruby-users] wxruby2 beta 1.9.0 released In-Reply-To: <46AEC6A7.1070003@pressure.to> References: <46AD13ED.4020307@pressure.to> <46AE153B.6090903@pressure.to> <46AEC6A7.1070003@pressure.to> Message-ID: Hey Alex, Just wanted to let you know, that I have started working on the TreeCtrl, and so far, it's working greatly. It is now showing the Icons, no problems, using the same method as what I was using for ListCtrl. So that is good news. Hopefully, I'll have something to setup soon for showing on the site as an Ruby App developed with wxRuby. ^.^ L8ers, Mario Steele P.S. Got any Instant Messenger? Like to talk with you in real time. LOL -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From bureaux.sebastien at neuf.fr Tue Jul 31 17:22:42 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Tue, 31 Jul 2007 23:22:42 +0200 Subject: [Wxruby-users] taskbaricon Message-ID: <000501c7d3b8$ee722650$0201a8c0@SN111194970311> Bonsoir alex, j'ai essayer ce bout de code: def find_icon(img) # si le logiciel est fait avec rubyscript2exe, cherche un chemin pres de le .exe if defined? RUBYSCRIPT2EXE_APPEXE icon_chemin = File.dirname(RUBYSCRIPT2EXE_APPEXE) else icon_chemin = File.dirname($0) end img_file = File.join(icon_chemin, 'icons', img) # donc, creer un wx::Icon ou Wx::Bitmap end mais le probl?me c'est que maintenant quand j'essai de cr?er mon ex?cutable "Cocktails-wxruby.exe", ?a ne marche plus du tout avec l'ic?ne de la barre de lancement rapide. Part contre, quand j'enl?ve l'ic?ne de mon programme "Cocktails-wxruby", l'ex?cutable se fait correctement et marche bien. Ce bout de code a du bloquer quelques chose dans rubyscript2exe??? Que veut dire APPEXE ? merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070731/5117b9bb/attachment.html From alex at pressure.to Tue Jul 31 17:59:52 2007 From: alex at pressure.to (Alex Fenton) Date: Tue, 31 Jul 2007 22:59:52 +0100 Subject: [Wxruby-users] taskbaricon In-Reply-To: <000501c7d3b8$ee722650$0201a8c0@SN111194970311> References: <000501c7d3b8$ee722650$0201a8c0@SN111194970311> Message-ID: <46AFB0D8.30303@pressure.to> Sebastien wrote: > mais le probl?me c'est que maintenant quand j'essai de cr?er mon > ex?cutable "Cocktails-wxruby.exe", ?a ne marche plus du tout avec > l'ic?ne de la barre de lancement rapide. > Part contre, quand j'enl?ve l'ic?ne de mon programme > "Cocktails-wxruby", l'ex?cutable se fait correctement et marche bien. > Ce bout de code a du bloquer quelques chose dans rubyscript2exe??? Je n'avais pas essay? ce bout, mais je pensais qu'il vous donnerais quelques id?es. Donc, il se peut qu'on doive le corriger. Si on cr?e l'ex?cutable avec l'option "rubyw", on ne pourra pas voir une erreur - essayez le cr?er avec "ruby" pour que vouz puissiez voir l'erreur. > Que veut dire APPEXE ? RUBYSCRIPT2EXE_APPEXE contient le chemin ou se trouve cocktails-wxruby.exe, si le logiciel se fait comme une .exe. Donc, on peut l'utiliser pur trouver l'ic?ne relatif au chemin de l'executable, ou si RUBYSCRIPT2EXE_APPEXE n'existe pas, relatif au le fichier .rb Vraiment, ceci est un question de rubyscript2exe et pas de wxruby - je vous suggere de relire les docs... voyez aussi http://weft-qda.rubyforge.org/svn/trunk/weft-qda/weft-qda.rb merci alex