From lists at ruby-forum.com Wed Oct 1 00:52:14 2008 From: lists at ruby-forum.com (Zhimin Zhan) Date: Wed, 1 Oct 2008 06:52:14 +0200 Subject: [wxruby-users] undefined method 'end_edit_label' in Wx::TreeCtrl Message-ID: Hi, Maybe a documentation update. #> I raised the following issue (similar) before, sometimes a Wx::Rect object sometimes passed as an event. I found more occurrences, still quite rare though. Env: wxRuby 1.9.8 mswin32 on XP. Cheers, Zhimin -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Oct 1 01:17:04 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 01 Oct 2008 06:17:04 +0100 Subject: [wxruby-users] undefined method 'end_edit_label' in Wx::TreeCtrl In-Reply-To: References: Message-ID: <48E307D0.2090901@pressure.to> Hi Zhimin Zhimin Zhan wrote: > Maybe a documentation update. > > # #> > Thanks for the report - this method's missing from our headers. This won't be hard to fix. Looking at the wxWidgets code, it seems to be differently defined on different platforms, so I will take a closer look and try out. Filed here: http://rubyforge.org/tracker/index.php?func=detail&aid=22251&group_id=35&atid=218 > I raised the following issue (similar) before, sometimes a Wx::Rect > object sometimes passed as an event. I found more occurrences, still > quite rare though. > > Env: wxRuby 1.9.8 mswin32 on XP. > I'm pretty sure this is a similar memory allocation problem. A C++ pointer address is re-used before Ruby's GC has run, and the old ruby object linked to that pointer address (the Rect) is being passed to the handler, instead of the new one (the Event). Do you happen to know if this is a new error since 1.9.8? thanks alex From lists at ruby-forum.com Wed Oct 1 03:50:44 2008 From: lists at ruby-forum.com (Joseph Edelstein) Date: Wed, 1 Oct 2008 09:50:44 +0200 Subject: [wxruby-users] brain freeze on how to program Message-ID: I have come to a complete brick wall in my mind. I am trying to write a game where the user has to hit the space bar as close to a sound that plays every second. If the user hits the space bar and releases it before the sound, one set of boxes will light up. If the user hits and releases the space bar after the sound, another set of boxes will light up. I have some code but am blanking on how to move forward. Need some guidance from better programmers then I. Thanks in advance. Joe Code sample: def ag_start total = 5 c = 0 sound_timer = Timer.every(1000) {Sound.play("c:\\windows\\media\\chimes.wav")} while c < total ####listen for half a second for if user presses the space bar before the sound # # evt_key_up() { | event | if event.get_key_code == 32 then #get the time difference from the key up to the sound } # # #play sound ######################## # # evt_key_up() { | event | if event.get_key_code == 32 then #get the time difference from the sound to the key up } # # #listen for half a second for if the user presses the space bar after the sound # #repeat for time required c = c + 1 end #sound_timer.stop end -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Oct 1 10:08:33 2008 From: lists at ruby-forum.com (Ross Goodell) Date: Wed, 1 Oct 2008 16:08:33 +0200 Subject: [wxruby-users] How can I find out the state of capslock? Message-ID: <8d296acc4380a7ddc95b57c91d1daf90@ruby-forum.com> Although I can use KeyEvent#shift_down to find out if the shift key was held down when a key is pressed, I don't know how to find out if the capslock key is in effect (the capslock key was pressed the capslock LED is on, and other programs are treating an 'a' keypress as an 'A'). I could catch capslock keypresses by checking evt.get_key_code for 311, but don't know what the starting capslock state is since it might have been set when the user was in another program. Can someone tell me how to find out what what the capslock state is? Thanks, Ross -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Oct 1 10:21:35 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 01 Oct 2008 15:21:35 +0100 Subject: [wxruby-users] How can I find out the state of capslock? In-Reply-To: <8d296acc4380a7ddc95b57c91d1daf90@ruby-forum.com> References: <8d296acc4380a7ddc95b57c91d1daf90@ruby-forum.com> Message-ID: <48E3876F.9060207@pressure.to> Hi Ross Ross Goodell wrote: > Although I can use KeyEvent#shift_down to find out if the shift key was > held down when a key is pressed, I don't know how to find out if the > capslock key is in effect (the capslock key was pressed the capslock LED > is on, and other programs are treating an 'a' keypress as an 'A'). I > could catch capslock keypresses by checking evt.get_key_code for 311, > but don't know what the starting capslock state is since it might have > been set when the user was in another program. Can someone tell me how > to find out what what the capslock state is? Wx::get_key_state(Wx::K_CAPITAL) Wx::get_key_state is a global method that returns true/false depending on whether the key with the specified code is currently depressed. Specially, for the toggle "lock" keys num / caps / scroll (whose integer key codes are Wx::K_NUMLOCK, Wx::K_CAPITAL and Wx::K_SCROLL) it instead returns true if the relevant lock is currently on. a From alex at pressure.to Wed Oct 1 10:26:54 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 01 Oct 2008 15:26:54 +0100 Subject: [wxruby-users] brain freeze on how to program In-Reply-To: References: Message-ID: <48E388AE.4020705@pressure.to> Joseph Edelstein wrote: > I have come to a complete brick wall in my mind. I am trying to write a > game where the user has to hit the space bar as close to a sound that > plays every second. If the user hits the space bar and releases it > before the sound, one set of boxes will light up. > > If the user hits and releases the space bar after the sound, another set > of boxes will light up. > > I have some code but am blanking on how to move forward. > A few suggestions: * Just after the chime sounds, in your Timer event handler, store the current time in an instance variable, eg @chime_time = Time.now * At the same time you could set a flag that indicates that the Space bar is now pressable... * If the user presses the space bar within the right time, get the new time and deduct the @chime_time to see how long they took - this should give you a milleseconds result, eg: how_quick = Time.now - @chime_time * You can test whether the space bar is depressed when the sound is played by using Wx::get_key_state(Wx::K_SPACE) - see my reply to Ross hth alex From lists at ruby-forum.com Wed Oct 1 11:18:07 2008 From: lists at ruby-forum.com (Ross Goodell) Date: Wed, 1 Oct 2008 17:18:07 +0200 Subject: [wxruby-users] How can I find out the state of capslock? In-Reply-To: <48E3876F.9060207@pressure.to> References: <8d296acc4380a7ddc95b57c91d1daf90@ruby-forum.com> <48E3876F.9060207@pressure.to> Message-ID: <52980e62c0db3d221dcae27c7e513648@ruby-forum.com> Alex Fenton wrote: > Hi Ross > > Ross Goodell wrote: >> Although I can use KeyEvent#shift_down to find out if the shift key was >> held down when a key is pressed, I don't know how to find out if the >> capslock key is in effect (the capslock key was pressed the capslock LED >> is on, and other programs are treating an 'a' keypress as an 'A'). I >> could catch capslock keypresses by checking evt.get_key_code for 311, >> but don't know what the starting capslock state is since it might have >> been set when the user was in another program. Can someone tell me how >> to find out what what the capslock state is? > Wx::get_key_state(Wx::K_CAPITAL) > > Wx::get_key_state is a global method that returns true/false depending > on whether the key with the specified code is currently depressed. > Specially, for the toggle "lock" keys num / caps / scroll (whose integer > key codes are Wx::K_NUMLOCK, Wx::K_CAPITAL and Wx::K_SCROLL) it instead > returns true if the relevant lock is currently on. > > a Thanks Alex for replying so quickly. It worked beautifully. Ross -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Oct 1 22:54:12 2008 From: lists at ruby-forum.com (Zhimin Zhan) Date: Thu, 2 Oct 2008 04:54:12 +0200 Subject: [wxruby-users] undefined method 'end_edit_label' in Wx::TreeCtrl In-Reply-To: <48E307D0.2090901@pressure.to> References: <48E307D0.2090901@pressure.to> Message-ID: <6fd24224a7a5ec801a1baf3d8bb8b13b@ruby-forum.com> Hi Alex, > Do you happen to know if this is a new error since 1.9.8? I can't remember seeing this error (Rect => Event) in previous versions used (1.9.4 - 1.9.6). Regards, Zhimin -- Posted via http://www.ruby-forum.com/. From damnbigman at gmail.com Thu Oct 2 15:25:23 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Thu, 2 Oct 2008 13:25:23 -0600 Subject: [wxruby-users] WX::Dialog won't close Message-ID: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> I have an interesting problem. I have a dialog which refuses to go away once it has finished it's associated code. Here is the code: class DBPopulateDialog < Wx::Dialog def initialize(parent, id, title, pos, size, style, name) super(parent, id, title, pos, size, style, name) sizer = Wx::BoxSizer.new(Wx::VERTICAL) @server = Wx::TextCtrl.new(self, -1, "Server", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE) @username = Wx::TextCtrl.new(self, -1, "Username", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE) @password = Wx::TextCtrl.new(self, -1, "Password", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::TE_PASSWORD) @tree_base = Wx::TextCtrl.new(self, -1, "LDAP Tree Base", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE) sizer.add(@server, 1, Wx::EXPAND|Wx::ALL, 5) sizer.add(@username, 1, Wx::EXPAND|Wx::ALL, 5) sizer.add(@password, 1, Wx::EXPAND|Wx::ALL, 5) sizer.add(@tree_base, 1, Wx::EXPAND|Wx::ALL, 5) button_sizer = create_button_sizer(Wx::OK|Wx::CANCEL) sizer.add(button_sizer, 0, Wx::EXPAND|Wx::ALL, 5) # Okay Button Event!!!! evt_button(self.get_affirmative_id()) { |event| on_okay() } set_sizer(sizer) show() end # initialize # Collect computer records from Directory and add to database def on_okay() ldap = Net::LDAP.new :host => @server.get_value, :port => 389, :auth => { :method => :simple, :username => @username.get_value, :password => @password.get_value } filter = Net::LDAP::Filter.eq("objectcategory", "CN=Computer,CN=Schema,CN=Configuration,#{@tree_base.get_value}") # We don't want to return a result set as it could be pretty huge and we don't need it. # We are treating the container name as the group name here. ldap.search(:base => @tree_base.get_value, :filter => filter, :return_result => false) do |record| computer_name = record.cn.to_s begin os = record.operatingsystem rescue os = '' end lab = record.dn.split(',')[1].split('=')[1] # Check db for lab and add it if it isn't already there unless Lab.find :name => lab lab = Lab.new(:name => lab) lab.save lab = lab.name end # Save machine record machine = Computer.new(:name => computer_name, :os => os, :location => lab) machine.save end log_file = File.open("log.txt", "a"); log_file.puts "\n\nFinished populate next instruction is close\n\n"; log_file.close self.close() end # on_okay end # DBPopulateDialog class After filling out the proper information and clicking on okay the data is populated however when it finishes the dialog hangs around. Furthermore it won't close when you click on Cancel or the Window close widget (the X in my case). The log line executes just fine, the dialog just refuses to close. -Glen -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Thu Oct 2 16:42:06 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 02 Oct 2008 21:42:06 +0100 Subject: [wxruby-users] WX::Dialog won't close In-Reply-To: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> References: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> Message-ID: <48E5321E.7080401@pressure.to> Glen Holcomb wrote: > I have an interesting problem. I have a dialog which refuses to go > away once it has finished it's associated code. > > Here is the code: > ... > After filling out the proper information and clicking on okay the data > is populated however when it finishes the dialog hangs around. > Furthermore it won't close when you click on Cancel or the Window > close widget (the X in my case). The log line executes just fine, the > dialog just refuses to close. I haven't tried out your code, but maybe you need to call end_modal, if you're calling show_modal to start the dialog? alex From damnbigman at gmail.com Thu Oct 2 16:45:34 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Thu, 2 Oct 2008 14:45:34 -0600 Subject: [wxruby-users] WX::Dialog won't close In-Reply-To: <48E5321E.7080401@pressure.to> References: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> <48E5321E.7080401@pressure.to> Message-ID: <48800a90810021345q30028010pc38f2811f9ec949d@mail.gmail.com> If it is modal I'm not intending it to be but I'll check. On Thu, Oct 2, 2008 at 2:42 PM, Alex Fenton wrote: > Glen Holcomb wrote: > >> I have an interesting problem. I have a dialog which refuses to go away >> once it has finished it's associated code. >> >> Here is the code: >> >> ... > >> After filling out the proper information and clicking on okay the data is >> populated however when it finishes the dialog hangs around. Furthermore it >> won't close when you click on Cancel or the Window close widget (the X in my >> case). The log line executes just fine, the dialog just refuses to close. >> > > I haven't tried out your code, but maybe you need to call end_modal, if > you're calling show_modal to start the dialog? > > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabio.petrucci at gmail.com Fri Oct 3 06:06:36 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 3 Oct 2008 12:06:36 +0200 Subject: [wxruby-users] number input type Message-ID: Hi all, is there any option to limit input type (wxTextCtrl) to accept only number? thanks, regards. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Fri Oct 3 06:22:47 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 03 Oct 2008 11:22:47 +0100 Subject: [wxruby-users] number input type In-Reply-To: References: Message-ID: <48E5F277.4010408@pressure.to> hi Fabio Petrucci wrote: > is there any option to limit input type (wxTextCtrl) to accept only > number? tx = Wx::TextCtrl.new(self) tx.validator = Wx::TextValidator.new(Wx::FILTER_NUMERIC) cheers alex From fabio.petrucci at gmail.com Fri Oct 3 07:24:11 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 3 Oct 2008 13:24:11 +0200 Subject: [wxruby-users] number input type In-Reply-To: <48E5F277.4010408@pressure.to> References: <48E5F277.4010408@pressure.to> Message-ID: Too fast!! thank you Alex. :) bio. On Fri, Oct 3, 2008 at 12:22 PM, Alex Fenton wrote: > hi > > Fabio Petrucci wrote: > >> is there any option to limit input type (wxTextCtrl) to accept only >> number? >> > > tx = Wx::TextCtrl.new(self) > tx.validator = Wx::TextValidator.new(Wx::FILTER_NUMERIC) > > cheers > 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: From damnbigman at gmail.com Fri Oct 3 13:39:46 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Fri, 3 Oct 2008 11:39:46 -0600 Subject: [wxruby-users] WX::Dialog won't close In-Reply-To: <48800a90810021345q30028010pc38f2811f9ec949d@mail.gmail.com> References: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> <48E5321E.7080401@pressure.to> <48800a90810021345q30028010pc38f2811f9ec949d@mail.gmail.com> Message-ID: <48800a90810031039g55e5295s8e3cfe86c1f5b091@mail.gmail.com> On Thu, Oct 2, 2008 at 2:45 PM, Glen Holcomb wrote: > If it is modal I'm not intending it to be but I'll check. > > > On Thu, Oct 2, 2008 at 2:42 PM, Alex Fenton wrote: > >> Glen Holcomb wrote: >> >>> I have an interesting problem. I have a dialog which refuses to go away >>> once it has finished it's associated code. >>> >>> Here is the code: >>> >>> ... >> >>> After filling out the proper information and clicking on okay the data is >>> populated however when it finishes the dialog hangs around. Furthermore it >>> won't close when you click on Cancel or the Window close widget (the X in my >>> case). The log line executes just fine, the dialog just refuses to close. >>> >> >> I haven't tried out your code, but maybe you need to call end_modal, if >> you're calling show_modal to start the dialog? >> >> alex >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > Well end_modal doesn't do anything either. Oddly before clicking on the "okay" button the "cancel" button works, however after the on_okay event is processed the "cancel" button does nothing. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From bureaux.sebastien at neuf.fr Mon Oct 6 01:27:07 2008 From: bureaux.sebastien at neuf.fr (sebastien) Date: Mon, 6 Oct 2008 07:27:07 +0200 Subject: [wxruby-users] wxSugar Message-ID: Bonjour. A propos de "wxSugar", quel est son efficacit? ? Pouvez-vous me donnez un bout de code sans et avec "wxSugar", que je puisse voir la diff?rence ? Y a t'il des tutoriels assez explicatif ? merci sebastien http://beusse.liveror.com/ -------------- section suivante -------------- Une pi?ce jointe HTML a ?t? nettoy?e... URL: From fabio.petrucci at gmail.com Mon Oct 6 08:19:32 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Mon, 6 Oct 2008 14:19:32 +0200 Subject: [wxruby-users] StdDialogButtonSizer default button Message-ID: Hi all, How do i set the default button for a Wx::StdDialogButtonSizer? Any hints would be appreciated. regards. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Mon Oct 6 08:36:52 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 06 Oct 2008 13:36:52 +0100 Subject: [wxruby-users] StdDialogButtonSizer default button In-Reply-To: References: Message-ID: <48EA0664.2020304@pressure.to> Fabio Petrucci wrote: > How do i set the default button for a Wx::StdDialogButtonSizer? > > Any hints would be appreciated. Wx::Button#set_default() I think does what you want, but I haven't tested it. If you need to retrieve the Button object from the ButtonSizer to call this, you could use something like dialog.find_window(Wx::ID_OK) (in this case, to make 'OK' the default selection) alex From fabio.petrucci at gmail.com Mon Oct 6 09:22:49 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Mon, 6 Oct 2008 15:22:49 +0200 Subject: [wxruby-users] StdDialogButtonSizer default button In-Reply-To: <48EA0664.2020304@pressure.to> References: <48EA0664.2020304@pressure.to> Message-ID: > Wx::Button#set_default() I think does what you want, but I haven't tested > it. It works. > > If you need to retrieve the Button object from the ButtonSizer to call > this, you could use something like > > dialog.find_window(Wx::ID_OK) > > (in this case, to make 'OK' the default selection) > > Just to let you know: it doesn't works for me, i get this error: undefined method 'find_window' for # LoginDialog is a subclass of Wx::Dialog I've got it using xrcresource combinations methods: Wx::Window.find_window_by_id(Wx::xrcid('wxID_OK'), parent) Thank you. bio -------------- next part -------------- An HTML attachment was scrubbed... URL: From Franz.Irlweg.ZNT at wacker.com Tue Oct 7 02:44:48 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Tue, 7 Oct 2008 08:44:48 +0200 Subject: [wxruby-users] wxruby example with more than one window Message-ID: Hello together, can somebody send me a example with more than one window (frame) ? I'm using wxruby 1.9.5 I have the following problem: - from the first window i open the second window (which contains a grid, with TableBase, the data comes from a ActiveRecord) - after finishing work in the second window, i execute a close(). - opening and closing the second window several times (3 - 6), the following error appears: controllers/home_ctrl.rb:260: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [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. Thanks in advance, Franz Irlweg

