From philkez at gmail.com Tue Aug 3 07:24:23 2010 From: philkez at gmail.com (Phillip & Kerrie Shelton) Date: Tue, 3 Aug 2010 21:24:23 +1000 Subject: [wxruby-users] segmentation fault. Message-ID: Hi, Thank you for publishing WxRuby. I am enjoying the time spent learning how to use it. I now have a 2000 line program that has found a bug in the sample printing.rb code and one in the WxRuby printing subsystem. In the sample code for printing, svn - Revision 2112: /trunk/wxruby/samples/printing/printing.rb, the page one code does not scale the graphics to the printed page size. For an a4 page it is printed at the same scale as it appears on screen. And while it prints the second page okay it shows a blank page in the printpreview window. The error is that the scaling code is using integer division instead of floating point division. The patch below fixes this bug. 274,275c274,275 < scale_x=(w/max_x) < scale_y=(h/max_y) --- > scale_x=(w.to_f/max_x.to_f) > scale_y=(h.to_f/max_y.to_f) 321c321 < overall_scale = scale * (w/page_width) --- > overall_scale = scale * (w.fdiv(page_width)) The second bug is something that I can not fix. If I apply the following patch to printing.rb, ruby will fail with a segmentation fault as I dismiss the page setup dialog every time. If I dont apply the patch, the segmentation fault will only appear when I exit the application. I would appreciate your response on this matter. 170c170 < page_setup_dialog = Wx::PageSetupDialog.new(self, Wx::get_app.page_setup_data) --- > page_setup_dialog = Wx::PageSetupDialog.new(nil, Wx::get_app.page_setup_data) 174a175 > page_setup_dialog.destroy() I am using ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mswin32] and A wxRuby distribution for Windows bundling : - ruby-1.9.1-p243 with its minimal dependency (zlib, iconv) built with MinGW - wxRuby-2.0.1 - built with wxWidgets-2.8.10 - associated documentation and samples - ruby-opengl-0.60.1 - RMagick-2.11.0 built with ImageMagick-6.5.5-6 with PNG/JPEG/TIFF support Phillip Shelton -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Aug 3 12:58:20 2010 From: lists at ruby-forum.com (Chase Wilson) Date: Tue, 3 Aug 2010 18:58:20 +0200 Subject: [wxruby-users] Making a Text Control selected once user hits a button Message-ID: <15691205173bbd6aae448fe75827d603@ruby-forum.com> I want it so that when a user hits a button, that a text control is selected and they can just start typing away and update the text control. Is there anyway to do this? -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Tue Aug 3 19:50:29 2010 From: mario at ruby-im.net (Mario Steele) Date: Tue, 3 Aug 2010 19:50:29 -0400 Subject: [wxruby-users] Making a Text Control selected once user hits a button In-Reply-To: <15691205173bbd6aae448fe75827d603@ruby-forum.com> References: <15691205173bbd6aae448fe75827d603@ruby-forum.com> Message-ID: evt_button(button) do @edit_control.set_focus end hth On Tue, Aug 3, 2010 at 12:58 PM, Chase Wilson wrote: > I want it so that when a user hits a button, that a text control is > selected and they can just start typing away and update the text > control. Is there anyway to do this? > -- > 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 Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Aug 6 07:30:43 2010 From: lists at ruby-forum.com (Kavitha Naveen) Date: Fri, 6 Aug 2010 13:30:43 +0200 Subject: [wxruby-users] Unable to run the code using RubyMine editor Message-ID: I am new to Ruby and in the process of learning wxruby. Installed wxruby then I have created a simple ruby code I first went to wxruby\ruby\bin and typed ruby wxruby.rb The UI got displayed and everything worked fine. But when I try to run the same code attached using Jet Brains RubyMine editor. The error message that I am geting is given below C:\Ruby19\bin\ruby.exe -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) D:/wxruby/ruby/bin/wxruby.rb C:/Ruby19/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wx.rb:12:in `require': 126: The specified module could not be found. - C:/Ruby19/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wxruby2.so (LoadError) from C:/Ruby19/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wx.rb:12:in `' from D:/wxruby/ruby/bin/wxruby.rb:1:in `require' from D:/wxruby/ruby/bin/wxruby.rb:1:in `' from -e:1:in `load' from -e:1:in `
' Process finished with exit code 1 After running through RubyMine editor when I again went back command prompt and then to bin directory in the location where wxruby was installed as wxruby\ruby\bin and executed using ruby wxruby.rb the same error popped up. Initially this was working fine. After executing through RubyMineeditor even from command prompt in bin directory it fails with the same error. Please help me how to solve the problem Thanks in advance Kavitha Attachments: http://www.ruby-forum.com/attachment/4913/wxruby.rb -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Aug 6 08:07:55 2010 From: lists at ruby-forum.com (Kredaxx P.) Date: Fri, 6 Aug 2010 14:07:55 +0200 Subject: [wxruby-users] Unable to run the code using RubyMine editor In-Reply-To: References: Message-ID: <4277a6e464beb099c8ff15d560c5d64b@ruby-forum.com> Hello, from my perspective this looks that you may not have set the gems path correctly in the editor. I have never used RubyMine, though. Google responsed with | File | Settings | Ruby SDK and Gems |. Check there and see if you can correct anything. I can recomment NetBeans if you still get into issues. After installing the Ruby bundle, go to Tools->Ruby platforms->Add platform-> and select "path_to_your_ruby/bin/ruby.exe" Also, I see that you are running the 1.9 branch of Ruby. In this case make sure you have wxruby-ruby19 installed. If you have just 'wxruby' gem installed, remove it and 'gem install wxruby-ruby19' -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Aug 6 08:45:01 2010 From: lists at ruby-forum.com (Kavitha Naveen) Date: Fri, 6 Aug 2010 14:45:01 +0200 Subject: [wxruby-users] Unable to run the code using RubyMine editor In-Reply-To: <4277a6e464beb099c8ff15d560c5d64b@ruby-forum.com> References: <4277a6e464beb099c8ff15d560c5d64b@ruby-forum.com> Message-ID: Kredaxx P. wrote: > Hello, from my perspective this looks that you may not have set the gems > path correctly in the editor. I have never used RubyMine, though. Google > responsed with > | File | Settings | Ruby SDK and Gems |. Check there and see if you can correct anything. > > I can recomment NetBeans if you still get into issues. After installing > the Ruby bundle, go to Tools->Ruby platforms->Add platform-> and select > "path_to_your_ruby/bin/ruby.exe" > > Also, I see that you are running the 1.9 branch of Ruby. In this case > make sure you have wxruby-ruby19 installed. If you have just 'wxruby' > gem installed, remove it and 'gem install wxruby-ruby19' Thankyou for the response, But I made sure that I have set the environment correctly. In Rubymine we set the environment in File->Settings->Project Structure as D:\wxruby\ruby\bin\rubyw.exe and I have installed the required gems also. I have installed wxruby-ruby19 which come as as a single installation package with wxruby installer.I am using Windows XP. But still the same error pops up. Please help if you have any other ideas. -- Posted via http://www.ruby-forum.com/. From giff.h92 at gmail.com Fri Aug 6 12:38:49 2010 From: giff.h92 at gmail.com (Hameed Gifford) Date: Fri, 06 Aug 2010 12:38:49 -0400 Subject: [wxruby-users] Unable to run the code using RubyMine editor In-Reply-To: References: Message-ID: <1281112729.2649.1.camel@hamstap85-laptop> You have the wrong WxRuby installed. You have Ruby1.9.1 installed, so you have to have WxRuby19 to work with it. You're currently using the WxRuby for Ruby1.8. That should get you past the first large hurdle of problems. On Fri, 2010-08-06 at 13:30 +0200, Kavitha Naveen wrote: > I am new to Ruby and in the process of learning wxruby. > > Installed wxruby then I have created a simple ruby code > > I first went to wxruby\ruby\bin and typed ruby wxruby.rb > The UI got displayed and everything worked fine. > > But when I try to run the same code attached using Jet Brains RubyMine > editor. > > The error message that I am geting is given below > > C:\Ruby19\bin\ruby.exe -e > STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) > D:/wxruby/ruby/bin/wxruby.rb > C:/Ruby19/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wx.rb:12:in > `require': 126: The specified module could not be found. - > C:/Ruby19/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wxruby2.so > (LoadError) > from > C:/Ruby19/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wx.rb:12:in > `' > from D:/wxruby/ruby/bin/wxruby.rb:1:in `require' > from D:/wxruby/ruby/bin/wxruby.rb:1:in `' > from -e:1:in `load' > from -e:1:in `
' > > Process finished with exit code 1 > > After running through RubyMine editor when I again went back command > prompt and then to bin directory in the location where wxruby was > installed as wxruby\ruby\bin and executed using ruby wxruby.rb the same > error popped up. Initially this was working fine. After executing > through RubyMineeditor even from command prompt in bin directory it > fails with the same error. > > Please help me how to solve the problem > > Thanks in advance > Kavitha > > Attachments: > http://www.ruby-forum.com/attachment/4913/wxruby.rb > From lists at ruby-forum.com Fri Aug 6 18:32:04 2010 From: lists at ruby-forum.com (Chase Wilson) Date: Sat, 7 Aug 2010 00:32:04 +0200 Subject: [wxruby-users] MediaCtrl audio not playing Message-ID: Ok, so I have this weird problem, where I load an audio file into a mediacontrol with an unspecified backend.(i call it like this: @mediacontrol = Wx::MediaControl.new(self)) I wanted the audio to play after the audio is loaded. I.e user pressed load, and after it loads, it plays. However, it loads, but doesn't play. Sometimes when you push the play button it will work, but some audio files (which open fine in Windows media player) wont open. The really weird thing is this code makes it play: if not @mediacontrol.play text = Wx::TextEntryDialog.new(self, "input string","Please enter text") text.show_modal @mediacontrol.load(text.get_value) end Can anyone help me understand why this is? I don't want to have to open up a dialog every time I play an audio file. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Aug 11 21:46:11 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Thu, 12 Aug 2010 03:46:11 +0200 Subject: [wxruby-users] wxRichTextCtrl not Working through wxFormBuilder Message-ID: I've used wxFormBuilder to put a wxRichTextCtrl on my form. After doing this, I run xrcise and try to use the control. The variable for the rich text control is a FixNum. On examination, I saw that the class name in the xrc file is "unknown". Is there no way to use this control without manually laying out the controls - or writing this routine in C++? Does anyone know a workaround? Thanks in advance. ---Michael -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Aug 12 03:15:21 2010 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Aug 2010 08:15:21 +0100 Subject: [wxruby-users] wxRichTextCtrl not Working through wxFormBuilder In-Reply-To: References: Message-ID: <4C639F89.9040208@pressure.to> Hi On 12/08/2010 02:46, Michael Satterwhite wrote: > I've used wxFormBuilder to put a wxRichTextCtrl on my form. After doing > this, I run xrcise and try to use the control. The variable for the rich > text control is a FixNum. On examination, I saw that the class name in > the xrc file is "unknown". > > Is there no way to use this control without manually laying out the > controls - or writing this routine in C++? Does anyone know a > workaround? > I worked around it by designing the XRC with a bog-standard Wx::TextCtrl, then in the initialise method of the inheriting Ruby class, replacing it with a RichTextCtrl. I wrote a convenience method to handle it properly. It's called like this (assuming a TextCtrl mapped to the instance var @text_box) rtc = Wx::RichTextCtrl.new(....) replace_xrc(:text_box, rtc) The replace_xrc method looks like this: class Wx::Window # Convenience function to replace one Window with another. Useful # because there are elements which are not available or convenient in # XRC, but a placeholder can be used with a real child created in # ruby. # # Expects a symbol (eg :@child by which the old can be got) and a new # child to replace it. The instance variable's value is overwritten. def replace_xrc(old_sym, new_win) old_win = instance_variable_get("@#{old_sym}") old_win.containing_sizer.replace( old_win, new_win ) old_win.destroy instance_variable_set("@#{old_sym}", new_win) new_win.containing_sizer.layout end end (from http://weft-qda.rubyforge.org/svn/trunk/weft-qda/lib/weft/wxgui/utilities.rb) hth alex From lists at ruby-forum.com Thu Aug 19 09:26:04 2010 From: lists at ruby-forum.com (tuti plain) Date: Thu, 19 Aug 2010 15:26:04 +0200 Subject: [wxruby-users] cannot require 'wx' Message-ID: <49c7264a685414ccc06cae1c3d65667a@ruby-forum.com> Hi everyone, I'm new to wxRuby. I installed using "gem install wxruby" and it installed version 2.0.1, along with ri and rdoc documentation. I try to test it in irb, but I get this message: [code] irb(main):001:0> require 'wx' LoadError: no such file to load -- wx from (irb):1:in `require' from (irb):1 [/code] I also get an error message if I write this code in a text editor: [code] require "wx" include Wx class MinimalApp < App def on_init Frame.new(nil, -1, "The Bare Minimum").show() end end MinimalApp.new.main_loop [/code] Produces this: [code] ./wx.rb:2: uninitialized constant Wx (NameError) from wx.rb:1:in `require' from wx.rb:1 [/code] I thought it had something to do with the wx_sugar gem so I uninstalled it using "gem uninstall wx_sugar", but the errors were still there. I am using Win XP Professional, and Ruby Installer 1.8.7. Please help! -- Posted via http://www.ruby-forum.com/. From bdloving at uncg.edu Thu Aug 19 10:02:11 2010 From: bdloving at uncg.edu (Bruce Loving) Date: Thu, 19 Aug 2010 10:02:11 -0400 Subject: [wxruby-users] cannot require 'wx' In-Reply-To: <49c7264a685414ccc06cae1c3d65667a@ruby-forum.com> References: <49c7264a685414ccc06cae1c3d65667a@ruby-forum.com> Message-ID: I believe you have to require rubygems before you require wx On Thu, Aug 19, 2010 at 9:26 AM, tuti plain wrote: > Hi everyone, > > I'm new to wxRuby. I installed using "gem install wxruby" and it > installed version 2.0.1, along with ri and rdoc documentation. I try > to test it in irb, but I get this message: > > [code] > irb(main):001:0> require 'wx' > LoadError: no such file to load -- wx > from (irb):1:in `require' > from (irb):1 > [/code] > > I also get an error message if I write this code in a text editor: > [code] > require "wx" > include Wx > > class MinimalApp < App > def on_init > Frame.new(nil, -1, "The Bare Minimum").show() > end > end > > > MinimalApp.new.main_loop > [/code] > > Produces this: > [code] > ./wx.rb:2: uninitialized constant Wx (NameError) > from wx.rb:1:in `require' > from wx.rb:1 > [/code] > > I thought it had something to do with the wx_sugar gem so I > uninstalled it using "gem uninstall wx_sugar", but the errors were still > there. I am using Win XP Professional, and Ruby Installer 1.8.7. > Please help! > -- > 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 Thu Aug 19 11:15:43 2010 From: lists at ruby-forum.com (tuti plain) Date: Thu, 19 Aug 2010 17:15:43 +0200 Subject: [wxruby-users] cannot require 'wx' In-Reply-To: References: <49c7264a685414ccc06cae1c3d65667a@ruby-forum.com> Message-ID: <9999bf5e9601b324149f5939cbcdea07@ruby-forum.com> Bruce Loving wrote: > I believe you have to require rubygems before you require wx Hi, I did as you suggested and got the following: NameError: uninitialized constant Wx from ./wx.rb:2 from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' This was using irb. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Aug 19 11:22:21 2010 From: lists at ruby-forum.com (tuti plain) Date: Thu, 19 Aug 2010 17:22:21 +0200 Subject: [wxruby-users] cannot require 'wx' In-Reply-To: <9999bf5e9601b324149f5939cbcdea07@ruby-forum.com> References: <49c7264a685414ccc06cae1c3d65667a@ruby-forum.com> <9999bf5e9601b324149f5939cbcdea07@ruby-forum.com> Message-ID: <598cb08aa03a0d084b86fd6d28950a82@ruby-forum.com> Hi, I tried using Ruby Installer 1.8.6 and now it works (after requiring rubygems as you suggested). It seems wxruby is incompatible with the newer versions. They should put that in the tutorial. Anyhoop, thanks so much. Now I can begin programming GUI in Ruby! -- Posted via http://www.ruby-forum.com/. From bdloving at uncg.edu Thu Aug 19 11:32:34 2010 From: bdloving at uncg.edu (Bruce Loving) Date: Thu, 19 Aug 2010 11:32:34 -0400 Subject: [wxruby-users] cannot require 'wx' In-Reply-To: <9999bf5e9601b324149f5939cbcdea07@ruby-forum.com> References: <49c7264a685414ccc06cae1c3d65667a@ruby-forum.com> <9999bf5e9601b324149f5939cbcdea07@ruby-forum.com> Message-ID: this works just fine for me. require 'rubygems' require 'wx' include Wx On Thu, Aug 19, 2010 at 11:15 AM, tuti plain wrote: > Bruce Loving wrote: > > I believe you have to require rubygems before you require wx > > Hi, I did as you suggested and got the following: > > > NameError: uninitialized constant Wx > from ./wx.rb:2 > from > C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require' > from > C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require' > > This was using irb. > -- > 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 mario at ruby-im.net Thu Aug 19 16:31:03 2010 From: mario at ruby-im.net (Mario Steele) Date: Thu, 19 Aug 2010 16:31:03 -0400 Subject: [wxruby-users] cannot require 'wx' In-Reply-To: <598cb08aa03a0d084b86fd6d28950a82@ruby-forum.com> References: <49c7264a685414ccc06cae1c3d65667a@ruby-forum.com> <9999bf5e9601b324149f5939cbcdea07@ruby-forum.com> <598cb08aa03a0d084b86fd6d28950a82@ruby-forum.com> Message-ID: Heya Tuti, We provide a Installer program on our Projects page of RubyForge for Ruby 1.8.7, and wxRuby combined. The reason we have troubles with this, is cause the Ruby Installer project just went from MSVCRT compiler to the MINGW compiler. Different compilers have different methods in which to compile code, and export Library Routines, so binary extensions built for MSVCRT, isn't compatible with MINGW. The same holds true on Ubuntu systems. Ubuntu version 8.10 and before earlier use gcc 3.3, which is incompatible with Ubuntu version 9.04 onwards, which uses gcc 4.0. We have to use different builds for < 8.10 compared to > 9.04. The main cause of this, is RubyGems isn't very compiler aware, outside of the main compiler names, they don't allow for Compiler versions in the naming scheme. So we have to package things a bit differently. In most cases, when you try to install a binary Gem, it won't follow the compiler used, especially MINGW, as it just recently became popular with the adaptation of the Ruby One Click Installer project. You will find with our next wxRuby gem release, that it will be compiled for MINGW and GCC 4.0+. And then we'll have to provide deprecated versions for older GCC Versions. I don't know if we will still maintain a MSVCRT version for Windows, as that has not been decided yet. hth, Mario On Thu, Aug 19, 2010 at 11:22 AM, tuti plain wrote: > Hi, > > I tried using Ruby Installer 1.8.6 and now it works (after requiring > rubygems as you suggested). It seems wxruby is incompatible with the > newer versions. They should put that in the tutorial. > > Anyhoop, thanks so much. Now I can begin programming GUI in Ruby! > -- > 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 Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Aug 19 18:11:44 2010 From: lists at ruby-forum.com (tuti plain) Date: Fri, 20 Aug 2010 00:11:44 +0200 Subject: [wxruby-users] cannot require 'wx' In-Reply-To: References: <49c7264a685414ccc06cae1c3d65667a@ruby-forum.com> <9999bf5e9601b324149f5939cbcdea07@ruby-forum.com> <598cb08aa03a0d084b86fd6d28950a82@ruby-forum.com> Message-ID: <388c9ad0fa674b681691521cd69f5b27@ruby-forum.com> Thanks for the explanation Mario, > You will find with our next wxRuby gem release, that it will be compiled > for > MINGW and GCC 4.0+. And then we'll have to provide deprecated versions > for > older GCC Versions. I don't know if we will still maintain a MSVCRT > version > for Windows, as that has not been decided yet. > > hth, > > Mario I did not completely understand what you meant with this paragraph but I assume that you mean the next release will be compatible without requiring a separate build. I look forward to it. I do remember downloading a wx-ready ruby 1.9 installer from the wxRuby page in RubyForge a while back. Not sure if it's still available. But I didn't use it for long. Anyway, I'll check it out again. In the meantime, I'm happy with 1.8.6. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Aug 22 10:33:37 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Sun, 22 Aug 2010 16:33:37 +0200 Subject: [wxruby-users] Not stretching vertically Message-ID: <79faeecb13148fdad49a900ed2957e7b@ruby-forum.com> I'm using wxRuby 2.0.1 on a PCLinuxOS system I have a form with a horizontal sizer. The form was built by wsFormBuilder if that matters. The sizer's proportion is set to 1. There are two controls in the sizer. On the left is a listbox with proportion of 1. On the right is a textbox with proportion 2. By use of the minimum size, both boxes start off with correct sizes. When I stretch the form, however, the two controls stretch as desired in the horizontal direction, but the veritcal sizes don't change at all. This creates a very ugly space beneath the controls (and above another horizontal sizer that has the control buttons in it ... that sizer has a proportion of 0 and doesn't stretch - again, as desired. I'm obviously missing something. What do I need to do to get the controls to stretch in the vertical direction as well as the horizontal? As always, thanks in advance ---Michael -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Sun Aug 22 20:57:59 2010 From: mario at ruby-im.net (Mario Steele) Date: Sun, 22 Aug 2010 20:57:59 -0400 Subject: [wxruby-users] Not stretching vertically In-Reply-To: <79faeecb13148fdad49a900ed2957e7b@ruby-forum.com> References: <79faeecb13148fdad49a900ed2957e7b@ruby-forum.com> Message-ID: Hello Michael, What you need to do, is in wxFormBuilder, you need to ensure that under Sizer Properties for the sizer in question, you have wxGROW and wxEXPAND checked, in order for both vertical and horizontal growth to occur when re-sizing the main form. Otherwise, it will only follow the rules given to it by a wxSizer of whatever direction you choose. hth, Mario On Sun, Aug 22, 2010 at 10:33 AM, Michael Satterwhite wrote: > I'm using wxRuby 2.0.1 on a PCLinuxOS system > > I have a form with a horizontal sizer. The form was built by > wsFormBuilder if that matters. The sizer's proportion is set to 1. > > There are two controls in the sizer. On the left is a listbox with > proportion of 1. On the right is a textbox with proportion 2. By use of > the minimum size, both boxes start off with correct sizes. > > When I stretch the form, however, the two controls stretch as desired in > the horizontal direction, but the veritcal sizes don't change at all. > This creates a very ugly space beneath the controls (and above another > horizontal sizer that has the control buttons in it ... that sizer has a > proportion of 0 and doesn't stretch - again, as desired. > > I'm obviously missing something. What do I need to do to get the > controls to stretch in the vertical direction as well as the horizontal? > > As always, thanks in advance > ---Michael > -- > 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 Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sun Aug 22 22:59:53 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Mon, 23 Aug 2010 04:59:53 +0200 Subject: [wxruby-users] Not stretching vertically In-Reply-To: References: <79faeecb13148fdad49a900ed2957e7b@ruby-forum.com> Message-ID: <16d92c482fa65f9f2db455f474196da1@ruby-forum.com> Mario Steele wrote: > Hello Michael, > > What you need to do, is in wxFormBuilder, you need to ensure that under > Sizer Properties for the sizer in question, you have wxGROW and wxEXPAND > checked, in order for both vertical and horizontal growth to occur when > re-sizing the main form. Otherwise, it will only follow the rules given > to > it by a wxSizer of whatever direction you choose. I'm looking at the sizer in wxFormBuilder right now. I see wxExpand - and it is checked. I don't see a wxGrow *ANYWHERE* in the properties. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Aug 23 07:13:14 2010 From: alex at pressure.to (Alex Fenton) Date: Mon, 23 Aug 2010 12:13:14 +0100 Subject: [wxruby-users] Not stretching vertically In-Reply-To: <16d92c482fa65f9f2db455f474196da1@ruby-forum.com> References: <79faeecb13148fdad49a900ed2957e7b@ruby-forum.com> <16d92c482fa65f9f2db455f474196da1@ruby-forum.com> Message-ID: <4C7257CA.1070409@pressure.to> Michael Satterwhite wrote: > I'm looking at the sizer in wxFormBuilder right now. I see wxExpand - > and it is checked. I don't see a wxGrow *ANYWHERE* in the properties. > Wx::GROW is just a (less frequently used) synonym for Wx::EXPAND. But Wx::EXPAND (or in C++/xrc, wxExpand) is definitely what you want, as Mario says. The proportion argument controls sizing in the main (in this case horizontal) dimension. Wx::EXPAND means it should fill the space in the other dimension. If that's not working, check that the sizer itself is really getting the space you think it is - have a look at the boundaries in XRC designer - these should be an accurate reflection of what it will look like. If that doesn't help, please post a minimal snippet that reproduces the problem. a From lists at ruby-forum.com Mon Aug 23 10:45:57 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Mon, 23 Aug 2010 16:45:57 +0200 Subject: [wxruby-users] Not stretching vertically In-Reply-To: <4C7257CA.1070409@pressure.to> References: <79faeecb13148fdad49a900ed2957e7b@ruby-forum.com> <16d92c482fa65f9f2db455f474196da1@ruby-forum.com> <4C7257CA.1070409@pressure.to> Message-ID: <0de4dcb2eb13e349ce27dc65f52e3d2a@ruby-forum.com> Got it - and, of course, I had missed something that should have been obvious. I had the sizers set up correctly. I hadn't checked wxExpand in the controls, though. I want to thank those who replied. Your feedback got me looking in the right direction. I appreciate the help! ---Michael -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Aug 23 10:50:58 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Mon, 23 Aug 2010 16:50:58 +0200 Subject: [wxruby-users] Segmentation Fault Message-ID: <652598bbf7276cd4e07e7b48371022ac@ruby-forum.com> Once more, with feeling. I'm trying to implement using xrc_replace so as to use a RichTextCtrl in a form created by FormBuilder. The problem is that I can't even create a RichTextCtrl. When I try to, I get a segmentation fault. I've attached the files that are causing this. I'm running wxRuby on a box running an up-to-date PCLinuxOS distro. I've stripped what I've written down to the bare essentials, the fault occurs on the Wx::RichTextCtrl.new(self) line in mwsnotes.rb. The exact message I'm seeing is /usr/lib/ruby/site_ruby/1.8/wx /keyword_ctors.rb:168: [BUG] Segmentation fault ruby 1.8.7 (2009-06-12 patchlevel 174) [i586-linux] Thanks in advance. ---Michael Attachments: http://www.ruby-forum.com/attachment/4965/test.zip -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Tue Aug 24 00:56:29 2010 From: mario at ruby-im.net (Mario Steele) Date: Tue, 24 Aug 2010 00:56:29 -0400 Subject: [wxruby-users] Not stretching vertically In-Reply-To: <0de4dcb2eb13e349ce27dc65f52e3d2a@ruby-forum.com> References: <79faeecb13148fdad49a900ed2957e7b@ruby-forum.com> <16d92c482fa65f9f2db455f474196da1@ruby-forum.com> <4C7257CA.1070409@pressure.to> <0de4dcb2eb13e349ce27dc65f52e3d2a@ruby-forum.com> Message-ID: That is what we are here for Michael. Glad that it worked, and helped you find the problem. Mario On Mon, Aug 23, 2010 at 10:45 AM, Michael Satterwhite wrote: > Got it - and, of course, I had missed something that should have been > obvious. I had the sizers set up correctly. I hadn't checked wxExpand in > the controls, though. > > I want to thank those who replied. Your feedback got me looking in the > right direction. I appreciate the help! > > ---Michael > > > -- > 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 Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Tue Aug 24 00:58:50 2010 From: mario at ruby-im.net (Mario Steele) Date: Tue, 24 Aug 2010 00:58:50 -0400 Subject: [wxruby-users] Segmentation Fault In-Reply-To: <652598bbf7276cd4e07e7b48371022ac@ruby-forum.com> References: <652598bbf7276cd4e07e7b48371022ac@ruby-forum.com> Message-ID: Hey Michael, Try creating the RichText Control, with Wx::TextCtrl.new(self,:style=>Wx::TE_MULTILINE|Wx::TE_RICH). I've never had the ability to use the Wx::RichTextCtrl class directly, but using the above method, works perfectly fine, and has never failed on me. hth, Mario On Mon, Aug 23, 2010 at 10:50 AM, Michael Satterwhite wrote: > Once more, with feeling. > > I'm trying to implement using xrc_replace so as to use a RichTextCtrl in > a form created by FormBuilder. The problem is that I can't even create a > RichTextCtrl. When I try to, I get a segmentation fault. > > I've attached the files that are causing this. I'm running wxRuby on a > box running an up-to-date PCLinuxOS distro. I've stripped what I've > written down to the bare essentials, the fault occurs on the > Wx::RichTextCtrl.new(self) line in mwsnotes.rb. > > The exact message I'm seeing is /usr/lib/ruby/site_ruby/1.8/wx > > /keyword_ctors.rb:168: [BUG] Segmentation fault > ruby 1.8.7 (2009-06-12 patchlevel 174) [i586-linux] > > Thanks in advance. > ---Michael > > Attachments: > http://www.ruby-forum.com/attachment/4965/test.zip > > -- > 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 Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Aug 24 10:39:22 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Tue, 24 Aug 2010 16:39:22 +0200 Subject: [wxruby-users] Segmentation Fault In-Reply-To: References: <652598bbf7276cd4e07e7b48371022ac@ruby-forum.com> Message-ID: <88b5ec024e2bf61f63a1993452643610@ruby-forum.com> Mario Steele wrote: > Hey Michael, > > Try creating the RichText Control, with > Wx::TextCtrl.new(self,:style=>Wx::TE_MULTILINE|Wx::TE_RICH). I've never > had > the ability to use the Wx::RichTextCtrl class directly, but using the > above > method, works perfectly fine, and has never failed on me. > > hth, > > Mario > > On Mon, Aug 23, 2010 at 10:50 AM, Michael Satterwhite That probably works great under Windoze, but it's ignored under other platforms. I'm developing on PCLinuxOS. -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Tue Aug 24 18:59:50 2010 From: mario at ruby-im.net (Mario Steele) Date: Tue, 24 Aug 2010 18:59:50 -0400 Subject: [wxruby-users] Segmentation Fault In-Reply-To: <88b5ec024e2bf61f63a1993452643610@ruby-forum.com> References: <652598bbf7276cd4e07e7b48371022ac@ruby-forum.com> <88b5ec024e2bf61f63a1993452643610@ruby-forum.com> Message-ID: Hey Michael, On Tue, Aug 24, 2010 at 10:39 AM, Michael Satterwhite wrote: > Mario Steele wrote: > > Hey Michael, > > > > Try creating the RichText Control, with > > Wx::TextCtrl.new(self,:style=>Wx::TE_MULTILINE|Wx::TE_RICH). I've never > > had > > the ability to use the Wx::RichTextCtrl class directly, but using the > > above > > method, works perfectly fine, and has never failed on me. > > > > hth, > > > > Mario > > > > On Mon, Aug 23, 2010 at 10:50 AM, Michael Satterwhite > > That probably works great under Windoze, but it's ignored under other > platforms. I'm developing on PCLinuxOS. > I develop for Ubuntu / Mac OS X, and have always used that incarnation to create a RichText Control, and has always come out to be a RichText Control. It is universal, and works on all 3 platforms, so I don't see why it wouldn't work. > -- > 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 Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Aug 24 23:43:15 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Wed, 25 Aug 2010 05:43:15 +0200 Subject: [wxruby-users] Segmentation Fault In-Reply-To: References: <652598bbf7276cd4e07e7b48371022ac@ruby-forum.com> <88b5ec024e2bf61f63a1993452643610@ruby-forum.com> Message-ID: <336e229f0e486aa0e7960cc39b9fb218@ruby-forum.com> Mario Steele wrote: > I develop for Ubuntu / Mac OS X, and have always used that incarnation > to > create a RichText Control, and has always come out to be a RichText > Control. > It is universal, and works on all 3 platforms, so I don't see why it > wouldn't work. My fault, and it is a perfect example of Satterwhite's Observation on Life #2: "In any situation in which theory conflicts with reality, reality wins hands down." I was basing my reply on the documentation of style TE_RICH: "Use rich text control under Win32, this allows to have more than 64KB of text in the control even under Win9x. This style is ignored under other platforms." That was the theory. You're telling me what the reality is based on experience - that it works well under the other platforms. I should have known better. Thanks much. I'll try this. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Aug 26 20:27:08 2010 From: lists at ruby-forum.com (Ross Goodell) Date: Fri, 27 Aug 2010 02:27:08 +0200 Subject: [wxruby-users] =?utf-8?q?Does_stack_get_unwound_when_event_return?= =?utf-8?q?s=09without_skip=3F?= In-Reply-To: <4BF3CAEA.7010004@pressure.to> References: <460588426eca67ece1baf351681d3180@ruby-forum.com> <4BF32581.9040905@pressure.to> <4BF3CAEA.7010004@pressure.to> Message-ID: Alex, I apologize for being so late in responding. I?d intended to come up with a small example of the problem, but it turned out to be more difficult than I?d expected. Then vacation and other activities wiped out most of about 7 weeks. I eventually was able to reduce the stack build-up significantly, by avoiding passing the Wx::Event objects and other clean-ups. I also moved my working logic out of all the rescue blocks. I understand that shouldn?t make a difference. I had the impression that it did reduce the stack build-up, but I could very well be mistaken. Perhaps your conjecture--that if the next event hasn't started, the old stack context is still there--is correct. I did not eliminate all of my use of exception handling for non-terminal errors. I use exception handling to improve the program?s performance when checking for those problems ahead of time in my program when I believe that it would be a significant performance hit. I was never able to reproduce any of the remaining stack build-up problems in my simplified example, so I still don?t know what is going on. The stack build-up is slow enough that I?ve never been aware of it interfering with my program?s behavior. Thanks again for all your help. My regards, Ross Alex Fenton wrote: > On 19/05/2010 02:12, Ross Goodell wrote: >> Thanks Alex. By not getting "unwound" I meant that the stack that was >> displayed when I gave the "w" command in the Ruby debugger continued to >> show entries for methods called by an exception handler, e.g. rescue >> NameError => noMethodErrorObj during the processing for an event handler >> such as evt_key_up, after the exception handler had completed. (Also by >> using the "up" command in the Ruby debugger I found that the old stacked >> local variables really were still available.) >> > > That's interesting to know. From debugging on the C++ side, how I think > it should look is that a wxRuby app is constantly within a main_loop > method. Within that it's sequentially in a series of event handlers, > which are called Procs. So perhaps if the next event hasn't started, the > old stack context is still there, even if practically it's finished. > >> Further experiments since I made that last post suggested to me that at >> least much of it was caused by my using logic in Ruby rescue clauses to >> complete the processing and assuming that the subsequent return from the >> method would "unwind" the stack in the same way as a normal method >> return. Some experimentation seemed to indicate that I need to use >> retry if I want to get the stack "unwound" normally. I'm now in the >> process of making that change everywhere I need to and seeing if that >> solves my problem. >> > > What's the problem that it's causing for your app? I would limit using > rescue/retry to genuine Ruby exception conditions; there should be a > more straightforward way to do it if it's ordinary event processing. PS > - I expect you've already noted this, but never hold a reference to a > Wx::Event object (eg in an @instance_variable). wxRuby is likely to > delete the object from under you causing crashes or other problems. > >> My hypothesis in this is that rescue must be intended only for logic >> that will terminate the program unless retry is given. If that's wrong >> and there is a problem in wxRuby, I will certainly get a simple example >> together and pass it on to you. However, I'm about to go on vacation, >> so it may be a few weeks before I get it done. >> > > Rescue should work as in "normal" ruby; it's just that all the code > running in a GUI app is the event handling code, with the main_loop as > the root context of the stack. > > Hope you have a good holiday, please get in touch if further questions > come up. > > a -- Posted via http://www.ruby-forum.com/.