This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from
disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed.
If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further.
Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance.
 
Siltronic AG, Sitz München, Hanns-Seidel-Platz 4, 81737 München, Germany. Amtsgericht München HRB 150884
Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Rudolf Staudigl

-------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Tue Oct 7 04:10:47 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 07 Oct 2008 09:10:47 +0100 Subject: [wxruby-users] wxruby example with more than one window In-Reply-To: References: Message-ID: <48EB1987.8080504@pressure.to> Hi Franz Irlweg, Franz (ZNT) wrote: > > can somebody send me a example with more than one window (frame) ? > I'm using* wxruby 1.9.5* > > I have the following problem: > - from the first window i open the second window (/which contains a > grid, with TableBase, the data comes from a ActiveRecord/) > > - after finishing work in the second window, i execute a close(). > - opening and closing the second window several times (3 - 6), the > following error appears: > > > controllers/home_ctrl.rb:260: [BUG] Segmentation fault > ruby 1.8.6 (2007-09-24) [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. > Please can you try upgrading to the latest wxRuby 1.9.8. In recent versions I've fixed several bugs which could cause the kind of crashes you're describing. If this doesn't resolve the problem, please send in a runnable sample that demonstrates the issue. cheers alex From damnbigman at gmail.com Wed Oct 8 09:48:16 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Wed, 8 Oct 2008 07:48:16 -0600 Subject: [wxruby-users] WX::Dialog won't close In-Reply-To: <48800a90810031039g55e5295s8e3cfe86c1f5b091@mail.gmail.com> References: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> <48E5321E.7080401@pressure.to> <48800a90810021345q30028010pc38f2811f9ec949d@mail.gmail.com> <48800a90810031039g55e5295s8e3cfe86c1f5b091@mail.gmail.com> Message-ID: <48800a90810080648q1af10f00n329591372319b200@mail.gmail.com> On Fri, Oct 3, 2008 at 11:39 AM, Glen Holcomb wrote: > On Thu, Oct 2, 2008 at 2:45 PM, Glen Holcomb wrote: > >> If it is modal I'm not intending it to be but I'll check. >> >> >> On Thu, Oct 2, 2008 at 2:42 PM, Alex Fenton wrote: >> >>> Glen Holcomb wrote: >>> >>>> I have an interesting problem. I have a dialog which refuses to go away >>>> once it has finished it's associated code. >>>> >>>> Here is the code: >>>> >>>> ... >>> >>>> After filling out the proper information and clicking on okay the data >>>> is populated however when it finishes the dialog hangs around. Furthermore >>>> it won't close when you click on Cancel or the Window close widget (the X in >>>> my case). The log line executes just fine, the dialog just refuses to >>>> close. >>>> >>> >>> I haven't tried out your code, but maybe you need to call end_modal, if >>> you're calling show_modal to start the dialog? >>> >>> alex >>> _______________________________________________ >>> wxruby-users mailing list >>> wxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wxruby-users >>> >> >> >> >> -- >> "Hey brother Christian with your high and mighty errand, Your actions >> speak so loud, I can't hear a word you're saying." >> >> -Greg Graffin (Bad Religion) >> > > Well end_modal doesn't do anything either. Oddly before clicking on the > "okay" button the "cancel" button works, however after the on_okay event is > processed the "cancel" button does nothing. > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > It would appear that the only instruction that doesn't run at the end of on_okay is close, exit works fine. This kind of blows, I suppose I'll have to start another instance of the app and exit after the populate finishes, not the cleanest solution. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Oct 9 04:50:36 2008 From: lists at ruby-forum.com (Zhimin Zhan) Date: Thu, 9 Oct 2008 10:50:36 +0200 Subject: [wxruby-users] Error: undefined method 'calc_min' for # My application has been running fine for weeks, just today got this error twice: Error: undefined method 'calc_min' for # OS: WXMSW Ruby Version: 1.8.6 Backtrace: E:/work/iTest2/app/main.rb:180:in `calc_min' E:/work/iTest2/app/main.rb:180:in `layout' E:/work/iTest2/app/main.rb:180:in `process_event' E:/work/iTest2/app/main.rb:180:in `main_loop' The line 180 is app.main_loop Env: Win XP, wxRuby 1.9.8 mswin32 Regards, Zhimin -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Oct 10 05:48:01 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 10 Oct 2008 10:48:01 +0100 Subject: [wxruby-users] WX::Dialog won't close In-Reply-To: <48800a90810080648q1af10f00n329591372319b200@mail.gmail.com> References: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> <48E5321E.7080401@pressure.to> <48800a90810021345q30028010pc38f2811f9ec949d@mail.gmail.com> <48800a90810031039g55e5295s8e3cfe86c1f5b091@mail.gmail.com> <48800a90810080648q1af10f00n329591372319b200@mail.gmail.com> Message-ID: <48EF24D1.5040706@pressure.to> Hi Glen Glen Holcomb wrote: > It would appear that the only instruction that doesn't run at the end > of on_okay is close, exit works fine. This kind of blows, I suppose > I'll have to start another instance of the app and exit after the > populate finishes, not the cleanest solution. I'm sure you won't need to do this. Generally, if you want help, please reduce the code to a standalone, runnable, and ideally short sample. I'm very happy to help, but it's too much to expect people to install extra libraries and second-guess what the rest of your app is doing. I did try running your code, pruned of the LDAP stuff. It seems fine to me - there's nothing in the dialog layout itself. I would suggest checking that the dialog has an explicit parent, not nil - it is better in most cases that the dialog is linked to a parent frame. In the special case that an application consists only of a single dialog, you must use Dialog#destroy to end the app, close is not sufficient. If this doesn't help, I would look further into net/ldap and see whether this is causing it to hang - ie, if ok does nothing but 'close' does it work fine? cheers alex From damnbigman at gmail.com Fri Oct 10 16:54:10 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Fri, 10 Oct 2008 14:54:10 -0600 Subject: [wxruby-users] WX::Dialog won't close In-Reply-To: <48EF24D1.5040706@pressure.to> References: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> <48E5321E.7080401@pressure.to> <48800a90810021345q30028010pc38f2811f9ec949d@mail.gmail.com> <48800a90810031039g55e5295s8e3cfe86c1f5b091@mail.gmail.com> <48800a90810080648q1af10f00n329591372319b200@mail.gmail.com> <48EF24D1.5040706@pressure.to> Message-ID: <48800a90810101354q5af913dah66c715387d412646@mail.gmail.com> On Fri, Oct 10, 2008 at 3:48 AM, Alex Fenton wrote: > Hi Glen > > Glen Holcomb wrote: > > It would appear that the only instruction that doesn't run at the end of >> on_okay is close, exit works fine. This kind of blows, I suppose I'll have >> to start another instance of the app and exit after the populate finishes, >> not the cleanest solution. >> > > I'm sure you won't need to do this. > > Generally, if you want help, please reduce the code to a standalone, > runnable, and ideally short sample. I'm very happy to help, but it's too > much to expect people to install extra libraries and second-guess what the > rest of your app is doing. > > I did try running your code, pruned of the LDAP stuff. It seems fine to me > - there's nothing in the dialog layout itself. I would suggest checking that > the dialog has an explicit parent, not nil - it is better in most cases that > the dialog is linked to a parent frame. In the special case that an > application consists only of a single dialog, you must use Dialog#destroy to > end the app, close is not sufficient. > > If this doesn't help, I would look further into net/ldap and see whether > this is causing it to hang - ie, if ok does nothing but 'close' does it work > fine? > > cheers > > alex > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > Hey Alex, Thanks for the reply, destroy did the trick. I don't know why I didn't try that before, according to my browser I'd looked at the method definition in the API docs. Odd that close doesn't work, I'm creating this dialog the same way I do all my others and close works for them. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From damnbigman at gmail.com Fri Oct 10 17:18:41 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Fri, 10 Oct 2008 15:18:41 -0600 Subject: [wxruby-users] WX::Dialog won't close In-Reply-To: <48800a90810101354q5af913dah66c715387d412646@mail.gmail.com> References: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> <48E5321E.7080401@pressure.to> <48800a90810021345q30028010pc38f2811f9ec949d@mail.gmail.com> <48800a90810031039g55e5295s8e3cfe86c1f5b091@mail.gmail.com> <48800a90810080648q1af10f00n329591372319b200@mail.gmail.com> <48EF24D1.5040706@pressure.to> <48800a90810101354q5af913dah66c715387d412646@mail.gmail.com> Message-ID: <48800a90810101418n438c9939tf181b9d49f82d82b@mail.gmail.com> On Fri, Oct 10, 2008 at 2:54 PM, Glen Holcomb wrote: > On Fri, Oct 10, 2008 at 3:48 AM, Alex Fenton wrote: > >> Hi Glen >> >> Glen Holcomb wrote: >> >> It would appear that the only instruction that doesn't run at the end of >>> on_okay is close, exit works fine. This kind of blows, I suppose I'll have >>> to start another instance of the app and exit after the populate finishes, >>> not the cleanest solution. >>> >> >> I'm sure you won't need to do this. >> >> Generally, if you want help, please reduce the code to a standalone, >> runnable, and ideally short sample. I'm very happy to help, but it's too >> much to expect people to install extra libraries and second-guess what the >> rest of your app is doing. >> >> I did try running your code, pruned of the LDAP stuff. It seems fine to me >> - there's nothing in the dialog layout itself. I would suggest checking that >> the dialog has an explicit parent, not nil - it is better in most cases that >> the dialog is linked to a parent frame. In the special case that an >> application consists only of a single dialog, you must use Dialog#destroy to >> end the app, close is not sufficient. >> >> If this doesn't help, I would look further into net/ldap and see whether >> this is causing it to hang - ie, if ok does nothing but 'close' does it work >> fine? >> >> cheers >> >> alex >> >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > Hey Alex, > > Thanks for the reply, destroy did the trick. I don't know why I didn't try > that before, according to my browser I'd looked at the method definition in > the API docs. Odd that close doesn't work, I'm creating this dialog the > same way I do all my others and close works for them. > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > I have another dialog behaving the same way now. My application has one frame and from that frame I'm passing self as the parent argument for the Dialog Windows. I do this for other dialogs created by button events and it works okay. The dialogs that are unresponsive after pressing okay are created through menu events should I be doing something differently when creating a dialog from a menu option? I will try to pair my code down and post a small working example but it will take a while. If anyone has any ideas off the top of their head I'm all ears. Dialog#destroy does work so I can always do that. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Fri Oct 10 18:16:47 2008 From: mario at ruby-im.net (Mario Steele) Date: Fri, 10 Oct 2008 17:16:47 -0500 Subject: [wxruby-users] WX::Dialog won't close In-Reply-To: <48800a90810101418n438c9939tf181b9d49f82d82b@mail.gmail.com> References: <48800a90810021225x514d3453ib5a7ed816b3ece58@mail.gmail.com> <48E5321E.7080401@pressure.to> <48800a90810021345q30028010pc38f2811f9ec949d@mail.gmail.com> <48800a90810031039g55e5295s8e3cfe86c1f5b091@mail.gmail.com> <48800a90810080648q1af10f00n329591372319b200@mail.gmail.com> <48EF24D1.5040706@pressure.to> <48800a90810101354q5af913dah66c715387d412646@mail.gmail.com> <48800a90810101418n438c9939tf181b9d49f82d82b@mail.gmail.com> Message-ID: Another Idea for you Glen, Instead of using Close, and Destroy to get rid of the dialog, if it's a Dialog that is used quite often, I would opt to use show_modal, and end_modal, and after end_modal is called, just call hide, instead of destroy. An Example of this: class MyDialog < Wx::Dialog def initialize(*args) super ok = Wx::Button.new(self,Wx::ID_OK,"&Ok") cancel = Wx::Button.new(self,Wx::ID_CANCEL,"&Cancel") # ...... Add your own controls ...... evt_button(Wx::ID_OK) do # ...... do whatever processing you need ....... end_modal(Wx::ID_OK) end evt_button(Wx::ID_CANCEL) do # ...... Ask any, "Are you sure you want to cancel" here ........ # Or don't even put this handler in, as it's automatically handled by Wx::Dialog end end end class MyFrame < Wx::Frame def initialize(*args) super # We create our dialog that we are going to use a lot, and show only # when needed. @dlg = MyDialog.new(self,-1,"Information Report") # .... add the rest of the stuff ....... evt_button(ID_SHOW_DIALOG) do @dlg.show_modal do |response| # ..... process response ..... end @dlg.hide end end end This is just a bare bone example, that will not work, least you actually put it together. But it gives you an idea of how to use it, especially when you re-use a dialog multiple times. Hope this helps, Mario Steele On Fri, Oct 10, 2008 at 4:18 PM, Glen Holcomb wrote: > On Fri, Oct 10, 2008 at 2:54 PM, Glen Holcomb wrote: > >> On Fri, Oct 10, 2008 at 3:48 AM, Alex Fenton wrote: >> >>> Hi Glen >>> >>> Glen Holcomb wrote: >>> >>> It would appear that the only instruction that doesn't run at the end of >>>> on_okay is close, exit works fine. This kind of blows, I suppose I'll have >>>> to start another instance of the app and exit after the populate finishes, >>>> not the cleanest solution. >>>> >>> >>> I'm sure you won't need to do this. >>> >>> Generally, if you want help, please reduce the code to a standalone, >>> runnable, and ideally short sample. I'm very happy to help, but it's too >>> much to expect people to install extra libraries and second-guess what the >>> rest of your app is doing. >>> >>> I did try running your code, pruned of the LDAP stuff. It seems fine to >>> me - there's nothing in the dialog layout itself. I would suggest checking >>> that the dialog has an explicit parent, not nil - it is better in most cases >>> that the dialog is linked to a parent frame. In the special case that an >>> application consists only of a single dialog, you must use Dialog#destroy to >>> end the app, close is not sufficient. >>> >>> If this doesn't help, I would look further into net/ldap and see whether >>> this is causing it to hang - ie, if ok does nothing but 'close' does it work >>> fine? >>> >>> cheers >>> >>> alex >>> >>> >>> _______________________________________________ >>> wxruby-users mailing list >>> wxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wxruby-users >>> >> >> Hey Alex, >> >> Thanks for the reply, destroy did the trick. I don't know why I didn't >> try that before, according to my browser I'd looked at the method definition >> in the API docs. Odd that close doesn't work, I'm creating this dialog the >> same way I do all my others and close works for them. >> >> -- >> "Hey brother Christian with your high and mighty errand, Your actions >> speak so loud, I can't hear a word you're saying." >> >> -Greg Graffin (Bad Religion) >> > > I have another dialog behaving the same way now. My application has one > frame and from that frame I'm passing self as the parent argument for the > Dialog Windows. I do this for other dialogs created by button events and it > works okay. The dialogs that are unresponsive after pressing okay are > created through menu events should I be doing something differently when > creating a dialog from a menu option? > > I will try to pair my code down and post a small working example but it > will take a while. If anyone has any ideas off the top of their head I'm > all ears. Dialog#destroy does work so I can always do that. > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Franz.Irlweg.ZNT at wacker.com Mon Oct 13 03:40:10 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Mon, 13 Oct 2008 09:40:10 +0200 Subject: [wxruby-users] BoolEditor and renderer in Grid In-Reply-To: <48EB1987.8080504@pressure.to> References: <48EB1987.8080504@pressure.to> Message-ID: Hello togheter, I'm using the Wx::Grid, with GridTableBase. (wxruby 1.9.5 and wxruby 1.9.8) The GridCellBoolEditor and GridCellBoolRenderer doesn't work. How can I solve the problem? I have atached a file with an example. Best regards, Franz If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at once so This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed. that we may take the appropriate action and avoid troubling you further. Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance. Siltronic AG, Sitz Muenchen, Hanns-Seidel-Platz 4, 81737 Muenchen, Germany. Amtsgericht Muenchen HRB 150884 Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Rudolf Staudigl -------------- next part -------------- A non-text attachment was scrubbed... Name: bool_editor.rb Type: application/octet-stream Size: 3641 bytes Desc: bool_editor.rb URL: From lists at ruby-forum.com Mon Oct 13 07:43:03 2008 From: lists at ruby-forum.com (=?utf-8?Q?Andreas_Garn=c3=a6s?=) Date: Mon, 13 Oct 2008 13:43:03 +0200 Subject: [wxruby-users] Wx::Bitmap causes segfaults Message-ID: <78ea589f72573f7a215cb2c19d570495@ruby-forum.com> Instantiating a Wx::Bitmap with width and height causes a segmentation fault. This is the minimal example I could find where the behaviour is exhibited: require 'rubygems' require 'wx' Wx::Bitmap.new(1, 1) Results in: /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wx/classes/bitmap.rb:17: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i486-linux] Note that without width and height, no segmentation fault is caused: Wx::Bitmap.new // => # I'm running Ubuntu Hardy 8.04, ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux], wxwidgets 1.9.6, and have the following wx-packages installed: libwxbase2.6-0 2.6.3.2.2-2ubuntu4 libwxbase2.8-0 2.8.7.1-0ubuntu3 libwxbase2.8-dev 2.8.7.1-0ubuntu3 libwxgtk2.6-0 2.6.3.2.2-2ubuntu4 libwxgtk2.8-0 2.8.7.1-0ubuntu3 libwxgtk2.8-dev 2.8.7.1-0ubuntu3 wx2.8-headers 2.8.7.1-0ubuntu3 Any help is greatly appreciated! - andreas -- Posted via http://www.ruby-forum.com/. From kirill.likhodedov at gmail.com Mon Oct 13 08:41:17 2008 From: kirill.likhodedov at gmail.com (=?UTF-8?B?0JrQuNGA0LjQu9C7INCb0LjRhdC+0LTQtdC00L7Qsg==?=) Date: Mon, 13 Oct 2008 16:41:17 +0400 Subject: [wxruby-users] Wx::Font.new fails in a Runtime Error Message-ID: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> I can't construct a Wx::Font object, because it leads to a Runtime Error, though it seems that I use it as per documentation of WxRuby. Strangely, many mistakes lead to such an error instead of a verbose Ruby exception :( Could you please help me with this? Thanks a lot in advance. Please see the sample code below. ==================== require 'wx' class TestFrame < Wx::Frame def initialize() super(nil, -1, "CMD") Wx::Font.new(12, Wx::Font::FONTFAMILY_DECORATIVE) end end class TestApp < Wx::App def on_init TestFrame.new().show() end end TestApp.new.main_loop ==================== Enviroment: Windows XP SP-2 Ruby 1.8.6 WxRuby 1.9.8 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: error.png Type: image/png Size: 8836 bytes Desc: not available URL: From lists at ruby-forum.com Mon Oct 13 09:17:14 2008 From: lists at ruby-forum.com (=?utf-8?Q?Andreas_Garn=c3=a6s?=) Date: Mon, 13 Oct 2008 15:17:14 +0200 Subject: [wxruby-users] Wx::Font.new fails in a Runtime Error In-Reply-To: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> References: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> Message-ID: <4f5049d8a8ae2b15fe54d69dcf5905c5@ruby-forum.com> ?????? ????????? wrote: > Wx::Font.new(12, Wx::Font::FONTFAMILY_DECORATIVE) Try replacing that line with: Wx::Font.new(12, Wx::FONTFAMILY_DECORATIVE, Wx::FONTSTYLE_NORMAL, Wx::FONTWEIGHT_NORMAL) - andreas -- Posted via http://www.ruby-forum.com/. From kirill.likhodedov at gmail.com Mon Oct 13 09:31:56 2008 From: kirill.likhodedov at gmail.com (=?UTF-8?B?0JrQuNGA0LjQu9C7INCb0LjRhdC+0LTQtdC00L7Qsg==?=) Date: Mon, 13 Oct 2008 17:31:56 +0400 Subject: [wxruby-users] Wx::Font.new fails in a Runtime Error In-Reply-To: <4f5049d8a8ae2b15fe54d69dcf5905c5@ruby-forum.com> References: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> <4f5049d8a8ae2b15fe54d69dcf5905c5@ruby-forum.com> Message-ID: <236e49df0810130631p54721dd7sb7a0e0ee89809c65@mail.gmail.com> That worked (but why? Aren't there default values for the rest of the parameters?), but setting this font as the default style of TextCtrl leads to the same error: text = Wx::TextCtrl.new(self, -1, "text", :style => Wx::TE_RICH|Wx::TE_RICH2|Wx::TE_PROCESS_ENTER|Wx::TE_PROCESS_TAB) font = Wx::Font.new(12, Wx::FONTFAMILY_DECORATIVE, Wx::FONTSTYLE_NORMAL, Wx::FONTWEIGHT_NORMAL) text.set_default_style(Wx::TextAttr.new(font)) #This leads to error By the way, why is it a Runtime threatening error, not an exception? 2008/10/13 Andreas Garn?s > ?????? ????????? wrote: > > Wx::Font.new(12, Wx::Font::FONTFAMILY_DECORATIVE) > > Try replacing that line with: > > Wx::Font.new(12, Wx::FONTFAMILY_DECORATIVE, Wx::FONTSTYLE_NORMAL, > Wx::FONTWEIGHT_NORMAL) > > - andreas > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirill.likhodedov at gmail.com Mon Oct 13 09:36:35 2008 From: kirill.likhodedov at gmail.com (=?UTF-8?B?0JrQuNGA0LjQu9C7INCb0LjRhdC+0LTQtdC00L7Qsg==?=) Date: Mon, 13 Oct 2008 17:36:35 +0400 Subject: [wxruby-users] Wx::Font.new fails in a Runtime Error In-Reply-To: <236e49df0810130631p54721dd7sb7a0e0ee89809c65@mail.gmail.com> References: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> <4f5049d8a8ae2b15fe54d69dcf5905c5@ruby-forum.com> <236e49df0810130631p54721dd7sb7a0e0ee89809c65@mail.gmail.com> Message-ID: <236e49df0810130636v4f649230nb92d7c3a943cd988@mail.gmail.com> Oops, sorry, that should be text.set_default_style(Wx::TextAttr.new(Wx::BLACK, Wx::WHITE, font)) OK, I understand, it works now, thanks for the hint! But the main problem still exists: it is very hard to determine when you use wrong or incomplete method signature, when it just silently fails.Is it some configuration problem of mine or it is WxRuby feature? 2008/10/13 ?????? ????????? > > That worked (but why? Aren't there default values for the rest of the > parameters?), but setting this font as the default style of TextCtrl leads > to the same error: > text = Wx::TextCtrl.new(self, -1, "text", :style => > Wx::TE_RICH|Wx::TE_RICH2|Wx::TE_PROCESS_ENTER|Wx::TE_PROCESS_TAB) > font = Wx::Font.new(12, > Wx::FONTFAMILY_DECORATIVE, Wx::FONTSTYLE_NORMAL, Wx::FONTWEIGHT_NORMAL) > text.set_default_style(Wx::TextAttr.new(font)) #This leads to error > > By the way, why is it a Runtime threatening error, not an exception? > > 2008/10/13 Andreas Garn?s > > ?????? ????????? wrote: >> > Wx::Font.new(12, Wx::Font::FONTFAMILY_DECORATIVE) >> >> Try replacing that line with: >> >> Wx::Font.new(12, Wx::FONTFAMILY_DECORATIVE, Wx::FONTSTYLE_NORMAL, >> Wx::FONTWEIGHT_NORMAL) >> >> - andreas >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Oct 13 10:17:21 2008 From: lists at ruby-forum.com (=?utf-8?Q?Andreas_Garn=c3=a6s?=) Date: Mon, 13 Oct 2008 16:17:21 +0200 Subject: [wxruby-users] Wx::Font.new fails in a Runtime Error In-Reply-To: <236e49df0810130636v4f649230nb92d7c3a943cd988@mail.gmail.com> References: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> <4f5049d8a8ae2b15fe54d69dcf5905c5@ruby-forum.com> <236e49df0810130631p54721dd7sb7a0e0ee89809c65@mail.gmail.com> <236e49df0810130636v4f649230nb92d7c3a943cd988@mail.gmail.com> Message-ID: ?????? ????????? wrote: > Oops, sorry, that should be > text.set_default_style(Wx::TextAttr.new(Wx::BLACK, > Wx::WHITE, font)) > > OK, I understand, it works now, thanks for the hint! > > But the main problem still exists: it is very hard to determine when you > use > wrong or incomplete method signature, when it just silently fails.Is it > some > configuration problem of mine or it is WxRuby feature? > > 2008/10/13 ?????? ????????? I guess you just have to read the documentation very carefully. I get significantly better error messages on Ubuntu, however, eg: > Wx::Font.new(20) ArgumentError: Wrong arguments for overloaded method 'wxFont.new'. Possible C/C++ prototypes are: wxFont.new() wxFont.new(int pointSize, int family, int style, int weight, bool const underline, wxString const &faceName, wxFontEncoding encoding) -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Oct 13 10:20:53 2008 From: lists at ruby-forum.com (=?utf-8?Q?Andreas_Garn=c3=a6s?=) Date: Mon, 13 Oct 2008 16:20:53 +0200 Subject: [wxruby-users] Wx::Bitmap causes segfaults In-Reply-To: <78ea589f72573f7a215cb2c19d570495@ruby-forum.com> References: <78ea589f72573f7a215cb2c19d570495@ruby-forum.com> Message-ID: Andreas Garn?s wrote: > I'm running Ubuntu Hardy 8.04, ruby 1.8.6 (2007-09-24 patchlevel 111) > [i486-linux], wxwidgets 1.9.6, and have the following wx-packages > installed: [...] Correction: I'm actually running wxwidgets 1.9.8. -- Posted via http://www.ruby-forum.com/. From shs at demosophia.net Mon Oct 13 21:01:59 2008 From: shs at demosophia.net (Svend Haugaard =?UTF-8?B?U8O4cmVuc2Vu?=) Date: Tue, 14 Oct 2008 03:01:59 +0200 Subject: [wxruby-users] Fresh install problem. Message-ID: <20081014030159.148b9faf@cybert.demosophia.net> So my old computer fried a motherboard. So after bying, building and installing my new computer. I return to wxruby and install it via 'gem install wxruby' and run my old programs. BUT they don't work. They return this error. /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wxruby2.so: /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wxruby2.so) - /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wxruby2.so (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wx.rb:12 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require' from dnet.rb:1 Is this something I can fix ? From mario at ruby-im.net Mon Oct 13 20:29:30 2008 From: mario at ruby-im.net (Mario Steele) Date: Mon, 13 Oct 2008 19:29:30 -0500 Subject: [wxruby-users] Fresh install problem. In-Reply-To: <20081014030159.148b9faf@cybert.demosophia.net> References: <20081014030159.148b9faf@cybert.demosophia.net> Message-ID: This error means that glibc is of a different version then the one that is compiled with wxRuby gem. It could be new or it could be older. It all depends. The only way I can think to fix this, is to go through the self-compile of wxRuby. See here to self-compile wxRuby: http://wxruby.rubyforge.org/wiki/wiki.pl?InstallingFromSource If you have any questions about self-compiling, feel free to ask, and I or someone else will be happy to help. hth, Mario On Mon, Oct 13, 2008 at 8:01 PM, Svend Haugaard S?rensen wrote: > So my old computer fried a motherboard. > So after bying, building and installing my new computer. > I return to wxruby and install it via 'gem install wxruby' > and run my old programs. BUT they don't work. > > They return this error. > > /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wxruby2.so: > /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6: > version `GLIBCXX_3.4.9' not found (required > by /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wxruby2.so) > - /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wxruby2.so > (LoadError) > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from /usr/lib/ruby/gems/1.8/gems/wxruby-1.9.8-x86-linux/lib/wx.rb:12 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in > `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in > `require' from dnet.rb:1 > > Is this something I can fix ? > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirill.likhodedov at gmail.com Tue Oct 14 03:28:16 2008 From: kirill.likhodedov at gmail.com (=?UTF-8?B?0JrQuNGA0LjQu9C7INCb0LjRhdC+0LTQtdC00L7Qsg==?=) Date: Tue, 14 Oct 2008 11:28:16 +0400 Subject: [wxruby-users] Wx::Font.new fails in a Runtime Error In-Reply-To: References: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> <4f5049d8a8ae2b15fe54d69dcf5905c5@ruby-forum.com> <236e49df0810130631p54721dd7sb7a0e0ee89809c65@mail.gmail.com> <236e49df0810130636v4f649230nb92d7c3a943cd988@mail.gmail.com> Message-ID: <236e49df0810140028h1c23b9f9k39e84f13c3856ce8@mail.gmail.com> Andreas, you definitely have much more descriptive messages.It looks like a problem of Windows version WxRuby, because Ruby itself doesn't have these problems. Does anybody know if anything can be done with it, maybe in future releases? 2008/10/13 Andreas Garn?s > ?????? ????????? wrote: > > Oops, sorry, that should be > > text.set_default_style(Wx::TextAttr.new(Wx::BLACK, > > Wx::WHITE, font)) > > > > OK, I understand, it works now, thanks for the hint! > > > > But the main problem still exists: it is very hard to determine when you > > use > > wrong or incomplete method signature, when it just silently fails.Is it > > some > > configuration problem of mine or it is WxRuby feature? > > > > 2008/10/13 ?????? ????????? > > I guess you just have to read the documentation very carefully. I get > significantly better error messages on Ubuntu, however, eg: > > > Wx::Font.new(20) > ArgumentError: Wrong arguments for overloaded method 'wxFont.new'. > Possible C/C++ prototypes are: > wxFont.new() > wxFont.new(int pointSize, int family, int style, int weight, bool > const underline, wxString const &faceName, wxFontEncoding encoding) > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabio.petrucci at gmail.com Fri Oct 17 12:17:22 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 17 Oct 2008 18:17:22 +0200 Subject: [wxruby-users] ListCtrl loading data Message-ID: Hi all, I'm using a ListCtrl on LC_REPORT mode. using set_item(index, col, 'value') the list does't get populated. Is it a bug? which is the method to call? i'm using ruby 1.8.6 wxruby 1.9.8 mswin32 on winXP attached is an example. thank you. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: listctrl_test.rb Type: application/x-ruby Size: 2946 bytes Desc: not available URL: From lists at ruby-forum.com Fri Oct 17 20:01:25 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Sat, 18 Oct 2008 02:01:25 +0200 Subject: [wxruby-users] wxRuby error: Image file is not of type 9 Message-ID: Hello I'm having problems with rhis error, I couldnt found the solution (or even mention) on the internet I'm doing a toolbar, called @toolBarPrincipal, then I add the tool,and finally the #realize() method. This error happens when openig the file (on windows, linux ran pretty well) I still can work with the program but the icon (or bitmap or whatever) doesnt shows. The Code is: @toolBarPrincipal=create_tool_bar(TB_HORIZONTAL | NO_BORDER | TB_FLAT | TB_TEXT ) @toolBarPrincipal.add_tool(-1, 'Bonzai2', Bitmap.new("C:/rubyCode/icons/bonsai.ico")) @toolBarPrincipal.realize() also tryed: @toolBarPrincipal.add_tool(-1, 'Bonzai2', Bitmap.new("C:/rubyCode/icons/bonsai.bmp")) Renaming the file or savin as from mspaint, but no good. Does anyone knows how to solve it? Thanks -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Sat Oct 18 02:02:28 2008 From: mario at ruby-im.net (Mario Steele) Date: Sat, 18 Oct 2008 01:02:28 -0500 Subject: [wxruby-users] ListCtrl loading data In-Reply-To: References: Message-ID: The problem is, set_item() need to have a valid item in which to set information on. So change the following code to represent this: insert_item(0, 'Item 0 col 0') set_item(0, 1, 'Item 0 col 1') insert_item(1, 'Item 1 col 0') set_item(1, 1, 'Item 1 col 1') You will get better results this way, then the other way. On Fri, Oct 17, 2008 at 11:17 AM, Fabio Petrucci wrote: > Hi all, > > I'm using a ListCtrl on LC_REPORT mode. > > using set_item(index, col, 'value') the list does't get populated. > > Is it a bug? which is the method to call? > > i'm using ruby 1.8.6 wxruby 1.9.8 mswin32 on winXP > > attached is an example. > > thank you. > > bio. > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Sat Oct 18 10:45:58 2008 From: alex at pressure.to (Alex Fenton) Date: Sat, 18 Oct 2008 15:45:58 +0100 Subject: [wxruby-users] wxRuby error: Image file is not of type 9 In-Reply-To: References: Message-ID: <48F9F6A6.3050506@pressure.to> Omar Hernandez wrote: > @toolBarPrincipal=create_tool_bar(TB_HORIZONTAL | NO_BORDER | TB_FLAT | > TB_TEXT ) > @toolBarPrincipal.add_tool(-1, 'Bonzai2', > Bitmap.new("C:/rubyCode/icons/bonsai.ico")) Try adding the type argument to tell wxRuby what type of image file you're loading from Wx::Bitmap.new("/path/to/icon.ico", Wx::BITMAP_TYPE_ICO) See the Wx::Bitmap documentation for a list of supported types. For cross-platform use, I'd recommend using PNG over ICO or BMP hth alex From Franz.Irlweg.ZNT at wacker.com Mon Oct 20 01:35:50 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Mon, 20 Oct 2008 07:35:50 +0200 Subject: [wxruby-users] FW: BoolEditor and renderer in Grid Message-ID: Hello togheter, I'm using the Wx::Grid, with GridTableBase. (wxruby 1.9.5 and wxruby 1.9.8) The GridCellBoolEditor and GridCellBoolRenderer doesn't work. How can I solve the problem? I have atached a file with an example. Best regards, Franz If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at once so This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed. that we may take the appropriate action and avoid troubling you further. Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance. Siltronic AG, Sitz Muenchen, Hanns-Seidel-Platz 4, 81737 Muenchen, Germany. Amtsgericht Muenchen HRB 150884 Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Rudolf Staudigl -------------- next part -------------- A non-text attachment was scrubbed... Name: bool_editor.rb Type: application/octet-stream Size: 3641 bytes Desc: bool_editor.rb URL: From rakaur at malkier.net Mon Oct 20 08:59:14 2008 From: rakaur at malkier.net (Eric Will) Date: Mon, 20 Oct 2008 08:59:14 -0400 Subject: [wxruby-users] LC_VIRTUAL with Wx::ListCtrl Message-ID: Wx::ListCtrl#set_item_count appears to be broken. If I pass it anything but a Fixnum (is_a Integer), it crashes and says it needs a "long" (which Fixnum should appease), but if I pass it a Fixnum it crashes with "cannot convert nil into String." Latest WxRuby. Windows Vista. This makes using LC_VIRTUAL impossible. -- Eric Will // xmpp:rakaur at malkier.net From fabio.petrucci at gmail.com Mon Oct 20 09:24:28 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Mon, 20 Oct 2008 15:24:28 +0200 Subject: [wxruby-users] ListCtrl loading data In-Reply-To: References: Message-ID: Thank you Mario, now is ok :) bio. On Sat, Oct 18, 2008 at 8:02 AM, Mario Steele wrote: > The problem is, set_item() need to have a valid item in which to set > information on. So change the following code to represent this: > > insert_item(0, 'Item 0 col 0') > set_item(0, 1, 'Item 0 col 1') > insert_item(1, 'Item 1 col 0') > set_item(1, 1, 'Item 1 col 1') > > You will get better results this way, then the other way. > > On Fri, Oct 17, 2008 at 11:17 AM, Fabio Petrucci > wrote: > >> Hi all, >> >> I'm using a ListCtrl on LC_REPORT mode. >> >> using set_item(index, col, 'value') the list does't get populated. >> >> Is it a bug? which is the method to call? >> >> i'm using ruby 1.8.6 wxruby 1.9.8 mswin32 on winXP >> >> attached is an example. >> >> thank you. >> >> bio. >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > > > -- > Mario Steele > http://www.trilake.net > http://www.ruby-im.net > http://rubyforge.org/projects/wxruby/ > http://rubyforge.org/projects/wxride/ > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rakaur at malkier.net Mon Oct 20 09:31:27 2008 From: rakaur at malkier.net (Eric Will) Date: Mon, 20 Oct 2008 09:31:27 -0400 Subject: [wxruby-users] LC_VIRTUAL with Wx::ListCtrl In-Reply-To: References: Message-ID: On Oct 20, 2008, at 8:59 AM, Eric Will wrote: > Wx::ListCtrl#set_item_count appears to be broken. If I pass it > anything but a Fixnum (is_a Integer), it crashes and says it needs a > "long" (which Fixnum should appease), but if I pass it a Fixnum it > crashes with "cannot convert nil into String." Never mind. My on_get_item_text method wasn't returning a string, and this was the useless error that Ruby gives me thanks to Ruby's useless threads. > -- Eric Will // xmpp:rakaur at malkier.net From alex at pressure.to Mon Oct 20 10:32:41 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 20 Oct 2008 15:32:41 +0100 Subject: [wxruby-users] ListCtrl loading data In-Reply-To: References: Message-ID: <48FC9689.8000900@pressure.to> Hi Firstly, sorry haven't been following the list for the last week or so. Have been away with work and pretty busy and haven't had time to follow up everything. Fabio Petrucci wrote: > Thank you Mario, now is ok :) > > bio. > > On Sat, Oct 18, 2008 at 8:02 AM, Mario Steele > wrote: > > The problem is, set_item() need to have a valid item in which to > set information on. So change the following code to represent this: > > insert_item(0, 'Item 0 col 0') > set_item(0, 1, 'Item 0 col 1') > insert_item(1, 'Item 1 col 0') > set_item(1, 1, 'Item 1 col 1') > Seeing this laid out plainly makes me think we must be able to come up with a syntax improvement. I was thinking of something that accepts an array for each row and just does the right thing.... append [ "item 0 col 0", "item 0 col 1"], [ "item 1 col 0", "item 1 col 1"] ... alex From alex at pressure.to Mon Oct 20 11:59:24 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 20 Oct 2008 16:59:24 +0100 Subject: [wxruby-users] FW: BoolEditor and renderer in Grid In-Reply-To: References: Message-ID: <48FCAADC.1050203@pressure.to> Irlweg, Franz (ZNT) wrote: > I'm using the Wx::Grid, with GridTableBase. (wxruby 1.9.5 and wxruby > 1.9.8) > > The GridCellBoolEditor and GridCellBoolRenderer doesn't work. How can I > solve the problem > Thank you for the report and example. It's a known bug: http://rubyforge.org/tracker/index.php?func=detail&aid=21389&group_id=35&atid=218 I'm afraid I don't know how to solve this one. I think I know what the problem is - ruby's garbage collection is destroying the Attr object while it's still needed. Technically, there may be some clever fix possible by having the wrapper DISOWN the return value from GridTableBase so that memory management is passed back to Wx, but I'm not sure how to appraoch this. Is it all possible to use a normal Grid in your case, without GridTableBase? alex From fabio.petrucci at gmail.com Mon Oct 20 12:36:34 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Mon, 20 Oct 2008 18:36:34 +0200 Subject: [wxruby-users] ListCtrl selection Message-ID: Hi all, to select an item into a listCtrl i'm doing this: list_ctrl#set_item_state(0, Wx::LIST_STATE_SELECTED, Wx::LIST_MASK_STATE) but nothing happen. is this the right way? thank you. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Oct 21 15:09:55 2008 From: lists at ruby-forum.com (Mark E.) Date: Tue, 21 Oct 2008 21:09:55 +0200 Subject: [wxruby-users] Recommended cross platform deployment methods? Message-ID: Hey all, I'm just getting started with wxRuby but I really like it. I have felt the joy of writing a simple app (using DialogBlocs & xrcise) and running it on Windows and Linux. Ahh. Peace. Oh, and it didn't suck like my experiences with Java doing the same exact simple app. :) So, my question is, is there a recommended deployment method for multiple platforms? Windows: I can create a shortcut to run the application with rubyw so no console window shows up. How can I ensure the correct versions of Ruby and wxRuby? Can I run it without forcing the user to install either? (Binary versions?) Oh, and I know about script2exe for windows. Linux: I tested on Kubuntu KDE 4.1.2. The same questions about ruby and wxRuby versions being installed. How do I create shortcuts to run the application using ruby with the comparable "rubyw.exe" option. Thanks! -MarkE -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Tue Oct 21 22:05:14 2008 From: mario at ruby-im.net (Mario Steele) Date: Tue, 21 Oct 2008 21:05:14 -0500 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: Well, you already know about rubyscript2exe, which works on all 3 platforms. That's about the only thing I can suggest for it. On Linux: You create a shortcut, which is basically an INI Type file, with the extension .desktop, EG: MyProg.desktop, and in it, is the following info: [Desktop Entry] Version=1.0 Exec=/home/eumario/bin/ie6 Icon=/home/eumario/.ies4linux/ies4linux.png Name=Internet Explorer 6.0 GenericName=Web Browser Comment=MSIE 6.0 by IEs4Linux Encoding=UTF-8 Terminal=false Type=Application Categories=Application;Network; This is just a copy of my IEs4Linux. But you can use any name you want in the Name field, and it doesn't have to match what you named the actual file, and the name is what will be displayed. It's not like Microsoft, where there is a proprietary format to the shortcut. ;-) hth, Mario On Tue, Oct 21, 2008 at 2:09 PM, Mark E. wrote: > Hey all, > > I'm just getting started with wxRuby but I really like it. I have felt > the joy of writing a simple app (using DialogBlocs & xrcise) and running > it on Windows and Linux. Ahh. Peace. > > Oh, and it didn't suck like my experiences with Java doing the same > exact simple app. :) > > So, my question is, is there a recommended deployment method for > multiple platforms? > > Windows: > I can create a shortcut to run the application with rubyw so no console > window shows up. How can I ensure the correct versions of Ruby and > wxRuby? Can I run it without forcing the user to install either? (Binary > versions?) > > Oh, and I know about script2exe for windows. > > Linux: > I tested on Kubuntu KDE 4.1.2. The same questions about ruby and wxRuby > versions being installed. How do I create shortcuts to run the > application using ruby with the comparable "rubyw.exe" option. > > Thanks! > -MarkE > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabio.petrucci at gmail.com Wed Oct 22 03:34:14 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Wed, 22 Oct 2008 09:34:14 +0200 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: There's another interesting way to explore to be able to generate executable into different platform: Look at the way shoes do it: http://hackety.org/2008/06/19/stampingExesAndDmgs.html It would be great having that for wxruby applications as well. regards. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Wed Oct 22 03:48:43 2008 From: mario at ruby-im.net (Mario Steele) Date: Wed, 22 Oct 2008 02:48:43 -0500 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: I may look at this solution a bit more closely, and see about creating a solution that will create these packages for general Ruby apps, not just wxRuby, but any Ruby app, and create one for Linux as well. On Wed, Oct 22, 2008 at 2:34 AM, Fabio Petrucci wrote: > There's another interesting way to explore to be able to generate > executable into different platform: > > Look at the way shoes do it: > > http://hackety.org/2008/06/19/stampingExesAndDmgs.html > > It would be great having that for wxruby applications as well. > > regards. > > bio. > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Wed Oct 22 03:49:29 2008 From: mario at ruby-im.net (Mario Steele) Date: Wed, 22 Oct 2008 02:49:29 -0500 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: PS. Thanks for the link, I'll definitely be looking at this as a possible solution to many problems with Ruby App Distribution. On Wed, Oct 22, 2008 at 2:48 AM, Mario Steele wrote: > I may look at this solution a bit more closely, and see about creating a > solution that will create these packages for general Ruby apps, not just > wxRuby, but any Ruby app, and create one for Linux as well. > > On Wed, Oct 22, 2008 at 2:34 AM, Fabio Petrucci wrote: > >> There's another interesting way to explore to be able to generate >> executable into different platform: >> >> Look at the way shoes do it: >> >> http://hackety.org/2008/06/19/stampingExesAndDmgs.html >> >> It would be great having that for wxruby applications as well. >> >> regards. >> >> bio. >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > > > -- > Mario Steele > http://www.trilake.net > http://www.ruby-im.net > http://rubyforge.org/projects/wxruby/ > http://rubyforge.org/projects/wxride/ > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabio.petrucci at gmail.com Wed Oct 22 05:44:35 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Wed, 22 Oct 2008 11:44:35 +0200 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: > > Thanks for the link, I'll definitely be looking at this as a possible > solution to many problems with Ruby App Distribution. > > Thank you (all the team) for your time and effort. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Wed Oct 22 11:01:43 2008 From: lists at ruby-forum.com (Mark E.) Date: Wed, 22 Oct 2008 17:01:43 +0200 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: <43b24a7a8d503a3539cf9e5cb582ea5a@ruby-forum.com> Mario Steele wrote: > Well, you already know about rubyscript2exe, which works on all 3 > platforms. That's about the only thing I can suggest for it. > > On Linux: You create a shortcut, which is basically an INI Type file, > with > the extension .desktop, EG: MyProg.desktop, and in it, is the following > info: Mario, thanks for the intro to shortcuts in Linux. :) I should have known it would be more straight forward and cleaner. -MarkE -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Oct 22 11:03:24 2008 From: lists at ruby-forum.com (Mark E.) Date: Wed, 22 Oct 2008 17:03:24 +0200 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: <08efbc67d6735a6a03e6106b46b4da99@ruby-forum.com> Fabio Petrucci wrote: > There's another interesting way to explore to be able to generate > executable > into different platform: > > Look at the way shoes do it: > > http://hackety.org/2008/06/19/stampingExesAndDmgs.html > > It would be great having that for wxruby applications as well. Fabio, Thanks so much for sharing that link! That is the perfect direction! I see that it's just getting started really, but it has a lot of promise. -MarkE -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Oct 22 11:08:22 2008 From: lists at ruby-forum.com (Mark E.) Date: Wed, 22 Oct 2008 17:08:22 +0200 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: Mario Steele wrote: > PS. > > Thanks for the link, I'll definitely be looking at this as a possible > solution to many problems with Ruby App Distribution. Mario, I'm also interested in a more generic solution. I'm interested in rubygame, wxruby and other ruby projects. I'd love to tinker with it too. I imagine a nice wxruby GUI for driving the build process too. ;) But really, it would be great to be able to customize the following: + where the files get installed to (Shoes installer put it in \Program Files\Common Files\Shoes\ + what files get installed (different gems, libraries like sdl, etc) + The graphic to show + The script files to deploy (optional just a directory, etc) Seriously, let me know if I can help. I'm excited about this. -MarkE -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Oct 22 16:53:53 2008 From: lists at ruby-forum.com (Mark E.) Date: Wed, 22 Oct 2008 22:53:53 +0200 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: Mark E. wrote: [...] > But really, it would be great to be able to customize the following: > + where the files get installed to (Shoes installer put it in \Program > Files\Common Files\Shoes\ > + what files get installed (different gems, libraries like sdl, etc) > + The graphic to show > + The script files to deploy (optional just a directory, etc) After looking into the shoes installer a bit more... http://github.com/why/shoes/tree/master/platform/msw http://github.com/why/shoes/tree/master/platform/msw/stub.c It seems that the platform specific installer is being downloaded (from a hard coded location) and being run in "silent mode" where any install locations are defaulted and assumed. The windows platform specific installer is written in C. Unfortunately, I'm not a C coder. Not to say I couldn't tinker, but I don't have true C skills for creating new code. Anyway, that's my quick report. -MarkE -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Oct 23 11:36:14 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 23 Oct 2008 16:36:14 +0100 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: References: Message-ID: <490099EE.5050408@pressure.to> Mark E. wrote: > I'm also interested in a more generic solution. I'm interested in > rubygame, wxruby and other ruby projects. I'd love to tinker with it > too. > > I imagine a nice wxruby GUI for driving the build process too. ;) > > But really, it would be great to be able to customize the following: > + where the files get installed to (Shoes installer put it in \Program > Files\Common Files\Shoes\ > + what files get installed (different gems, libraries like sdl, etc) > + The graphic to show > + The script files to deploy (optional just a directory, etc) > Just to come in late on this discussion. I think perhaps I've mentioned this stuff before on the list a while back, but I've spent a fair bit of time working up executables and installers for Windows and Mac (I've done less with Linux). rubyscript2exe is OK, but it's far from perfect for wxRuby apps. Some of this is down to the large size of the wxruby binary. I've had trouble getting it to generate working exes on Mac. It had recently a bug (and maybe still has) a bug that included some libraries, including wxruby2.so twice over - which is a big hit in terms of the exe size. Having to unzip at each execution is also a bit messy and noticeably slows startup time. And it's not intended as a solution as an installer. Interested to read about the Shoes stuff, but I don't really like net installers. I'm fine with package managers, where a huge amount of work has gone into dealing with connection failure, but I'm a bit uneasy about a roll-your-own solution. If it's not impolite, I think _why's work is perhaps the most creative in the ruby world, but not the best maintained over time (I'm thinking of redcloth here). I got round this by using platform specific solutions. The basic process is: 1) Do a trace run of the app to discover all of its library dependencies 2) Assemble all of these libraries, plus the ruby interpreter and the ruby lib in a single place 3) Create a runnable app (this is only necessary on Mac) 4) Create an installer (a DMG on Mac, a setup.exe on Windows) A bit more detail 1) is covered by this script here: http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/assemble_libraries.rb 2) This rake file runs the script; use rbconfig.rb (part of the stdlib) to find the ruby executable and the dlls / bundles it depends on: http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/rake_assemble.rb These rake files define additional dlls that need to be included (eg for sqlite3) and find the ruby stuff http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/rake_mswin.rb http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/rake_osx.rb 3) Use Platypus (http://www.sveinbjorn.org/platypus) to turn a script file (eg an .rb or a .sh) into a runnable, nicely named and iconed .app bundle on OS X. Again this can be automated with rake 4) Use NSIS to create a cute installer on Windows, this requires creating a .nsi file to define the steps in the installer. This is a bit fiddly but it means you can include whatever additional files you want (eg documentation, app icons) and create whatever shortcuts you want (eg uninstallers). An example is here: http://weft-qda.rubyforge.org/svn/trunk/weft-qda/qda.nsi For OS X, Apple's own hdiutil command-line tool will create a .dmg that can be downloaded, expanded, so the user simply copies the .app file into their Applications folder. This is the standard way. Again, I automate this in the rakefile. For the time being, all this is in hard-coded rakefiles specific to one application. But I think it would not be too hard to make it more general, so that the rakefiles could be generated. But it's not something I really want to get into building myself. But it's worth bearing in mind that all the bits and pieces are out there already to produce 100% professional standard installers. alex From lists at ruby-forum.com Thu Oct 23 16:35:46 2008 From: lists at ruby-forum.com (Mark E.) Date: Thu, 23 Oct 2008 22:35:46 +0200 Subject: [wxruby-users] Recommended cross platform deployment methods? In-Reply-To: <490099EE.5050408@pressure.to> References: <490099EE.5050408@pressure.to> Message-ID: <5e97af5bee4940871390dc71a5199c15@ruby-forum.com> Alex Fenton wrote: [...] > For the time being, all this is in hard-coded rakefiles specific to one > application. But I think it would not be too hard to make it more > general, so that the rakefiles could be generated. But it's not > something I really want to get into building myself. But it's worth > bearing in mind that all the bits and pieces are out there already to > produce 100% professional standard installers. > > alex Alex, Thanks for your input. I had actually downloaded and played with Weft as an example of a DB driven wxRuby app. I was impressed by the installer, application shortcuts and the overall small size (about 2MB). So, thank you for elaborating on your process. I agree that a more generalized approach could be developed. Thanks for pointing out many of the pieces already out there to be had! -MarkE -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Sat Oct 25 09:34:17 2008 From: alex at pressure.to (Alex Fenton) Date: Sat, 25 Oct 2008 14:34:17 +0100 Subject: [wxruby-users] Wx::Bitmap causes segfaults In-Reply-To: <78ea589f72573f7a215cb2c19d570495@ruby-forum.com> References: <78ea589f72573f7a215cb2c19d570495@ruby-forum.com> Message-ID: <49032059.3000007@pressure.to> Hi Andreas Sorry for the delay in replying. Andreas Garn?s wrote: > Instantiating a Wx::Bitmap with width and height causes a segmentation > fault. This is the minimal example I could find where the behaviour is > exhibited: > > require 'rubygems' > require 'wx' > Wx::Bitmap.new(1, 1) The problem here is not that Wx::Bitmap.new(width, height) segfault, but that you can't instantiate Bitmap (or similarly, Font, I guess) outside of the main loop. In other words, you can't call Bitmap.new until after you've called App.run or App.main_loop. It works fine otherwise (tested SVN HEAD on GTK). This restriction is inherited from Wx, unfortunately. Bitmap is a platform-specific representation of an image, and wraps a C++ native gui object. These can't be created until various setup steps have been done. The no-argument version is an exception because no real resource is created. There are different ways round this - ArtProvider provides a way of retrieving and caching standard images. Following this I've added a note to the documentation of Bitmap and Font to say they shouldn't be created outside of main_loop. cheers alex From alex at pressure.to Sat Oct 25 09:45:15 2008 From: alex at pressure.to (Alex Fenton) Date: Sat, 25 Oct 2008 14:45:15 +0100 Subject: [wxruby-users] Wx::Font.new fails in a Runtime Error In-Reply-To: <236e49df0810140028h1c23b9f9k39e84f13c3856ce8@mail.gmail.com> References: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> <4f5049d8a8ae2b15fe54d69dcf5905c5@ruby-forum.com> <236e49df0810130631p54721dd7sb7a0e0ee89809c65@mail.gmail.com> <236e49df0810130636v4f649230nb92d7c3a943cd988@mail.gmail.com> <236e49df0810140028h1c23b9f9k39e84f13c3856ce8@mail.gmail.com> Message-ID: <490322EB.7080400@pressure.to> ?????? ????????? wrote: > > Andreas, you definitely have much more descriptive messages. > It looks like a problem of Windows version WxRuby, because Ruby itself > doesn't have these problems. > > Does anybody know if anything can be done with it, maybe in future > releases? The quality of error messages related to wrong types of arguments was improved in recent versions of SWIG. I'll double-check that the next windows build is done with the latest version. But when doing some development on Windows recently I had some similar problems - ie I was getting a segfault where it should be raising an exception. Which is pretty annoying b/c it's hard to track these down. I'll investigate further. cheers alex From kirill.likhodedov at gmail.com Sat Oct 25 16:48:42 2008 From: kirill.likhodedov at gmail.com (Kirill Likhodedov) Date: Sun, 26 Oct 2008 00:48:42 +0400 Subject: [wxruby-users] Wx::Font.new fails in a Runtime Error In-Reply-To: <490322EB.7080400@pressure.to> References: <236e49df0810130541i748bb4c5w1106c10f6d5c4edb@mail.gmail.com> <4f5049d8a8ae2b15fe54d69dcf5905c5@ruby-forum.com> <236e49df0810130631p54721dd7sb7a0e0ee89809c65@mail.gmail.com> <236e49df0810130636v4f649230nb92d7c3a943cd988@mail.gmail.com> <236e49df0810140028h1c23b9f9k39e84f13c3856ce8@mail.gmail.com> <490322EB.7080400@pressure.to> Message-ID: Thank you very much, Alex. That would be very great if the problem will be fixed or at least improved. :) 25.10.2008, ? 17:45, Alex Fenton ???????(?): > ?????? ????????? wrote: >> >> Andreas, you definitely have much more descriptive messages. >> It looks like a problem of Windows version WxRuby, because Ruby >> itself doesn't have these problems. >> >> Does anybody know if anything can be done with it, maybe in future >> releases? > > The quality of error messages related to wrong types of arguments > was improved in recent versions of SWIG. I'll double-check that the > next windows build is done with the latest version. > > But when doing some development on Windows recently I had some > similar problems - ie I was getting a segfault where it should be > raising an exception. Which is pretty annoying b/c it's hard to > track these down. I'll investigate further. > > cheers > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From hsarvell at gmail.com Sun Oct 26 03:17:39 2008 From: hsarvell at gmail.com (Henrik Sarvell) Date: Sun, 26 Oct 2008 14:17:39 +0700 Subject: [wxruby-users] Aui notebook problem with glossy tabs Message-ID: <921d551c0810260017t741d3786s5b9e433a98230046@mail.gmail.com> Hi everyone, I've got a problem with tabs in the AUI Notebook. I just implemented a light on dark GTK theme. It seems like the glossy tabs are trying to fade a gradient with light towards dark (see attachement), on top of that it is using black text per default. I assume this is a problem with wxWidgets core and not really anything we care to do anything about here. So I started looking into implementing with a simple look instead but notice the following in the AUI sample code: # TODO - Notebook styles not currently supported; not SO important if e_id = ID_NotebookArtGloss or e_id = ID_NotebookArtSimple Wx::message_box("AUI Notebook Art styles not currently supported in wxRuby") return end What is the status on this one, has it already been fixed already maybe? If not what is the priority? Cheers, /Henrik -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot-1.png Type: image/png Size: 22637 bytes Desc: not available URL: From alex at pressure.to Sun Oct 26 05:25:17 2008 From: alex at pressure.to (Alex Fenton) Date: Sun, 26 Oct 2008 09:25:17 +0000 Subject: [wxruby-users] Aui notebook problem with glossy tabs In-Reply-To: <921d551c0810260017t741d3786s5b9e433a98230046@mail.gmail.com> References: <921d551c0810260017t741d3786s5b9e433a98230046@mail.gmail.com> Message-ID: <4904377D.8080507@pressure.to> Henrik Sarvell wrote: > Hi everyone, I've got a problem with tabs in the AUI Notebook. I just > implemented a light on dark GTK theme. It seems like the glossy tabs > are trying to fade a gradient with light towards dark (see > attachement), on top of that it is using black text per default. I > assume this is a problem with wxWidgets core and not really anything > we care to do anything about here. So I started looking into > implementing with a simple look instead but notice the following in > the AUI sample code: > > # TODO - Notebook styles not currently supported; not SO important > if e_id = ID_NotebookArtGloss or > e_id = ID_NotebookArtSimple > Wx::message_box("AUI Notebook Art styles not currently supported > in wxRuby") > return > end > > What is the status on this one, has it already been fixed already > maybe? If not what is the priority? > As a a first step you could try the wxWidgets distribution AUI sample and see how it looks with your theme. The AUI style switching should work there and you could see whether the "simple" theme does indeed look better. As for wxRuby support for this: adding all the AuiTabArt classes is very low priority - I'm not sure I even want to do it. But it would perhaps be possible to add a method to AuiNoteBook that switches between the two available simple/glossy themes. alex From alex at pressure.to Sun Oct 26 06:50:57 2008 From: alex at pressure.to (Alex Fenton) Date: Sun, 26 Oct 2008 10:50:57 +0000 Subject: [wxruby-users] Aui notebook problem with glossy tabs In-Reply-To: <4904377D.8080507@pressure.to> References: <921d551c0810260017t741d3786s5b9e433a98230046@mail.gmail.com> <4904377D.8080507@pressure.to> Message-ID: <49044B91.8070100@pressure.to> Alex Fenton wrote: > Henrik Sarvell wrote: >> ... So I started looking into >> implementing with a simple look instead but notice the following in >> the AUI sample code: >> >> ,,,, > > > As for wxRuby support for this: adding all the AuiTabArt classes is > very low priority - I'm not sure I even want to do it. But it would > perhaps be possible to add a method to AuiNoteBook that switches > between the two available simple/glossy themes. OK, to SVN head I've added two methods to Wx::AuiNotebook : use_simple_art and use_glossy_art. These allow switching between the two tab styles provided, with glossy the default. Having tried it out the simple theme looks better on GTK I think, but perhaps the glossy better on OS X, from memory. alex From damnbigman at gmail.com Mon Oct 27 16:43:17 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Mon, 27 Oct 2008 14:43:17 -0600 Subject: [wxruby-users] Sorting Grid by column Message-ID: <48800a90810271343j67f7db05u10b0eec14b8e886b@mail.gmail.com> What would be the best way to sort a grid by the column the user clicks on? I have a bunch of database info being represented in grids (via GridTableBase) that I would like to be sortable by different columns. I didn't see anything in the Grid or GridTableBase about a column select event. Thanks, Glen -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Mon Oct 27 20:10:46 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 28 Oct 2008 00:10:46 +0000 Subject: [wxruby-users] Sorting Grid by column In-Reply-To: <48800a90810271343j67f7db05u10b0eec14b8e886b@mail.gmail.com> References: <48800a90810271343j67f7db05u10b0eec14b8e886b@mail.gmail.com> Message-ID: <49065886.2040804@pressure.to> Glen Holcomb wrote: > What would be the best way to sort a grid by the column the user > clicks on? I have a bunch of database info being represented in grids > (via GridTableBase) that I would like to be sortable by different > columns. I didn't see anything in the Grid or GridTableBase about a > column select event. There is an event evt_grid_label_left_click which is fired when a row or column header is clicked on. You can call get_col on the event object to find out which column was clicked. There are also similar events for right clicks and double clicks. To re-order a column, I think it should be enough to change what GridTableBase is returning in your case, and then calling refresh on the Grid. To select a whole column just use Grid#select_col method. cheers alex