From axel.friedrich at siemens.com Wed Nov 4 10:07:07 2009 From: axel.friedrich at siemens.com (Friedrich, Axel) Date: Wed, 4 Nov 2009 16:07:07 +0100 Subject: [wxruby-users] Installing on openSUSE 11.1 Message-ID: <1BDD6C6D3250C54CA91DD9348C23774F06DA1CCD@DEFTHW99EA4MSX.ww902.siemens.net> Still a chance to get help? Kind Regards, Axel From lists at ruby-forum.com Thu Nov 5 05:34:34 2009 From: lists at ruby-forum.com (Dirk Herzhauser) Date: Thu, 5 Nov 2009 11:34:34 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 Message-ID: Hi, i tried too install wxruby-2.0.1 on opensuse 11.2 from the rake command I get the following error: ... usr/lib/gcc/i586-suse-linux/4.4/../../../../i586-suse-linux/bin/ld: cannot find -lwx_gtk2u_media-2.8 collect2: ld returned 1 exit status rake aborted! Command failed with status (1): [g++ -shared -fPIC -o -L. -rdynamic -Wl,-...] /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:995:in `sh' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1010:in `sh' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1094:in `sh' ./rake/rakewx.rb:101 /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:634:in `call' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:634:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load' /usr/bin/rake:19 an dirk at linuxe:~> ls -la /usr/lib/libwx_gtk2u_mmedia-2.8.so.0 lrwxrwxrwx 1 root root 31 28. Okt 11:24 /usr/lib/libwx_gtk2u_mmedia-2.8.so.0 -> libwx_gtk2u_mmedia-2.8.so.0.6.0 shows everything is there so what can I do? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 5 12:26:40 2009 From: lists at ruby-forum.com (Dean Close) Date: Thu, 5 Nov 2009 18:26:40 +0100 Subject: [wxruby-users] Unable to use wxruby-ruby19 in Ruby 1.9.1-p129 on Windows In-Reply-To: References: <2a71bf63b4d6cad27b777ae11227122f@ruby-forum.com> Message-ID: <98714d1399262bf1ea2ef001bc763578@ruby-forum.com> Chauk-Mean Proum wrote: > this seems to be specific to MinGW. > > The solution is to rebuild wxRuby-2.0 for the ruby-1.9.1-p129. > I just had this problem on OS X Leopard. Currently installing wxRuby using "gem install wxruby" won't work with a ruby19 system. As per the gems listed on the rubyforge page (http://rubyforge.org/frs/?group_id=35) I had to install the gem named with ruby19: gem uninstall wxruby gem install wxruby-ruby19 After this the system worked as expected. Dean. -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Thu Nov 5 12:41:48 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Thu, 5 Nov 2009 18:41:48 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: References: Message-ID: Hi Dirk, 2009/11/5 Dirk Herzhauser : > Hi, > > i tried too install wxruby-2.0.1 on opensuse 11.2 from the rake command > I get the following error: > ... > > usr/lib/gcc/i586-suse-linux/4.4/../../../../i586-suse-linux/bin/ld: > cannot find -lwx_gtk2u_media-2.8 > collect2: ld returned 1 exit status > dirk at linuxe:~> ls -la /usr/lib/libwx_gtk2u_mmedia-2.8.so.0 > lrwxrwxrwx 1 root root 31 28. Okt 11:24 > /usr/lib/libwx_gtk2u_mmedia-2.8.so.0 -> libwx_gtk2u_mmedia-2.8.so.0.6.0 > shows everything is there ?so what can I do? The missing lib is libwx_gtk2u_media-2.8 and not libwx_gtk2u_mmedia-2.8 (mmedia is an optional package). Check that you have a libwx_gtk2u_media-2.8.so accessible through your LD_LIBRARY_PATH and that points to the actual lib through symbolic links. Cheers. Chauk-Mean. From chauk.mean at gmail.com Thu Nov 5 12:47:32 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Thu, 5 Nov 2009 18:47:32 +0100 Subject: [wxruby-users] Bitmaps for disabled Toolbar buttons In-Reply-To: <0f6597bb496b3b36a628f980779b61a2@ruby-forum.com> References: <0f6597bb496b3b36a628f980779b61a2@ruby-forum.com> Message-ID: Hi, 2009/10/28 El Gato : > I have a tool bar with some custom icons (png images). ?I have both > enabled and disabled icon versions. ?Each toolbar item was added in this > way: > > tb.add_tool(ID_ADD, 'add', add_bmp, add_d_bmp, Wx::ITEM_NORMAL, 'Add > Item', '') > > When I launch the app, the icons which have been disabled via: > > get_tool_bar.enable_tool(ID_ADD, false) > > show black backgrounds instead of the normal transparency present in the > active icons. Do you use Windows XP ? If it is the case, see the installation notes regarding Windows XP (http://wxruby.rubyforge.org/wiki/wiki.pl?Installation) or read directly the following post : http://rubyonwindows.blogspot.com/2007/10/windows-xp-visual-style-controls-with.html Cheers. Chauk-Mean. From lists at ruby-forum.com Thu Nov 5 13:09:04 2009 From: lists at ruby-forum.com (El Gato) Date: Thu, 5 Nov 2009 19:09:04 +0100 Subject: [wxruby-users] GUI Responsiveness Message-ID: I'm having a heck of a time trying to keep my app appearing responsive while shelling out to long running commands / downloading large files. I've read everything I can find on the subject, which got me what I have now, but nothing I try seems to work. How do I keep the interface refreshed so that it's not just a plain white box after other windows are opened over it, etc? Below is a rough idea of what I have. What am I missing? def on_init t = Wx::Timer.new(self, 55) evt_timer(55) { Thread.pass } t.start(25) @frame = MyFrame.new @frame.show end class MyFrame ... def on_download(event) ... Thread.new { download(file) } ... end # on an event, download the file def download(file_obj) Wx::WindowDisabler.disable(self) do info = Wx::BusyInfo.busy('Please wait...', self) do Wx::log_message("Getting file #{file_obj.name}") file_obj.fetch # uses open-uri to get a large binary end end ... end end -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 5 13:39:35 2009 From: lists at ruby-forum.com (El Gato) Date: Thu, 5 Nov 2009 19:39:35 +0100 Subject: [wxruby-users] Bitmaps for disabled Toolbar buttons In-Reply-To: References: <0f6597bb496b3b36a628f980779b61a2@ruby-forum.com> Message-ID: Chauk-Mean Proum wrote: > Hi, > > 2009/10/28 El Gato : >> >> show black backgrounds instead of the normal transparency present in the >> active icons. > > Do you use Windows XP ? > If it is the case, see the installation notes regarding Windows XP > (http://wxruby.rubyforge.org/wiki/wiki.pl?Installation) or read > directly the following post : > http://rubyonwindows.blogspot.com/2007/10/windows-xp-visual-style-controls-with.html > > Cheers. > Chauk-Mean. Perfect! Thanks so much! -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Thu Nov 5 19:45:33 2009 From: mario at ruby-im.net (Mario Steele) Date: Thu, 5 Nov 2009 19:45:33 -0500 Subject: [wxruby-users] GUI Responsiveness In-Reply-To: References: Message-ID: Hello El, On Thu, Nov 5, 2009 at 1:09 PM, El Gato wrote: > I'm having a heck of a time trying to keep my app appearing responsive > while shelling out to long running commands / downloading large files. > I've read everything I can find on the subject, which got me what I have > now, but nothing I try seems to work. How do I keep the interface > refreshed so that it's not just a plain white box after other windows > are opened over it, etc? Below is a rough idea of what I have. What am > I missing? > > def on_init > t = Wx::Timer.new(self, 55) > evt_timer(55) { Thread.pass } > t.start(25) > > @frame = MyFrame.new > @frame.show > end > > class MyFrame > ... > def on_download(event) > ... > Thread.new { download(file) } > ... > end > > # on an event, download the file > def download(file_obj) > Wx::WindowDisabler.disable(self) do > info = Wx::BusyInfo.busy('Please wait...', self) do > Wx::log_message("Getting file #{file_obj.name}") > file_obj.fetch # uses open-uri to get a large binary > end > end > ... > end > end > There needs to be a Thread.pass in whatever your fetch method on file_obj runs, if your downloading a file, then you need to use Async Sockets, and utilize IO.select() to detect activity on a socket, if no activity, do a Thread.pass, if there is activity, read it, then do a Thread.pass. It has to work between the Main thread, which handles the Ruby events, and the wxWidgets thread, which handles the GUI events internally. hth, Mario > -- > 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 shs at demosophia.net Thu Nov 5 21:29:43 2009 From: shs at demosophia.net (Svend Haugaard =?UTF-8?B?U8O4cmVuc2Vu?=) Date: Fri, 6 Nov 2009 03:29:43 +0100 Subject: [wxruby-users] DatePickerCtrl uninitialized constant Message-ID: <20091106032943.16d91c5d@cybert.demosophia.net> I trying to make a Dialog that include a DatePickerCtrl on my gentoo linux box. I get the following error /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in `const_missing': uninitialized constant PortfolioDialog::DatePickerCtrl (NameError) My application use ActiveRecord, thats why the error is from activesupport. gem list says wxruby (1.9.9, 1.9.8) Should DatePickerCtrl work in this version? From mario at ruby-im.net Fri Nov 6 02:40:47 2009 From: mario at ruby-im.net (Mario Steele) Date: Fri, 6 Nov 2009 02:40:47 -0500 Subject: [wxruby-users] DatePickerCtrl uninitialized constant In-Reply-To: <20091106032943.16d91c5d@cybert.demosophia.net> References: <20091106032943.16d91c5d@cybert.demosophia.net> Message-ID: Hello Svend, 2009/11/5 Svend Haugaard S?rensen > I trying to make a Dialog that include a DatePickerCtrl on my gentoo > linux box. > > I get the following error > > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in > `const_missing': uninitialized constant PortfolioDialog::DatePickerCtrl > (NameError) > > My application use ActiveRecord, thats why the error is from > activesupport. > > gem list says > wxruby (1.9.9, 1.9.8) > 1.9.8 and 1.9.9 are old versions, you should use 2.0.1, as it is the newest, however the wxDatePickerCtrl is in 1.9.9 and 1.9.8. The problem is, is that ActiveSupport is trying to check for a Constant, that does not exist. You need to use Wx::DatePickerCtrl in order to make it work, unless you include Wx in PortfolioDialog class. EG: class PortfolioDialog < Wx::Dialog def initialize super @dpc = Wx::DatePickerCtrl.new end end Or: class PortfolioDialog < Wx::Dialog include Wx def initialize super @dpc = DatePickerCtrl.new end end Or module Wx class PortfolioDialog < Dialog def initialize super @dpc = DatePickerCtrl.new end end end The last method I would not use, as that pollutes the Wx namespace. But the point being, that when you subclass from a wxRuby class, it does not automatically inherit the Wx namespace. You need to either explicitly define it, include it, or define your class under the Wx namespace, in order to avoid having to use the Wx namespace in pre-pending of class definitions. hth, Mario > Should DatePickerCtrl work in this version? > > _______________________________________________ > 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 shs at demosophia.net Fri Nov 6 05:07:12 2009 From: shs at demosophia.net (Svend Haugaard =?UTF-8?B?U8O4cmVuc2Vu?=) Date: Fri, 6 Nov 2009 11:07:12 +0100 Subject: [wxruby-users] DatePickerCtrl uninitialized constant In-Reply-To: References: <20091106032943.16d91c5d@cybert.demosophia.net> Message-ID: <20091106110712.2b460a54@cybert.demosophia.net> On Fri, 6 Nov 2009 02:40:47 -0500 Mario Steele wrote: > Hello Svend, > > 2009/11/5 Svend Haugaard S?rensen > > > I trying to make a Dialog that include a DatePickerCtrl on my gentoo > > linux box. > > > > I get the following error > > > > /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in > > `const_missing': uninitialized constant > > PortfolioDialog::DatePickerCtrl (NameError) > > > > My application use ActiveRecord, thats why the error is from > > activesupport. > > > > gem list says > > wxruby (1.9.9, 1.9.8) > > > > 1.9.8 and 1.9.9 are old versions, you should use 2.0.1, as it is the > newest, however the wxDatePickerCtrl is in 1.9.9 and 1.9.8. The > problem is, is that ActiveSupport is trying to check for a Constant, > that does not exist. You need to use Wx::DatePickerCtrl in order to > make it work, unless you include Wx in PortfolioDialog class. > I have have a 'include Wx' just after 'require "wx"' in my program. If I use @buy_date=Wx::DatePickerCtrl.new(self,-1) the error change to /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:263:in `load_missing_constant': uninitialized constant Wxruby2::DatePickerCtrl (NameError) I tried to make a 'gem update wxruby' and that installed the 1.9.9 version. And it didn't remove the error. From lists at ruby-forum.com Fri Nov 6 06:27:41 2009 From: lists at ruby-forum.com (Walter Walter) Date: Fri, 6 Nov 2009 12:27:41 +0100 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> <8c4086dba544d548bac2bd70c78b2f8d@ruby-forum.com> Message-ID: Steve cd wrote: > Ran into this today on Ubuntu 9.10, ruby 1.8.7. Not having much success > finding solutions. > > /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: > /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: > symbol _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not > defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference - > /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so > (LoadError) I had a similar problem. I has installed libwxgtk2.8-dbg and wx2.8-headers. Nowadays all work successfully. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Nov 8 20:12:31 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Mon, 9 Nov 2009 02:12:31 +0100 Subject: [wxruby-users] Wx::Gauge failed to set foreground colour using XP Style Message-ID: <20809342c29c5a1f58d4d1d78c4c5c4d@ruby-forum.com> My application has a Wx::Gauge, its colour is changeable via set_foreground_colour method. After I updated the ruby.exe.manifest to use XP Styles, (http://rubyonwindows.blogspot.com/2007/10/windows-xp-visual-style-controls-with.html), the gauge's foreground stays Green always without code changes. I think this might not be anything to do with WxRuby or WxWidget, but wondering whether any tricks there to enable changing Gauge colours with XP styles. Thanks, Zhimin -- Posted via http://www.ruby-forum.com/. From axel.friedrich at siemens.com Mon Nov 9 02:57:29 2009 From: axel.friedrich at siemens.com (Friedrich, Axel) Date: Mon, 9 Nov 2009 08:57:29 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: References: Message-ID: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> Hello Dirk, did you get wxruby installed on opensuse 11.2? Axel > i tried too install wxruby-2.0.1 on opensuse 11.2 from the > rake command From mario at ruby-im.net Mon Nov 9 05:14:27 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 9 Nov 2009 05:14:27 -0500 Subject: [wxruby-users] Wx::Gauge failed to set foreground colour using XP Style In-Reply-To: <20809342c29c5a1f58d4d1d78c4c5c4d@ruby-forum.com> References: <20809342c29c5a1f58d4d1d78c4c5c4d@ruby-forum.com> Message-ID: On Mac OS X, and Windows XP, when native styles are used (EG: Windows XP using Win 95/98 styles, and not XP Styles), it is impossible to change the color of the Progress Bar, or some other controls. As you thought, this isn't a wxRuby or wxWidgets failing, but the native OS' inflexibility to allow changes to certain controls. The only other suggestion that I can make, is to create your own custom control, and use bitmaps, or what have ya to custom draw the progress bar you want. Take a look at some HTML/CSS/JavaScript Examples of Progress Bars, to get an idea of how you can start with creating your own custom Progress Bar. hth, Mario On Sun, Nov 8, 2009 at 8:12 PM, Zhimin Zhan wrote: > > My application has a Wx::Gauge, its colour is changeable via > set_foreground_colour method. > > After I updated the ruby.exe.manifest to use XP Styles, > ( > http://rubyonwindows.blogspot.com/2007/10/windows-xp-visual-style-controls-with.html > ), > the gauge's foreground stays Green always without code changes. > > I think this might not be anything to do with WxRuby or WxWidget, but > wondering whether any tricks there to enable changing Gauge colours with > XP styles. > > Thanks, > Zhimin > -- > 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 lists at ruby-forum.com Mon Nov 9 07:39:03 2009 From: lists at ruby-forum.com (Dirk Herzhauser) Date: Mon, 9 Nov 2009 13:39:03 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> Hi Axel, thx for you support, but unfortunatly it dosen#t work.In the meantime I started from scratch, and compiled wxWidgets 2.8-10 and wxruby again from source. for wxWidget I use the following con./configure --disable-shared --with-gtk --enable-monolithic --enable-unicode --disable-debug --enable-catch_segvs --enable-graphics_ctx--enable-mediactrl --with-opengl --with-libjpeg=builtin --with-libpng=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin --enable-gui --enable-xrc --enable-mdi --enable-gif --enable-pcx --enable-iff --enable-pnm --enable-xpm --without-libmspack figure: If I now run a simple test program i get a segmentation fault: usr/lib/ruby/site_ruby/1.8/i586-linux/wxruby2.so: [BUG] Segmentation fault ruby 1.8.7 (2008-08-11 patchlevel 72) [i586-linux] Abgebrochen the ruby program looks like: # # encoding: UTF-8 require 'rubygems' require 'wx' include Wx class MyFrane < App def on_init Frame.new(nil,-1,"yoyo").show() end end So any help is appreciated Dirk -- Posted via http://www.ruby-forum.com/. From axel.friedrich at siemens.com Mon Nov 9 08:08:47 2009 From: axel.friedrich at siemens.com (Friedrich, Axel) Date: Mon, 9 Nov 2009 14:08:47 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> Message-ID: <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> Hello Dirk, > thx for you support, but unfortunately it doesn't work. My apologizes, but I can't give you help. Myself, I have problems, too, installing wxruby on openSUSE (11.1). If you would have said, that you have got it running, I would have asked you, how you did it ;) . I installed wxRuby on Windows (that was _very_ easy) and did run your code (I added two lines...) require 'rubygems' require 'wx' include Wx class MyFrane < App def on_init Frame.new(nil,-1,"yoyo").show() end end myApp = MyFrane.new() # Fran/me ? myApp.main_loop() That run fine on Windows. BTW, my native language is German... Viele Gruesse, Axel From lists at ruby-forum.com Mon Nov 9 09:20:42 2009 From: lists at ruby-forum.com (Dirk Herzhauser) Date: Mon, 9 Nov 2009 15:20:42 +0100 Subject: [wxruby-users] =?utf-8?q?installing_wxruby_2=2E0=2E1=2E_missing?= =?utf-8?q?=09lwx=5Fgtk2u=5Fmedia-2=2E8?= In-Reply-To: <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: Hi Alex, auch mit den 2 Zeilen zus?tlich hab ich das gleiche Problem > myApp = MyFrane.new() # Fran/me ? > myApp.main_loop() Unter Windows hab ich es noch nicht getestet Gr?ssle Dirk -- Posted via http://www.ruby-forum.com/. From axel.friedrich at siemens.com Mon Nov 9 09:45:26 2009 From: axel.friedrich at siemens.com (Friedrich, Axel) Date: Mon, 9 Nov 2009 15:45:26 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> Hallo Dirk, for you are getting "segfault"-error, I think, the reason is _not_ in your ruby script. And I think you realy need these additional two lines (but I'm wxruby beginner...). If you want to answer in German, maybe it is better that you write directly to my email address. Viele Gruesse, Axel From lists at ruby-forum.com Mon Nov 9 10:03:47 2009 From: lists at ruby-forum.com (Dirk Herzhauser) Date: Mon, 9 Nov 2009 16:03:47 +0100 Subject: [wxruby-users] =?utf-8?q?installing_wxruby_2=2E0=2E1=2E_missing?= =?utf-8?q?=09lwx=5Fgtk2u=5Fmedia-2=2E8?= In-Reply-To: <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: Friedrich, Axel wrote: > Hallo Dirk, > > for you are getting "segfault"-error, I think, the reason is _not_ in > your ruby script. > > And I think you realy need these additional two lines (but I'm wxruby > beginner...). > > If you want to answer in German, maybe it is better that you write > directly to my email address. > > Viele Gruesse, > Axel Hi Alex, I agree with you that the script should not the reason, to be honest I copied this script from some webpage for testing purpose. I found via Internet some reports about random segmentation faults but no solution yet.I experience always this segmentation fault regardless what I do, with the original libs supplied with opensuse (11.2) I got only some missing libs errors, so compiling wxWidgets was a must. I had several problems with gtk stuff in this new Version so let's see if there is a solution is available. The language at least for my understanding doesn't matter if its English or German. -- Posted via http://www.ruby-forum.com/. From axel.friedrich at siemens.com Mon Nov 9 10:48:12 2009 From: axel.friedrich at siemens.com (Friedrich, Axel) Date: Mon, 9 Nov 2009 16:48:12 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> > I got > only some missing libs errors, so compiling wxWidgets was a must. After compiling wxWidgets, did you compile wxRuby? If so, were you able to run "rake" in the wxRuby-Source-dir without errors? That's where I stuck. -Axel From lists at ruby-forum.com Mon Nov 9 17:09:53 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Mon, 9 Nov 2009 23:09:53 +0100 Subject: [wxruby-users] Wx::Gauge failed to set foreground colour using XP Style In-Reply-To: References: <20809342c29c5a1f58d4d1d78c4c5c4d@ruby-forum.com> Message-ID: <14064f546c5e8b15b5659804115dbc74@ruby-forum.com> Mario, Thanks for your explanation and suggestion! Regards, Zhimin -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Nov 10 08:21:29 2009 From: lists at ruby-forum.com (Dirk Herzhauser) Date: Tue, 10 Nov 2009 14:21:29 +0100 Subject: [wxruby-users] =?utf-8?q?installing_wxruby_2=2E0=2E1=2E_missing?= =?utf-8?q?=09lwx=5Fgtk2u=5Fmedia-2=2E8?= In-Reply-To: <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> Friedrich, Axel wrote: >> I got >> only some missing libs errors, so compiling wxWidgets was a must. > > After compiling wxWidgets, did you compile wxRuby? > If so, were you able to run "rake" in the wxRuby-Source-dir without > errors? > That's where I stuck. > > -Axel Hi Axel, the wxRUby build woked after wxWidgets irk at linuxe:~/wxruby-2.0.1> rake (in /home/dirk/wxruby-2.0.1) Enabling STATIC build Enabling RELEASE build Enabling UNICODE build The following wxWidgets features are not available and will be skipped: GCDC GraphicsBrush GraphicsContext GraphicsFont GraphicsMatrix GraphicsObject GraphicsPath GraphicsPen MediaCtrl MediaEvent PrinterDC StyledTextCtrl StyledTextEvent dirk at linuxe:~/wxruby-2.0.1> Dirk -- Posted via http://www.ruby-forum.com/. From anthony.metcalf at anferny.me.uk Tue Nov 10 08:36:18 2009 From: anthony.metcalf at anferny.me.uk (Anthony Metcalf) Date: Tue, 10 Nov 2009 13:36:18 +0000 Subject: [wxruby-users] wxRuby - tabular data with extra widgets Message-ID: <4AF96C52.9090700@anferny.me.uk> Hi, I sent this to the ruby-talk list, but didn't get any response, so I'm trying again here. Hopefully it's more appropriate! I am needing to display a table of data. I need to be able to sort the columns by clicking the label at the top (ideally such that one click sorts ascending, the next descending etc etc) I need grid lines. I need to be able to include drop down lists in multiple columns, such that selecting the drop down will change columns in the same row. This data is backed by active record, and I have active support etc available. My first thought was to use Wx::Grid, but I don't have the first idea how to go about getting a drop down into a column. My second thought is to use a grid sizer of some sort, but that would mean creating my own buttons for the column headers, doing something to get a grid etc etc. What other options to I have? Or how do I go about 1)? All pointers appreciated! Current source is at http://codaset.com/nevynxxx/wxrcg/source/master/blob/lib/views/dm_screen_frame.rb Regards Anthony -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: From axel.friedrich at siemens.com Tue Nov 10 11:54:49 2009 From: axel.friedrich at siemens.com (Friedrich, Axel) Date: Tue, 10 Nov 2009 17:54:49 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> Message-ID: <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> Hallo Dirk, I wonder, why at your side rake run without error, while on my side rake aborts with error. I don't think, that it's a difference between openSuse 11.1 and 11.2. Comparing your compile-options for wxWidgets with mine, You gave the following: > for wxWidget I use the following con./configure --disable-shared > --with-gtk --enable-monolithic --enable-unicode --disable-debug > --enable-catch_segvs --enable-graphics_ctx--enable-mediactrl > --with-opengl --with-libjpeg=builtin --with-libpng=builtin > --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin > --enable-gui --enable-xrc --enable-mdi --enable-gif --enable-pcx > --enable-iff --enable-pnm --enable-xpm --without-libmspack Did you realy use "--enable-graphics_ctx" and "--enable-mediactrl" _without_ a blank in between? I used the same options, but not " --without-libmspack". If I've enough time tomorrow, I'll try it with this option. -Axel From alex at pressure.to Tue Nov 10 12:23:20 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 10 Nov 2009 17:23:20 +0000 Subject: [wxruby-users] wxRuby - tabular data with extra widgets In-Reply-To: <4AF96C52.9090700@anferny.me.uk> References: <4AF96C52.9090700@anferny.me.uk> Message-ID: <4AF9A188.40409@pressure.to> Anthony Metcalf wrote: > I sent this to the ruby-talk list, but didn't get any response, so > I'm trying again here. Hopefully it's more appropriate! > Welcome - it certainly is appropriate here. > I am needing to display a table of data. > I need to be able to sort the columns by clicking the label at the > top (ideally such that one click sorts ascending, the next descending > etc etc) > I need grid lines. > I need to be able to include drop down lists in multiple columns, > such that selecting the drop down will change columns in the same row. > > This data is backed by active record, and I have active support etc > available. > > My first thought was to use Wx::Grid, but I don't have the first > idea how to go about getting a drop down into a column. It sounds like Wx::Grid is definitely the one you want to use. To put drop-downs in cells, use Wx::GridCellChoiceEditor. GridCellEditors change the interface that is used to edit the contents of a Grid cell. You can also use and define custom renderers for the non-editing display of a cell, either by using one of the predefined subclasses of GridCellRenderer, or by defining your own completely custom presentation. There are event hooks for a wide variety of things including cell value changes. If the data source for the grid is an RDBMS possibly via an ORM like ActiveRecord, you can also use GridTableBase to make the link between the model and the GUI view neat to program. Take a look at the samples supplied with wxruby; in the folder 'grid' you should find all of the above exemplified. And please feel free to come back for further help - the Grid is a powerful but also pretty complex class. cheers alex From anthony.metcalf at anferny.me.uk Tue Nov 10 16:33:01 2009 From: anthony.metcalf at anferny.me.uk (Anthony Metcalf) Date: Tue, 10 Nov 2009 21:33:01 +0000 Subject: [wxruby-users] wxRuby - tabular data with extra widgets In-Reply-To: <4AF9A188.40409@pressure.to> References: <4AF96C52.9090700@anferny.me.uk> <4AF9A188.40409@pressure.to> Message-ID: <4AF9DC0D.4090701@anferny.me.uk> Alex Fenton wrote: > > It sounds like Wx::Grid is definitely the one you want to use. > > To put drop-downs in cells, use Wx::GridCellChoiceEditor. > GridCellEditors change the interface that is used to edit the contents > of a Grid cell. You can also use and define custom renderers for the > non-editing display of a cell, either by using one of the predefined > subclasses of GridCellRenderer, or by defining your own completely > custom presentation. > Cool, I'll have a look into that.... > There are event hooks for a wide variety of things including cell > value changes. > > If the data source for the grid is an RDBMS possibly via an ORM like > ActiveRecord, you can also use GridTableBase to make the link between > the model and the GUI view neat to program. > It is indeed, so I'll have a look at this too.... > Take a look at the samples supplied with wxruby; in the folder 'grid' > you should find all of the above exemplified. And please feel free to > come back for further help - the Grid is a powerful but also pretty > complex class. > > cheers > alex Thanks Alex, much appreciated. I'm sure I'll be back :) Anthony -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: From antti.hakala at gmail.com Wed Nov 11 08:52:25 2009 From: antti.hakala at gmail.com (Antti Hakala) Date: Wed, 11 Nov 2009 15:52:25 +0200 Subject: [wxruby-users] static gem of wxruby 2.0.1 for OS X Snow Leopard Message-ID: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> Hello, I have a static gem of wxruby 2.0.1 that works on OS X Snow Leopard, if somebody is interested. I've tried it only on my own comp. It's about 9MB. -- Antti Hakala From lists at ruby-forum.com Fri Nov 13 00:11:11 2009 From: lists at ruby-forum.com (Michael Daly) Date: Fri, 13 Nov 2009 06:11:11 +0100 Subject: [wxruby-users] static gem of wxruby 2.0.1 for OS X Snow Leopard In-Reply-To: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> References: <80d893c70911110552ye2c5e1ald5cec7b270ebd4b3@mail.gmail.com> Message-ID: <3ceb005adf3c5e5446b62277846062db@ruby-forum.com> Antti Hakala wrote: > Hello, > I have a static gem of wxruby 2.0.1 that works on OS X Snow Leopard, > if somebody is interested. > I've tried it only on my own comp. It's about 9MB. I would be forever in your debt if you could send that my way. youdonotexist AT gmail.com Thanks! Mike -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Nov 15 05:17:32 2009 From: lists at ruby-forum.com (Dirk Herzhauser) Date: Sun, 15 Nov 2009 11:17:32 +0100 Subject: [wxruby-users] =?utf-8?q?installing_wxruby_2=2E0=2E1=2E_missing?= =?utf-8?q?=09lwx=5Fgtk2u=5Fmedia-2=2E8?= In-Reply-To: <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: <675edc49aa73bd3ed0684e1eb96b9c00@ruby-forum.com> Hi Axel, any progress ? In the meantime I compiled ruby 1.9 and now I get several problem: (in /home/dirk/wxruby-2.0.1) Enabling STATIC build Enabling RELEASE build Enabling UNICODE build The following wxWidgets features are not available and will be skipped: GCDC GraphicsBrush GraphicsContext GraphicsFont GraphicsMatrix GraphicsObject GraphicsPath GraphicsPen MediaCtrl MediaEvent PrinterDC StyledTextCtrl StyledTextEvent dirk at linuxe:~/wxruby-2.0.1> rake (in /home/dirk/wxruby-2.0.1) Enabling STATIC build Enabling RELEASE build Enabling UNICODE build The following wxWidgets features are not available and will be skipped: GCDC GraphicsBrush GraphicsContext GraphicsFont GraphicsMatrix GraphicsObject GraphicsPath GraphicsPen MediaCtrl MediaEvent PrinterDC StyledTextCtrl StyledTextEvent g++ -c -I/usr/local/lib/wx/include/gtk2-unicode-release-static-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -DwxABI_VERSION=208010 -O2 -g -Wall -Wno-parentheses -Wno-unused-function -I. -I /usr/local/include/ruby-1.9.1 -I /usr/local/include/ruby-1.9.1/site_ruby -I /usr/local/include/ruby-1.9.1/vendor_ruby -I /usr/local/include/ruby-1.9.1/i686-linux -o obj/AboutDialogInfo.o src/AboutDialogInfo.cpp src/AboutDialogInfo.cpp:1788:20: error: rubyio.h: Datei oder Verzeichnis nicht gefunden src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetName(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:1898: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:1898: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetVersion(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:1971: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:1971: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetDescription(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2044: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2044: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetCopyright(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2117: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2117: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetLicence(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2215: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2215: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetWebSiteURL(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2375: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2375: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetWebSiteDescription(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2399: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2399: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetDevelopers(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2520: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2520: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetDocWriters(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2643: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2643: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetArtists(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2766: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2766: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetTranslators(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2889: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2889: error: ?rb_enc_str_new? was not declared in this scope rake aborted! Command failed with status (1): [g++ -c -I/usr/local/lib/wx/include/gtk2-...] -- Posted via http://www.ruby-forum.com/. From plusgforce at gmail.com Sun Nov 15 17:46:55 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Sun, 15 Nov 2009 16:46:55 -0600 Subject: [wxruby-users] wxruby Installation woes on Ubuntu 9.10 Message-ID: <536e2d6f0911151446v2fe36d0cw2c268f99c81ee96@mail.gmail.com> I have been having problems installing wxRuby and having it work on Ubuntu 9.10. To reproduce the problem I followed the following steps: 1 Backed up Ubuntu system 2 Installed Ubuntu 9.10 3 setup an internet connection 4 opened update manager 5 opened up a terminal: 6 sudo apt-get install ruby 7 sudo apt-get install rubygems 8 sudo apt-get install libwxgtk2.8-0 9 sudo apt-gets install libwxgtk2.8-dev 10 sudo gem install wxruby 11 ruby EyesApp.rb from EyesApp.rb begin require 'rubygems' rescue LoadError end require 'wx' Note: EyesApp.rb was working before upgrading to Ubuntu karmic (9.10) /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: symbol _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference - /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so (LoadError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' from /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx.rb:12 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require' from EyesApp.rb:5 wx-config --version 2.8.10 I've tried to compile wxRuby from scratch but no luck. What do I need to do? Philip -------------- next part -------------- An HTML attachment was scrubbed... URL: From axel.friedrich at siemens.com Mon Nov 16 03:25:01 2009 From: axel.friedrich at siemens.com (Friedrich, Axel) Date: Mon, 16 Nov 2009 09:25:01 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: <675edc49aa73bd3ed0684e1eb96b9c00@ruby-forum.com> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> <675edc49aa73bd3ed0684e1eb96b9c00@ruby-forum.com> Message-ID: <1BDD6C6D3250C54CA91DD9348C23774F06E164CE@DEFTHW99EA4MSX.ww902.siemens.net> Hi Dirk, hmm, I compiled wxWidgets exactly with the configure-options you gave. No problem. But running rake gave me the same error message as before: ruby swig/fixmodule.rb src/dc.cpp Class: dc class wxdc ERROR! swig/fixmodule.rb Didn't find init rake aborted! Command failed with status (1): [ruby swig/fixmodule.rb src/dc.cpp...] Which version of wxWidgets-Source did you use? I used wxWidgets 2.8.10, the "wxAll"-version, from http://prdownloads.sourceforge.net/wxwindows/ I didn't try Ruby 1.9. I was thinking about using 1.9, because of the better threads support of 1.9, but that's another story... Do you know, that there is a special Ruby-1.9-version of wxRuby? http://rubyforge.org/frs/?group_id=35 wxruby-ruby19-2.0.1... I'm still using: * ruby 1.8.7 (2008-08-11 patchlevel 72) [i586-linux] * wxruby: wxruby-2.0.1.tar.gz from rubyforge.org * openSuse 11.1 Axel From lists at ruby-forum.com Mon Nov 16 03:50:43 2009 From: lists at ruby-forum.com (Dirk Herzhauser) Date: Mon, 16 Nov 2009 09:50:43 +0100 Subject: [wxruby-users] =?utf-8?q?installing_wxruby_2=2E0=2E1=2E_missing?= =?utf-8?q?=09lwx=5Fgtk2u=5Fmedia-2=2E8?= In-Reply-To: <1BDD6C6D3250C54CA91DD9348C23774F06E164CE@DEFTHW99EA4MSX.ww902.siemens.net> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> <675edc49aa73bd3ed0684e1eb96b9c00@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06E164CE@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: Hi Alex, I use wxWidget 2.8.10.1.1 ON OPENsUSE 11.2 dIRK -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Tue Nov 17 13:41:53 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Tue, 17 Nov 2009 19:41:53 +0100 Subject: [wxruby-users] wxruby Installation woes on Ubuntu 9.10 In-Reply-To: <536e2d6f0911151446v2fe36d0cw2c268f99c81ee96@mail.gmail.com> References: <536e2d6f0911151446v2fe36d0cw2c268f99c81ee96@mail.gmail.com> Message-ID: Hi Philip, 2009/11/15 Philip Stephens : > I have been having problems installing wxRuby and having it work on > Ubuntu 9.10. To reproduce the problem I followed the following steps: > > 6 sudo apt-get install ruby > 7 sudo apt-get install rubygems > 8 sudo apt-get install libwxgtk2.8-0 > 9 sudo apt-gets install libwxgtk2.8-dev > 10 sudo gem install wxruby > /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: > /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: symbol > _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not defined in file > libwx_gtk2u_aui-2.8.so.0 with link time reference - The wxruby Linux gem has been built with/for Ubuntu 9.04. A different C++ compiler version is shipped with Ubuntu 9.10 (g++ 4.4.1). So the gem is not compatible with Ubuntu 9.10. We may provide a Ubuntu-9.10 binary gem in the future but in the meantime you have to build wxRuby yourself. > I've tried to compile wxRuby from scratch but no luck.? What do I need to > do? I've added detailed steps to do that in the Wiki : http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages Cheers. Chauk-Mean. From chauk.mean at gmail.com Tue Nov 17 13:59:35 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Tue, 17 Nov 2009 19:59:35 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: Hi Axel, 2009/11/10 Friedrich, Axel : > I wonder, why at your side rake run without error, while on my side rake aborts with error. > I don't think, that it's a difference between openSuse 11.1 and 11.2. > Well, I don't use openSuse but for Ubuntu, 9.10 is really different from 9.04. The C++ compiler has changed (now g++ 4.4.1). With Ubuntu 9.04, I've been able to build myself wxWidgets-2.8.10. With Ubuntu 9.10, this was unsuccessful so I'm using the "official" wxWidgets package provided with Ubuntu. I've added the detailed steps for building wxRuby on Ubuntu-9.10 on the Wiki (http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages). May be this can help. Cheers. Chauk-Mean. From plusgforce at gmail.com Wed Nov 18 01:10:14 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Wed, 18 Nov 2009 00:10:14 -0600 Subject: [wxruby-users] WxRuby installation solution for Ubuntu 9.10 Message-ID: <536e2d6f0911172210k45fc2c7t438fd636c67a825d@mail.gmail.com> Hi Chauk-Mean Proum The wxruby Linux gem has been built with/for Ubuntu 9.04. A different C++ compiler version is shipped with Ubuntu 9.10 (g++ 4.4.1). So the gem is not compatible with Ubuntu 9.10. We may provide a Ubuntu-9.10 binary gem in the future but in the meantime you have to build wxRuby yourself. > I've tried to compile wxRuby from scratch but no luck.? What do I need to > do? I've added detailed steps to do that in the Wiki : http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages =============================================================================== Thank you for your assistance. However I still failed to get wxruby working after I followed your instructions. Below is a partial listing of my attempt to get wxruby working. xxx:~$ g++ --version g++ (Ubuntu 4.4.1-4ubuntu8) 4.4.1 xxx:~/Downloads$ ls ruby-1.9.1-p243 swig-1.3.38 wxruby-2.0.1 xxx:~/Downloads$ xxx:~/Downloads/wxruby-2.0.1$ ls art INSTALL obj README swig ChangeLog lib rake samples tests doc LICENSE rakefile src wxruby-ruby19-2.0.1-x86-linux.gem xxx:~/Downloads/wxruby-2.0.1$ xxx:~/Downloads/wxruby-2.0.1$ sudo gem install wxruby-ruby19-2.0.1-x86-linux.gem [sudo] password for philip: Successfully installed wxruby-ruby19-2.0.1-x86-linux 1 gem installed Installing ri documentation for wxruby-ruby19-2.0.1-x86-linux... Updating class cache with 68 classes... Installing RDoc documentation for wxruby-ruby19-2.0.1-x86-linux... xxx:~/Downloads/wxruby-2.0.1$ xxx:~/Desktop/Eyes$ cat wxminimal.rb #!/usr/bin/env ruby require 'rubygems' require 'wx' class MyApp < Wx::App def on_init @frame = Wx::Frame.new(nil -1, "Application" ) @frame.show end end app = MyApp.new app.main_loop xxx:~/Desktop/Eyes$ ruby wxminimal.rb wxminimal.rb:3:in `require': no such file to load -- wx (LoadError) from wxminimal.rb:3:in `
' xxx:~/Desktop/Eyes$ ruby --version ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-linux] At one time, sudo gem install failed when I tried to install the gem file but succeeded when I didn't use sudo. So I installed rubygems 1.9.1 and then the sudo install gem -l .... command worked. However when I tried the minimal test program shown above I get the shown error message. Another thing I should mention for people who start from a clean system is after you edit the .bashrc file you should close the terminal and re-open it to allow the path variables to take effect. I hope you can help me. What other info do you require? Philip -------------- next part -------------- An HTML attachment was scrubbed... URL: From chauk.mean at gmail.com Wed Nov 18 02:32:46 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Wed, 18 Nov 2009 08:32:46 +0100 Subject: [wxruby-users] WxRuby installation solution for Ubuntu 9.10 In-Reply-To: <536e2d6f0911172210k45fc2c7t438fd636c67a825d@mail.gmail.com> References: <536e2d6f0911172210k45fc2c7t438fd636c67a825d@mail.gmail.com> Message-ID: Hi Philip, 2009/11/18 Philip Stephens : > > Thank you for your assistance. However I still failed to get wxruby working > after I followed your instructions. I forgot to indicate a little step : add the following line to your .bashrc (replace the path with your home directory) export GEM_HOME=/home/your_home/gems This will allow the installation of rubygems somewhere in your home directory thus without requiring a sudo. > xxx:~/Downloads/wxruby-2.0.1$ sudo gem install > wxruby-ruby19-2.0.1-x86-linux.gem > Be sure to add -l to the gem command to install the local gem. Otherwise gem will install the version from rubyforge which is not the good one. Also, when you do a sudo command, the environment changes so you probably use the gem command shipped with Ubuntu and not the one you built yourself (the one that is in /opt/bin). > [sudo] password for philip: > Successfully installed wxruby-ruby19-2.0.1-x86-linux > 1 gem installed > Installing ri documentation for wxruby-ruby19-2.0.1-x86-linux... > Updating class cache with 68 classes... > Installing RDoc documentation for wxruby-ruby19-2.0.1-x86-linux... The wrong wxRuby gem has been installed for the wrong ruby/gem :-) With the GEM_HOME env parameter above set, just do the following command in your wxruby source directory : gem install -l wxruby-ruby19 Afterwards, some final checks : type gem # => /opt/bin/gem type ruby # => /opt/bin/ruby gem list # => should list wxruby-ruby19 Then you should be able to run the samples. Cheers. Chauk-Mean. From bureaux.sebastien at neuf.fr Wed Nov 18 02:34:12 2009 From: bureaux.sebastien at neuf.fr (Seb) Date: Wed, 18 Nov 2009 08:34:12 +0100 Subject: [wxruby-users] position de la scrollbar Message-ID: Bonjour. Quand j'ouvre mon application et que mon arbre(treectrl) est compl?tement d?velopper, la scrollbar se positionne en bas. Je voudrais savoir si il est possible que la scrollbar soit positionn?e en haut quand l'arbre est compl?tement d?velopper ? l'ouverture de mon application. merci S?bastien http://beusse.alwaysdata.net/ -------------- section suivante -------------- Une pi?ce jointe HTML a ?t? nettoy?e... URL: From lists at ruby-forum.com Wed Nov 18 12:48:40 2009 From: lists at ruby-forum.com (Dirk Herzhauser) Date: Wed, 18 Nov 2009 18:48:40 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> Message-ID: <659b49af56e5912c4bf5f8e559364465@ruby-forum.com> Hi Chauk-Mean thx for your suggestion I followed them as far as possible but unfortunately I got some problems: dirk at linuxe:~/wxruby-2.0.1> rake WXRUBY_VERSION=2.0.1 (in /home/dirk/wxruby-2.0.1) Enabling STATIC build Enabling RELEASE build Enabling UNICODE build The following wxWidgets features are not available and will be skipped: GCDC GraphicsBrush GraphicsContext GraphicsFont GraphicsMatrix GraphicsObject GraphicsPath GraphicsPen MediaCtrl MediaEvent PrinterDC StyledTextCtrl StyledTextEvent g++ -c -I/usr/local/lib/wx/include/gtk2-unicode-release-static-2.8 -I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -DwxABI_VERSION=208010 -O2 -g -Wall -Wno-parentheses -Wno-unused-function -I. -I /usr/local/include/ruby-1.9.1 -I /usr/local/include/ruby-1.9.1/site_ruby -I /usr/local/include/ruby-1.9.1/vendor_ruby -I /usr/local/include/ruby-1.9.1/i686-linux -o obj/AboutDialogInfo.o src/AboutDialogInfo.cpp src/AboutDialogInfo.cpp:1788:20: error: rubyio.h: Datei oder Verzeichnis nicht gefunden src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetName(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:1898: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:1898: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetVersion(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:1971: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:1971: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetDescription(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2044: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2044: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetCopyright(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2117: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2117: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetLicence(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2215: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2215: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetWebSiteURL(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2375: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2375: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetWebSiteDescription(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2399: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2399: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetDevelopers(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2520: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2520: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetDocWriters(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2643: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2643: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetArtists(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2766: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2766: error: ?rb_enc_str_new? was not declared in this scope src/AboutDialogInfo.cpp: In function ?VALUE _wrap_wxAboutDialogInfo_GetTranslators(int, VALUE*, VALUE)?: src/AboutDialogInfo.cpp:2889: error: ?rb_utf8_encoding? was not declared in this scope src/AboutDialogInfo.cpp:2889: error: ?rb_enc_str_new? was not declared in this scope rake aborted! Command failed with status (1): [g++ -c -I/usr/local/lib/wx/include/gtk2-...] (See full trace by running task with --trace) -- Posted via http://www.ruby-forum.com/. From plusgforce at gmail.com Wed Nov 18 13:04:08 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Wed, 18 Nov 2009 12:04:08 -0600 Subject: [wxruby-users] WxRuby installation for Ubuntu 9.10 Message-ID: <536e2d6f0911181004s3ff98868uaea6f6ce3b2683c@mail.gmail.com> 2009/11/18 Philip Stephens : > > Thank you for your assistance. However I still failed to get wxruby working > after I followed your instructions. I forgot to indicate a little step : add the following line to your .bashrc (replace the path with your home directory) export GEM_HOME=/home/your_home/gems ========================== Thanks. WxRuby now works on my system! [?] I added the last line you gave me to the wiki http://wxruby.rubyforge.org/wiki/wiki.pl?back=BuildingOnTopOfLinuxDistroPackages -Philip -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 96 bytes Desc: not available URL: From plusgforce at gmail.com Wed Nov 18 23:08:59 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Wed, 18 Nov 2009 22:08:59 -0600 Subject: [wxruby-users] nokogiri xml parser challenges Message-ID: <536e2d6f0911182008x614b5bc7o4d597bbe9fb7de27@mail.gmail.com> Hi. Could someone please help me with getting the nokogiri parser working? Just ask me if you need more information. Thanks. nokogiri installation challenges -------------------------------- xxx:~$ gem list *** LOCAL GEMS *** mkrf (0.2.3) rake (0.8.7) wx_sugar (0.1.22) wxruby-ruby19 (2.0.1) xxx:~$ sudo gem install nokogiri Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb extconf.rb:5:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:5:in `
' Gem files will remain installed in /var/lib/gems/1.9.1/gems/nokogiri-1.4.0 for inspection. Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.4.0/ext/nokogiri/gem_make.out xxx:~$ cat /var/lib/gems/1.9.1/gems/nokogiri-1.4.0/ext/nokogiri/gem_make.out /usr/bin/ruby1.9.1 extconf.rb extconf.rb:5:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:5:in `
' ================================================================= xxx:~$ TestNok.rb TestNok.rb:2:in `require': no such file to load -- nokogiri (LoadError) from TestNok.rb:2:in `
' ================================================================== TestNok.rb file: require 'rubygems' require 'nokogiri' class Score_Data ...etc >From synaptic package manager ============================= libnokoiri-ruby 1.3.1-1 installed libnokogiri-ruby1.8 1.3.1-1 installed libnokogiri-ruby 1.3.1-1 installed Linux System: Ubuntu 9.10 Karmic xxx:~$ cat .bashrc ... PATH=/opt/bin:$PATH PATH=/home/myhome/gems/gems/wx_sugar-0.1.22/bin:$PATH LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH export GEM_HOME=/home/myhome/gems ============================================================ xxx:~$ sudo gem install nokogiri Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb extconf.rb:5:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:5:in `
' -------------- next part -------------- An HTML attachment was scrubbed... URL: From plusgforce at gmail.com Thu Nov 19 00:22:36 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Wed, 18 Nov 2009 23:22:36 -0600 Subject: [wxruby-users] excuse me Message-ID: <536e2d6f0911182122n6dbc0c36t88e414045f428a3a@mail.gmail.com> Please excuse my last post as wxruby is an inappropriate forum for trying to get nokogiri xml/html parser to work. -Philip -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Thu Nov 19 11:57:01 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 19 Nov 2009 16:57:01 +0000 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: <659b49af56e5912c4bf5f8e559364465@ruby-forum.com> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DDBAAA@DEFTHW99EA4MSX.ww902.siemens.net> <659b49af56e5912c4bf5f8e559364465@ruby-forum.com> Message-ID: <4B0578DD.6030403@pressure.to> Hi Dirk Dirk Herzhauser wrote: > src/AboutDialogInfo.cpp:1788:20: error: rubyio.h: Datei oder Verzeichnis > nicht gefunden I haven't followed all this thread, but it looks like you're missing the ruby headers which are required. I'd guess there's a package something like "ruby-1.9-dev" which you should install. alex From lists at ruby-forum.com Sat Nov 21 13:42:44 2009 From: lists at ruby-forum.com (Gary Hasson) Date: Sat, 21 Nov 2009 19:42:44 +0100 Subject: [wxruby-users] Wx::Image.resize Message-ID: <21b10155a8bca655ff3fec81efff9a1b@ruby-forum.com> Starting with the wxRuby sample: bitmap_image.rb I changed one line to try to crop the image, using the resize method. That produced the following error message: --- gary at Z790:~/Ruby/wxExamples/drawing$ ruby bitmap_image-1.rb bitmap_image-1.rb:28:in `resize': Wrong type for wxSize parameter (TypeError) from bitmap_image-1.rb:28:in `initialize' from bitmap_image-1.rb:90:in `new' from bitmap_image-1.rb:90:in `on_init' from /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in `main_loop' from /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in `run' from bitmap_image-1.rb:89 bitmap_image-1.rb:28: [BUG] Segmentation fault ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] Aborted --- The only change that was made to the sample file is shown below, marked with #--> The computer is running Ubuntu 9.04 (fully up to date), ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] wxruby-2.0.1-x86-linux My understanding of the error is that the numbers in the resize argument are of the wrong type. Yet changing resize to scale works, using the same arguments. Please explain what I need to do to get this to work, in order to crop an image. Full program code follows: --- # wxRuby2 Sample Code. Copyright (c) 2004-2008 wxRuby development team # Freely reusable code: see SAMPLES-LICENSE.TXT for details begin require 'rubygems' rescue LoadError end require 'wx' # Bitmap sample (rewritten by Chauk-Mean Proum) # This sample demonstrates how to draw the same image in various forms # (original, mirrored, greyscaled and blurred). # # This sample uses : # - Wx::Image, which allows a wide range of manipulations such as rescaling # and writing to files. # - Wx::Bitmap, which is a platform-specific representation of an image. # This is the class that must be used to actually display an image. class ImageFrame < Wx::Frame def initialize super(nil, :title => 'Simple image demo', :size => [600, 600]) # Create the various images from the bitmap file img_file = File.join( File.dirname(__FILE__), 'ruby-logo.jpg') @image = Wx::Image.new(img_file) #--> The only change made to the sample file is on this line, unchanged below: # @mirrored_image = Wx::Image.new(img_file).mirror #--> The following line produces the error: @mirrored_image = Wx::Image.new(img_file).resize(100, 100) #--> When resize above is change to scale below, no error. # @mirrored_image = Wx::Image.new(img_file).scale(100, 100) @greyscaled_image = Wx::Image.new(img_file).convert_to_greyscale @blurred_image = Wx::Image.new(img_file).blur(15) # Create the corresponding bitmaps compute_bitmaps # Set up event handling evt_size :on_size evt_idle :on_idle evt_paint :on_paint end # Create a bitmap for the specified image and size def compute_bitmap image, width, height rescaled_image = Wx::Image.new(image).rescale(width, height) rescaled_image.to_bitmap end # Create the bitmaps corresponding to the images and with half the size of the frame def compute_bitmaps width = client_size.x / 2 height = client_size.y / 2 @bitmap1 = compute_bitmap(@image, width, height) @bitmap2 = compute_bitmap(@mirrored_image, width, height) @bitmap3 = compute_bitmap(@greyscaled_image, width, height) @bitmap4 = compute_bitmap(@blurred_image, width, height) @done = true end # Note to recompute the bitmaps on a resize def on_size(event) @done = false event.skip end # Recompute the bitmaps if needed, then do a refresh def on_idle if not @done compute_bitmaps refresh end end # Paint the frame with the bitmaps def on_paint paint do | dc | if @done width = client_size.x / 2 height = client_size.y / 2 dc.draw_bitmap(@bitmap1, 0, 0, false) dc.draw_bitmap(@bitmap2, width, 0, false) dc.draw_bitmap(@bitmap3, 0, height, false) dc.draw_bitmap(@bitmap4, width, height, false) end end end end Wx::App.run do ImageFrame.new.show end -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Sun Nov 22 16:17:59 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Sun, 22 Nov 2009 22:17:59 +0100 Subject: [wxruby-users] Wx::Image.resize In-Reply-To: <21b10155a8bca655ff3fec81efff9a1b@ruby-forum.com> References: <21b10155a8bca655ff3fec81efff9a1b@ruby-forum.com> Message-ID: Hi Gary, 2009/11/21 Gary Hasson : > Starting with the wxRuby sample: bitmap_image.rb > I changed one line to try to crop the image, using the resize method. > That produced the following error message: > --- > gary at Z790:~/Ruby/wxExamples/drawing$ ruby bitmap_image-1.rb > bitmap_image-1.rb:28:in `resize': Wrong type for wxSize parameter > (TypeError) ... > > #--> The following line produces the error: > ? ?@mirrored_image = Wx::Image.new(img_file).resize(100, 100) > > #--> When resize above is change to scale below, no error. > # ? @mirrored_image = Wx::Image.new(img_file).scale(100, 100) The scale method takes two mandatory integer parameters : a width and a height. Conversely, the resize method takes two mandatory parameters of different type : a Size and a Point. See http://wxruby.rubyforge.org/doc/image.html. If you want to crop from the position x=10, y=20 and with the size w=50, h=60, you should write : @mirrored_image = Wx::Image.new(img_file).resize([50, 60], [10, 20]) See http://wxruby.rubyforge.org/doc/wxruby_intro.html for Size and Point shorthands. Cheers. Chauk-Mean. From lists at ruby-forum.com Sun Nov 22 16:58:30 2009 From: lists at ruby-forum.com (Gary Hasson) Date: Sun, 22 Nov 2009 22:58:30 +0100 Subject: [wxruby-users] wxRuby_RadioBox_choices Message-ID: <5799977c10ed59afdc32f8805e4ee938@ruby-forum.com> Platform: Ubuntu 9.04 (up to date), ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux], wxruby-2.0.1-x86-linux I am trying to use wxFormBuilder, with the output being an XRC file, to produce a simple application that I already have working from a single file, non-XRC approach. To clarify my descriptions, a simple applicaton uses two Ruby files: the "Gui" file produced by XRCise from the XRC file, and the "App" file which establishes how the application operates. The "App" file 'requires' the "Gui" file. I have a simple XRC-based example working correctly. However, one thing that I'd like to do generates an error. In wxFormBuilder, I have a RadioBox with four buttons labeled: "A" "B" "C" "D". When I run the final program, everything works. Then, I try to change the button labels in the "App" file by the expression: @radiobox1.choices = [ "w", "x", "y", "z" ] which produces an error stating that 'choices' in not a defined method. Just as a test, the following worked fine: @radiobox1.label = "New label for Box" I used :choices in the non-XRC version of this program that was contained in one file. I cannot find any reference to "choices" within Wx::RadioBox, such as by doing the following: irb(main):027:0> RadioBox.private_instance_methods.sort and several variations of this approach. My questions are: 1) Why can't I find anything within Wx::RadioBox that references :choices? 2) Is there a way to add a new method to RadioBox from within the "App" program when using the XRC approach? Thanks -- Posted via http://www.ruby-forum.com/. From plusgforce at gmail.com Sun Nov 22 21:28:36 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Sun, 22 Nov 2009 20:28:36 -0600 Subject: [wxruby-users] xrcise not working Message-ID: <536e2d6f0911221828n5a1bcf08if8a45209c3cfe328@mail.gmail.com> Hi. I'm back. Unfortunately I can't get xrcise working. Here is the sample xrc file and the resulting error messages: =============== TestWxFb.xrc ========================================= 500,300 Minimal wxVERTICAL wxALL|wxALIGN_CENTER_HORIZONTAL 5 wxEXPAND 5 wxHORIZONTAL wxALL 5 wxALL 5 0 wxEXPAND 5 wxHORIZONTAL wxALL 5 wxALL 5 0 ========================================================================= xxx:~/Desktop/Eyes$ xrcise -o TestWxFb.rb TestWxFb.xrc /home/myhome/gems/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:46:in `clean_id_attr_readers': undefined method `each' for # (NoMethodError) from (erb):16:in `output' from /opt/lib/ruby1.9/1.9.1/erb.rb:753:in `eval' from /opt/lib/ruby1.9/1.9.1/erb.rb:753:in `result' from /home/myhome/gems/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:19:in `output' from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:126:in `block (2 levels) in ' from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:125:in `each' from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:125:in `block in ' from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:124:in `open' from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:124:in `' from /home/myhome/gems/bin/xrcise:19:in `load' from /home/myhome/gems/bin/xrcise:19:in `
' wxFormbuilder 3.0 wx_sugar version 0.1.22 wxruby-ruby19-2.0.1-x86-linux wx_sugar-0.1.22 Ubuntu version 9.10 (Karmic Koala) =============== .bashrc file ======================================== PATH=/opt/bin:/home/myhome/gems/bin:$PATH LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH export GEM_HOME=/home/myhome/gems How do I make xrcise work properly? Thanks. - Philip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sun Nov 22 22:08:18 2009 From: lists at ruby-forum.com (Gary Hasson) Date: Mon, 23 Nov 2009 04:08:18 +0100 Subject: [wxruby-users] Wx::Image.resize In-Reply-To: References: <21b10155a8bca655ff3fec81efff9a1b@ruby-forum.com> Message-ID: <2dfcbb004221727b014a4177ab01a13a@ruby-forum.com> Chauk-Mean Proum wrote: > Hi Gary, > > 2009/11/21 Gary Hasson : >> Starting with the wxRuby sample: bitmap_image.rb >> I changed one line to try to crop the image, using the resize method. >> That produced the following error message: >> --- >> gary at Z790:~/Ruby/wxExamples/drawing$ ruby bitmap_image-1.rb >> bitmap_image-1.rb:28:in `resize': Wrong type for wxSize parameter >> (TypeError) > > ... > >> >> #--> The following line produces the error: >> ? ?@mirrored_image = Wx::Image.new(img_file).resize(100, 100) >> >> #--> When resize above is change to scale below, no error. >> # ? @mirrored_image = Wx::Image.new(img_file).scale(100, 100) > > The scale method takes two mandatory integer parameters : a width and a > height. > Conversely, the resize method takes two mandatory parameters of > different type : a Size and a Point. > See http://wxruby.rubyforge.org/doc/image.html. > > If you want to crop from the position x=10, y=20 and with the size > w=50, h=60, you should write : > @mirrored_image = Wx::Image.new(img_file).resize([50, 60], [10, 20]) > > See http://wxruby.rubyforge.org/doc/wxruby_intro.html for Size and > Point shorthands. > > Cheers. > Chauk-Mean. --- Thanks for your help Chauk-Mean, however, when I use your line of code: @mirrored_image = Wx::Image.new(img_file).resize([50, 60], [10, 20]) I get the following error msg: --- gary at Z790:~/Ruby/wxExamples/drawing$ ruby bitmap_image-1.rb bitmap_image-1.rb:29:in `resize': Expected argument 2 of type wxPoint const, but got Array [10, 20] (TypeError) in SWIG method 'Resize' from bitmap_image-1.rb:29:in `initialize' from bitmap_image-1.rb:91:in `new' from bitmap_image-1.rb:91:in `on_init' from /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in `main_loop' from /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in `run' from bitmap_image-1.rb:90 bitmap_image-1.rb:29: [BUG] Segmentation fault ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] Aborted gary at Z790:~/Ruby/wxExamples/drawing$ --- So I changed that line as follows: @mirrored_image = Wx::Image.new(img_file).resize( :size => [50, 60], :pos => [10, 20] ) and now I get this error msg: --- gary at Z790:~/Ruby/wxExamples/drawing$ ruby bitmap_image-1.rb bitmap_image-1.rb:28:in `resize': wrong # of arguments(1 for 2) (ArgumentError) from bitmap_image-1.rb:28:in `initialize' from bitmap_image-1.rb:91:in `new' from bitmap_image-1.rb:91:in `on_init' from /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in `main_loop' from /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in `run' from bitmap_image-1.rb:90 bitmap_image-1.rb:28: [BUG] Segmentation fault ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] Aborted gary at Z790:~/Ruby/wxExamples/drawing$ --- What is wrong with each of these alternatives? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Nov 23 02:11:05 2009 From: lists at ruby-forum.com (Aiden Nibali) Date: Mon, 23 Nov 2009 08:11:05 +0100 Subject: [wxruby-users] wxruby Installation woes on Ubuntu 9.10 In-Reply-To: References: <536e2d6f0911151446v2fe36d0cw2c268f99c81ee96@mail.gmail.com> Message-ID: <16f63a7336d5b7e81a5740694989962e@ruby-forum.com> Hey all, I'm having similar problems with getting wxRuby to work on Karmic. I only need Wx for the MediaCtrl class, but I need it nonetheless. > We may provide a Ubuntu-9.10 binary gem in the future but in the > meantime you have to build wxRuby yourself. > >> I've tried to compile wxRuby from scratch but no luck. What do I need to >> do? > > I've added detailed steps to do that in the Wiki : > http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages This doesn't seem like a good solution to me. If you are writing an application, the last thing you want is for end-users to be forced through manual compilation (which, incidentally, did not work for me). I am eagerly anticipating a wxRuby binary gem for Ubuntu 9.10. -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Mon Nov 23 06:24:32 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 23 Nov 2009 06:24:32 -0500 Subject: [wxruby-users] xrcise not working In-Reply-To: <536e2d6f0911221828n5a1bcf08if8a45209c3cfe328@mail.gmail.com> References: <536e2d6f0911221828n5a1bcf08if8a45209c3cfe328@mail.gmail.com> Message-ID: Hello Philip, The problem you are having, is the fact that Ruby 1.9 String standard class no longer implements the each method on it. Which basically, for string, each splits the lines at the \n terminator, returning each line to the block, so you need to create a library file, and have it included, as follows: string_each.rb: class String def each self.split("\n").each do |line| yield line end end end Then there's two ways you can work this, either on the command line, do the following: xrcise -rstring_each -o TestWxFb.rb TestWxFb.xrc Or, modify the xrcise script itself, found in /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise And add a require 'string_each' before any other require. I will see about fixing this bug, and doing a new release of wx_sugar to fix this problem with Ruby 1.9, along with any other outstanding bugs that I can find in regards to wx_sugar. hth, Mario On Sun, Nov 22, 2009 at 9:28 PM, Philip Stephens wrote: > Hi. I'm back. Unfortunately I can't get xrcise working. Here is the > sample xrc file and the resulting error messages: > > =============== TestWxFb.xrc ========================================= > > > > > 500,300 > Minimal > > wxVERTICAL > > > wxALL|wxALIGN_CENTER_HORIZONTAL > 5 > > > > > > > wxEXPAND > 5 > > wxHORIZONTAL > > > wxALL > 5 > > > > > > > wxALL > 5 > > > 0 > > > > > > > wxEXPAND > 5 > > wxHORIZONTAL > > > wxALL > 5 > > > > > > > wxALL > 5 > > > 0 > > > > > > > > ========================================================================= > > xxx:~/Desktop/Eyes$ xrcise -o TestWxFb.rb TestWxFb.xrc > /home/myhome/gems/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:46:in > `clean_id_attr_readers': undefined method `each' for # > (NoMethodError) > from (erb):16:in `output' > from /opt/lib/ruby1.9/1.9.1/erb.rb:753:in `eval' > from /opt/lib/ruby1.9/1.9.1/erb.rb:753:in `result' > from > /home/myhome/gems/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:19:in > `output' > from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:126:in `block (2 > levels) in ' > from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:125:in `each' > from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:125:in `block in > ' > from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:124:in `open' > from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:124:in ` (required)>' > from /home/myhome/gems/bin/xrcise:19:in `load' > from /home/myhome/gems/bin/xrcise:19:in `
' > > wxFormbuilder 3.0 > wx_sugar version 0.1.22 > wxruby-ruby19-2.0.1-x86-linux > wx_sugar-0.1.22 > Ubuntu version 9.10 (Karmic Koala) > > =============== .bashrc file ======================================== > > PATH=/opt/bin:/home/myhome/gems/bin:$PATH > LD_LIBRARY_PATH=/opt/lib:$LD_LIBRARY_PATH > export GEM_HOME=/home/myhome/gems > > How do I make xrcise work properly? Thanks. > - Philip > > > _______________________________________________ > 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 Mon Nov 23 06:29:50 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 23 Nov 2009 06:29:50 -0500 Subject: [wxruby-users] Wx::Image.resize In-Reply-To: <2dfcbb004221727b014a4177ab01a13a@ruby-forum.com> References: <21b10155a8bca655ff3fec81efff9a1b@ruby-forum.com> <2dfcbb004221727b014a4177ab01a13a@ruby-forum.com> Message-ID: On Sun, Nov 22, 2009 at 10:08 PM, Gary Hasson wrote: > Chauk-Mean Proum wrote: > > Hi Gary, > > > > 2009/11/21 Gary Hasson : > >> Starting with the wxRuby sample: bitmap_image.rb > >> I changed one line to try to crop the image, using the resize method. > >> That produced the following error message: > >> --- > >> gary at Z790:~/Ruby/wxExamples/drawing$ ruby bitmap_image-1.rb > >> bitmap_image-1.rb:28:in `resize': Wrong type for wxSize parameter > >> (TypeError) > > > > ... > > > >> > >> #--> The following line produces the error: > >> ? ?@mirrored_image = Wx::Image.new(img_file).resize(100, 100) > >> > >> #--> When resize above is change to scale below, no error. > >> # ? @mirrored_image = Wx::Image.new(img_file).scale(100, 100) > > > > The scale method takes two mandatory integer parameters : a width and a > > height. > > Conversely, the resize method takes two mandatory parameters of > > different type : a Size and a Point. > > See http://wxruby.rubyforge.org/doc/image.html. > > > > If you want to crop from the position x=10, y=20 and with the size > > w=50, h=60, you should write : > > @mirrored_image = Wx::Image.new(img_file).resize([50, 60], [10, 20]) > > > > See http://wxruby.rubyforge.org/doc/wxruby_intro.html for Size and > > Point shorthands. > > > > Cheers. > > Chauk-Mean. > > --- > > Thanks for your help Chauk-Mean, > however, when I use your line of code: > @mirrored_image = Wx::Image.new(img_file).resize([50, 60], [10, 20]) > I get the following error msg: > --- > gary at Z790:~/Ruby/wxExamples/drawing$ ruby bitmap_image-1.rb > bitmap_image-1.rb:29:in `resize': Expected argument 2 of type wxPoint > const, but got Array [10, 20] (TypeError) > in SWIG method 'Resize' > from bitmap_image-1.rb:29:in `initialize' > from bitmap_image-1.rb:91:in `new' > from bitmap_image-1.rb:91:in `on_init' > from > /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in > `main_loop' > from > /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in > `run' > from bitmap_image-1.rb:90 > bitmap_image-1.rb:29: [BUG] Segmentation fault > ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] > Aborted > gary at Z790:~/Ruby/wxExamples/drawing$ > --- > So I changed that line as follows: > @mirrored_image = Wx::Image.new(img_file).resize( :size => [50, 60], > :pos => [10, 20] ) > and now I get this error msg: > --- > gary at Z790:~/Ruby/wxExamples/drawing$ ruby bitmap_image-1.rb > bitmap_image-1.rb:28:in `resize': wrong # of arguments(1 for 2) > (ArgumentError) > from bitmap_image-1.rb:28:in `initialize' > from bitmap_image-1.rb:91:in `new' > from bitmap_image-1.rb:91:in `on_init' > from > /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in > `main_loop' > from > /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx/classes/app.rb:16:in > `run' > from bitmap_image-1.rb:90 > bitmap_image-1.rb:28: [BUG] Segmentation fault > ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] > Aborted > gary at Z790:~/Ruby/wxExamples/drawing$ > --- > What is wrong with each of these alternatives? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > This is a problem with the Ruby wrappers themselves. The only method to accept named parameters are the Constructors, EG: Window.new, Frame.new, Button.new, etc, etc. So your second alternative to use named parameters, was not recognized by the resize method. The first one, should be correct, however the Ruby wrappers are not converting the array into a Point / Size, like it is suppose to, the alternative to this, is to do the following: @mirroed_image = Wx::Image.new(img_file).resize(Wx::Point.new(10,20), Wx::Size.new(50,60)) This should currently work, and I will add this as a bug for us to fix for wxRuby 2.0.2 release. hth, Mario -- 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 Mon Nov 23 06:39:39 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 23 Nov 2009 06:39:39 -0500 Subject: [wxruby-users] wxRuby_RadioBox_choices In-Reply-To: <5799977c10ed59afdc32f8805e4ee938@ruby-forum.com> References: <5799977c10ed59afdc32f8805e4ee938@ruby-forum.com> Message-ID: On Sun, Nov 22, 2009 at 4:58 PM, Gary Hasson wrote: > Platform: > Ubuntu 9.04 (up to date), ruby 1.8.7 (2008-08-11 patchlevel 72) > [i486-linux], > wxruby-2.0.1-x86-linux > > I am trying to use wxFormBuilder, with the output being an XRC file, to > produce a simple application that I already have working from a single > file, non-XRC approach. To clarify my descriptions, a simple applicaton > uses two Ruby files: the "Gui" file produced by XRCise from the XRC > file, and the "App" file which establishes how the application operates. > The "App" file 'requires' the "Gui" file. > > I have a simple XRC-based example working correctly. However, one thing > that I'd like to do generates an error. > > In wxFormBuilder, I have a RadioBox with four buttons labeled: "A" "B" > "C" "D". > > When I run the final program, everything works. Then, I try to change > the button labels in the "App" file by the expression: > @radiobox1.choices = [ "w", "x", "y", "z" ] which produces an error > stating that 'choices' in not a defined method. > > Just as a test, the following worked fine: @radiobox1.label = "New > label for Box" > > I used :choices in the non-XRC version of this program that was > contained in one file. > > I cannot find any reference to "choices" within Wx::RadioBox, such as by > doing the following: > irb(main):027:0> RadioBox.private_instance_methods.sort and several > variations of this approach. > > My questions are: > > 1) Why can't I find anything within Wx::RadioBox that references > :choices? > To my knowledge, there is no :choices method on Wx::RadioBox at all. So why it works in your self-coded one, and not in XRC one, I can't explain, unless you created the choices method yourself. > 2) Is there a way to add a new method to RadioBox from within the "App" > program when using the XRC approach? > Yes, there is a way to add new methods to a XRCized created class. You need to require the generated file first, before you append methods to the class, simply for the fact that if you create a class, before it's defined, you can't subclass it, and the subclassing is already done in the XRCized generated output. The Correct Way: require 'my_xrc_generated_file' class MyXrcWindow def new_method puts "Hello World from New Method!" end end Keep in mind, that with the current version of XRCise, that if you need to define anything to be executed, when the class is created, use the method on_init. EG: If you do: require 'my_xrc_generated_file' class MyXrcWindow def on_init puts "This will be fired when an instance is created." @@instance_number |= 0 @@instance_number += 1 end end hth, Mario Thanks > -- > 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 mario at ruby-im.net Mon Nov 23 07:06:28 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 23 Nov 2009 07:06:28 -0500 Subject: [wxruby-users] wxruby Installation woes on Ubuntu 9.10 In-Reply-To: <16f63a7336d5b7e81a5740694989962e@ruby-forum.com> References: <536e2d6f0911151446v2fe36d0cw2c268f99c81ee96@mail.gmail.com> <16f63a7336d5b7e81a5740694989962e@ruby-forum.com> Message-ID: Since there's been many problems with Ubuntu Karmic Kola and getting wxRuby 2.0.1 working, I've uploaded a Gem for wxRuby specifically for Ubuntu 9.10, at http://www.trilake.net/wxRuby/wxruby-2.0.1-x86-linux.gem. I won't release this gem on RubyForge as it may mess up the current Gem for Ubuntu 8.04, with the naming limitations. You can download it with wget, or your fav browser, and install it by going into the directory where you downloaded it from, and typing: gem install --local wxruby-2.0.1-x86-linux.gem This gem is not meant to be used with Ruby 1.9, 64Bit Processor, or any other Version of Ubuntu, or Linux distrobution, that doesn't use GCC 4.x series of compilers. I garuntee nothing with this file, only the chance to be able to continue your work on Ubuntu 9.10, as I have tested, and been able to make it work just fine. hth, Mario On Mon, Nov 23, 2009 at 2:11 AM, Aiden Nibali wrote: > Hey all, I'm having similar problems with getting wxRuby to work on > Karmic. I only need Wx for the MediaCtrl class, but I need it > nonetheless. > > > We may provide a Ubuntu-9.10 binary gem in the future but in the > > meantime you have to build wxRuby yourself. > > > >> I've tried to compile wxRuby from scratch but no luck. What do I need to > >> do? > > > > I've added detailed steps to do that in the Wiki : > > > http://wxruby.rubyforge.org/wiki/wiki.pl?BuildingOnTopOfLinuxDistroPackages > > This doesn't seem like a good solution to me. If you are writing an > application, the last thing you want is for end-users to be forced > through manual compilation (which, incidentally, did not work for me). I > am eagerly anticipating a wxRuby binary gem for Ubuntu 9.10. > -- > 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 lists at ruby-forum.com Mon Nov 23 13:27:08 2009 From: lists at ruby-forum.com (Gary Hasson) Date: Mon, 23 Nov 2009 19:27:08 +0100 Subject: [wxruby-users] Wx::Image.resize In-Reply-To: References: <21b10155a8bca655ff3fec81efff9a1b@ruby-forum.com> <2dfcbb004221727b014a4177ab01a13a@ruby-forum.com> Message-ID: <67c1196165a0c9ac6329de774ccaad92@ruby-forum.com> Mario Steele wrote: > On Sun, Nov 22, 2009 at 10:08 PM, Gary Hasson > wrote: > >> >> (TypeError) >> > The scale method takes two mandatory integer parameters : a width and a >> > Point shorthands. >> --- >> from >> :pos => [10, 20] ) >> `main_loop' >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > This is a problem with the Ruby wrappers themselves. The only method to > accept named parameters are the Constructors, EG: Window.new, Frame.new, > Button.new, etc, etc. So your second alternative to use named > parameters, > was not recognized by the resize method. > > The first one, should be correct, however the Ruby wrappers are not > converting the array into a Point / Size, like it is suppose to, the > alternative to this, is to do the following: > > @mirroed_image = Wx::Image.new(img_file).resize(Wx::Point.new(10,20), > Wx::Size.new(50,60)) > > This should currently work, and I will add this as a bug for us to fix > for > wxRuby 2.0.2 release. > > hth, > > Mario Thanks for your help Mario! While your code line had point & size reversed, the generated error message allowed me to recognize and correct the code. The following line worked for me: @mirrored_image = Wx::Image.new(img_file).resize(Wx::Size.new(4000,3000), Wx::Point.new(200,150)) Regards, Gary -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Nov 23 13:29:21 2009 From: lists at ruby-forum.com (Gary Hasson) Date: Mon, 23 Nov 2009 19:29:21 +0100 Subject: [wxruby-users] wxRuby_RadioBox_choices In-Reply-To: References: <5799977c10ed59afdc32f8805e4ee938@ruby-forum.com> Message-ID: <6426914d66b639227b31872ae6a1af87@ruby-forum.com> Mario Steele wrote: > On Sun, Nov 22, 2009 at 4:58 PM, Gary Hasson > wrote: > >> The "App" file 'requires' the "Gui" file. >> stating that 'choices' in not a defined method. >> variations of this approach. >> >> My questions are: >> >> 1) Why can't I find anything within Wx::RadioBox that references >> :choices? >> > > To my knowledge, there is no :choices method on Wx::RadioBox at all. So > why > it works in your self-coded one, and not in XRC one, I can't explain, > unless > you created the choices method yourself. > > >> 2) Is there a way to add a new method to RadioBox from within the "App" >> program when using the XRC approach? >> > > Yes, there is a way to add new methods to a XRCized created class. You > need > to require the generated file first, before you append methods to the > class, > simply for the fact that if you create a class, before it's defined, you > can't subclass it, and the subclassing is already done in the XRCized > generated output. > > The Correct Way: > > require 'my_xrc_generated_file' > > class MyXrcWindow > def new_method > puts "Hello World from New Method!" > end > end > > Keep in mind, that with the current version of XRCise, that if you need > to > define anything to be executed, when the class is created, use the > method > on_init. > > EG: If you do: > > require 'my_xrc_generated_file' > > class MyXrcWindow > def on_init > puts "This will be fired when an instance is created." > @@instance_number |= 0 > @@instance_number += 1 > end > end > > hth, > > Mario > > Thanks Thanks for your help Mario! Your examples helped me get my program working, and helped my understanding. As for there being no :choices within wx::RadioBox, there are two places that show it. The first is in the official wxRuby documentation, listed under wx::RadioBox, as follows: RadioBox.new(Window parent, Integer id, String label, Point point = DEFAULT_POSITION, Size size = DEFAULT_SIZE, Array choices =[], Integer major_dimension = 0, Integer style = RA_SPECIFY_COLS, Validator validator = DEFAULT_VALIDATOR, String name = "radioBox") Constructor, creating and showing a radiobox. Parameters * parent Parent window. Must not be nil. * id Window identifier. A value of -1 indicates a default value. * label Label for the static box surrounding the radio buttons. * pos Window position. If the position (-1, -1) is specified then a default position is chosen. * size Window size. If the default size (-1, -1) is specified then a default size is chosen. * choices An array of String choices with which to initialize the radiobox. * major_dimension Specifies the maximum number of rows (if style contains RA_SPECIFY_ROWS) or columns (if style contains RA_SPECIFY_COLS) for a two-dimensional radiobox. * style Window style. See RadioBox. * validator Window validator. * name Window name. --- The second place is in the tutorial below, which was the non-XRC program that I was referring to in my original post. See the following excerpt from that tutorial: WxRubyWiki__Buttons tutorial contains the following: Working with radio buttons #March 29, 2009 #wxruby 2.0.0 #ruby 1.8.6 #mac osx 10.4.11 #7stud require "rubygems" require "wx" class MyFrame < Wx::Frame def initialize super(nil, #Parent :title => "RadioBox Example", #Displays on top of window :pos => [150, 25], #or Wx::DEFAULT_POSITION :size => [300, 200] #or Wx::DEFAULT_SIZE #For the position and size arguments, you don't need to specify Point and Size #objects anymore. See: wxRuby Overview on the doc page wxruby_intro.html ) panel = Wx::Panel.new(self) #Parent = self = this Frame drink_choices = ["coffee", "tea", "juice", "milk"] #labels for radio buttons radios = Wx::RadioBox.new( panel, #Parent :label => "Drinks", #Label for box surrounding radio buttons :pos => [20, 5], :size => Wx::DEFAULT_SIZE, :choices => drink_choices, #The labels for the radio buttons :major_dimension => 1, #Max number of cols(or rows)--try changing it to 2 :style => Wx::RA_SPECIFY_COLS #:major_dimension value applies to columns #The :major_dimension and :style in combination determine the layout of the #RadioBox. In this case, the maximum number of columns is 1, which limits #the number of radio buttons to one per line. Because there are 4 radio buttons, #that means there will be 4 lines, with one radio button per line. ) evt_radiobox(radios.get_id()) {|cmd_event| on_change_radio(cmd_event)} #When there is an event of type evt_radiobox on the widget whose id is radios.get_id(), #the block is called and an "event object" is passed to the block. The block calls #the method on_change_radio(), defined below, relaying the event object to the #method. The event object contains useful information about the radio button #that was selected. @text_widget = Wx::StaticText.new( panel, #Parent :label => "coffee", :pos => [150, 25], :size => Wx::DEFAULT_SIZE #Store a widget in an instance variable if other #methods, like the one below, need access to it. ) show #equivalent to self.show, makes the frame visible end def on_change_radio(cmd_event) selected_drink = cmd_event.string #Selected radio's label #Instead of calling methods like cmd_event.get_string() or cmd_event.set_string() you #can now call accessor methods with the same name as the property you are trying to #get or set. See: wxRuby Overview on the doc page wxruby_intro.html @text_widget.label = selected_drink end end class MinimalApp < Wx::App def on_init MyFrame.new end end MinimalApp.new.main_loop #main_loop() tells wxruby to start reacting #to events on your App, like radio button selections, #button clicks, etc. --- So it seems that those 'choices' are arguments without associated methods. I was unable to get 'choices' listed as an argument. I only found 'choices' listed as an argument in an error message, where I had changed 'choices' to another word. By the way, what are your examples supposed to do? @@instance_number |= 0 @@instance_number += 1 It seems to me that the first one creates a variable with a value of true. Executing the second one then generates an error, since it can't increment true. Gary -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Mon Nov 23 15:07:02 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 23 Nov 2009 15:07:02 -0500 Subject: [wxruby-users] wxRuby_RadioBox_choices In-Reply-To: <6426914d66b639227b31872ae6a1af87@ruby-forum.com> References: <5799977c10ed59afdc32f8805e4ee938@ruby-forum.com> <6426914d66b639227b31872ae6a1af87@ruby-forum.com> Message-ID: On Mon, Nov 23, 2009 at 1:29 PM, Gary Hasson wrote: > Mario Steele wrote: > > On Sun, Nov 22, 2009 at 4:58 PM, Gary Hasson > > wrote: > > > >> The "App" file 'requires' the "Gui" file. > >> stating that 'choices' in not a defined method. > >> variations of this approach. > >> > >> My questions are: > >> > >> 1) Why can't I find anything within Wx::RadioBox that references > >> :choices? > >> > > > > To my knowledge, there is no :choices method on Wx::RadioBox at all. So > > why > > it works in your self-coded one, and not in XRC one, I can't explain, > > unless > > you created the choices method yourself. > > > > > >> 2) Is there a way to add a new method to RadioBox from within the "App" > >> program when using the XRC approach? > >> > > > > Yes, there is a way to add new methods to a XRCized created class. You > > need > > to require the generated file first, before you append methods to the > > class, > > simply for the fact that if you create a class, before it's defined, you > > can't subclass it, and the subclassing is already done in the XRCized > > generated output. > > > > The Correct Way: > > > > require 'my_xrc_generated_file' > > > > class MyXrcWindow > > def new_method > > puts "Hello World from New Method!" > > end > > end > > > > Keep in mind, that with the current version of XRCise, that if you need > > to > > define anything to be executed, when the class is created, use the > > method > > on_init. > > > > EG: If you do: > > > > require 'my_xrc_generated_file' > > > > class MyXrcWindow > > def on_init > > puts "This will be fired when an instance is created." > > @@instance_number |= 0 > > @@instance_number += 1 > > end > > end > > > > hth, > > > > Mario > > > > Thanks > > Thanks for your help Mario! > > Your examples helped me get my program working, and helped my > understanding. > Not a problem. > As for there being no :choices within wx::RadioBox, there are two places > that show it. The first is in the official wxRuby documentation, listed > under wx::RadioBox, as follows: > > RadioBox.new(Window parent, Integer id, String label, > Point point = DEFAULT_POSITION, > Size size = DEFAULT_SIZE, > Array choices =[], > Integer major_dimension = 0, > Integer style = RA_SPECIFY_COLS, > Validator validator = DEFAULT_VALIDATOR, > String name = "radioBox") > > Constructor, creating and showing a radiobox. > Parameters > > * parent Parent window. Must not be nil. > * id Window identifier. A value of -1 indicates a default value. > * label Label for the static box surrounding the radio buttons. > * pos Window position. If the position (-1, -1) is specified then a > default position is chosen. > * size Window size. If the default size (-1, -1) is specified then a > default size is chosen. > * choices An array of String choices with which to initialize the > radiobox. > * major_dimension Specifies the maximum number of rows (if style > contains RA_SPECIFY_ROWS) or columns (if style contains RA_SPECIFY_COLS) > for a two-dimensional radiobox. > * style Window style. See RadioBox. > * validator Window validator. > * name Window name. > --- > > The second place is in the tutorial below, which was the non-XRC program > that I was referring to in my original post. See the following excerpt > from that tutorial: > > WxRubyWiki__Buttons tutorial contains the following: > Working with radio buttons > #March 29, 2009 > #wxruby 2.0.0 > #ruby 1.8.6 > #mac osx 10.4.11 > #7stud > require "rubygems" > require "wx" > class MyFrame < Wx::Frame > def initialize > super(nil, #Parent > :title => "RadioBox Example", #Displays on top of window > :pos => [150, 25], #or Wx::DEFAULT_POSITION > :size => [300, 200] #or Wx::DEFAULT_SIZE > #For the position and size arguments, you don't need to specify > Point and Size > #objects anymore. See: wxRuby Overview on the doc page > wxruby_intro.html > ) > panel = Wx::Panel.new(self) #Parent = self = this Frame > drink_choices = ["coffee", "tea", "juice", "milk"] #labels for > radio buttons > radios = Wx::RadioBox.new( > panel, #Parent > :label => "Drinks", #Label for box surrounding radio > buttons > :pos => [20, 5], > :size => Wx::DEFAULT_SIZE, > :choices => drink_choices, #The labels for the radio buttons > :major_dimension => 1, #Max number of cols(or rows)--try > changing it to 2 > :style => Wx::RA_SPECIFY_COLS #:major_dimension value applies to > columns > #The :major_dimension and :style in combination determine the > layout of the > #RadioBox. In this case, the maximum number of columns is 1, > which limits > #the number of radio buttons to one per line. Because there are > 4 radio buttons, > #that means there will be 4 lines, with one radio button per > line. > ) > evt_radiobox(radios.get_id()) {|cmd_event| > on_change_radio(cmd_event)} > #When there is an event of type evt_radiobox on the widget whose id > is radios.get_id(), > #the block is called and an "event object" is passed to the block. > The block calls > #the method on_change_radio(), defined below, relaying the event > object to the > #method. The event object contains useful information about the > radio button > #that was selected. > @text_widget = Wx::StaticText.new( > panel, #Parent > :label => "coffee", > :pos => [150, 25], > :size => Wx::DEFAULT_SIZE > #Store a widget in an instance variable if other > #methods, like the one below, need access to it. > ) > show #equivalent to self.show, makes the frame visible > end > def on_change_radio(cmd_event) > selected_drink = cmd_event.string #Selected radio's label > #Instead of calling methods like cmd_event.get_string() or > cmd_event.set_string() you > #can now call accessor methods with the same name as the property > you are trying to > #get or set. See: wxRuby Overview on the doc page wxruby_intro.html > @text_widget.label = selected_drink > end > end > > class MinimalApp < Wx::App > def on_init > MyFrame.new > end > end > > MinimalApp.new.main_loop #main_loop() tells wxruby to start reacting > #to events on your App, like radio button > selections, > #button clicks, etc > These are examples of Named parameters, as the Official WxWidgets API, the construction of a wxRadioBox allows you to pass a wxList of Labels to it. There's no official method in which choices are mapped, though technically, all you would need to do, is write the method choices, in a way that enumerates the children of the wxRadioBox for retrieval, and a method in which deletes the children, and adds new ones to it. --- > > So it seems that those 'choices' are arguments without associated > methods. I was unable to get 'choices' listed as an argument. I only > found 'choices' listed as an argument in an error message, where I had > changed 'choices' to another word. > > By the way, what are your examples supposed to do? > @@instance_number |= 0 > @@instance_number += 1 > It seems to me that the first one creates a variable with a value of > true. > Executing the second one then generates an error, since it can't > increment true. > My apologies, I wrote that after I got home from work, when I was tired, and naturally, typo'ed the first line. The first line is suppose to read: @@instance_number ||= 0, which means, unless there's already a value stored in @@instance_number, assign 0 to it. The next line, @@instance_number += 1, is suppose to increment the number count of how many controls have been created. In other words, if you have a dynamic control set being setup, and you want to monitor how many of the controls are created in a single run of the Application, you can use that method to see. In any case, hope these things help you out further in your development. Also note, that there is one method that I didn't mention, as it's not a method I personally like to use, but I wouldn't be a good developer if I didn't point it out. While the on_init method is something that I added to xrcise, as it's something that I personally use, and my preferred way of access, and limiting the number of redundant classes and subclasses around in the name space of the application, it may be dropped in future versions of xrcise, though I prefer it would remain in the code, as it doesn't effect anything with the generated code. The other method in which to add methods to the generated class, is to simply create a new class definition, and subclass it to your XRC Generated class. An Example: require 'my_xrc_class' class MyRubyClass < MyXrcClass def hello_world self.set_label("Hello World!") end end Going this route, won't hurt anything, and I believe it is of personal preference which method to use. Personally, I think the on_init method is in tune with the wxRuby framework, as it is used in Wx::App. But keep in mind, that the on_init method that is setup to execute from your XRCised code, is only available in that generated code, it's not native to any specific Widget control implemented in wxRuby. > Gary > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > hth, Mario -- 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 lists at ruby-forum.com Tue Nov 24 00:30:52 2009 From: lists at ruby-forum.com (Aiden Nibali) Date: Tue, 24 Nov 2009 06:30:52 +0100 Subject: [wxruby-users] wxruby Installation woes on Ubuntu 9.10 In-Reply-To: References: <536e2d6f0911151446v2fe36d0cw2c268f99c81ee96@mail.gmail.com> <16f63a7336d5b7e81a5740694989962e@ruby-forum.com> Message-ID: <350c1cb8674605841788976ccf96d80f@ruby-forum.com> Hey Mario, Thanks for your effort. I've finally managed to compile wxRuby myself, and ended up with a ~3 MiB gem. Since your gem is a bit larger, have you somehow made it work more consistently on different machines? I'm really not good when it comes to binary stuff as I've always worked with languages such as Java and Ruby. -- Posted via http://www.ruby-forum.com/. From plusgforce at gmail.com Tue Nov 24 00:40:13 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Mon, 23 Nov 2009 23:40:13 -0600 Subject: [wxruby-users] xrcise problem Message-ID: <536e2d6f0911232140x2b78a7dfxd120b828e3da50f@mail.gmail.com> Hello Mario. From: Mario Steele To: General discussion of wxRuby Date: Mon, 23 Nov 2009 06:24:32 -0500 Subject: Re: [wxruby-users] xrcise not working Hello Philip, The problem you are having, is the fact that Ruby 1.9 String standard class no longer implements the each method on it. Which basically, for string, each splits the lines at the \n terminator, returning each line to the block, so you need to create a library file, and have it included, as follows: string_each.rb: class String def each self.split("\n").each do |line| yield line end end end Then there's two ways you can work this, either on the command line, do the following: xrcise -rstring_each -o TestWxFb.rb TestWxFb.xrc xrcise -rstring_each -o TestWxFb.rb TestWxFb.xrc /home/myhome/gems/bin/xrcise: invalid option -- r /opt/lib/ruby1.9/1.9.1/getoptlong.rb:392:in `set_error': invalid option -- r (GetoptLong::InvalidOption) from /opt/lib/ruby1.9/1.9.1/getoptlong.rb:569:in `get' from /opt/lib/ruby1.9/1.9.1/getoptlong.rb:600:in `block in each' from /opt/lib/ruby1.9/1.9.1/getoptlong.rb:599:in `loop' from /opt/lib/ruby1.9/1.9.1/getoptlong.rb:599:in `each' from /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise:90:in `' from /home/myhome/gems/bin/xrcise:19:in `load' from /home/myhome/gems/bin/xrcise:19:in `
' > Or, modify the xrcise script itself, found in /home/myhome/gems/gems/wx_ > sugar-0.1.22/bin/xrcise > And add a require 'string_each' before any other require. I will see about fixing this bug, and doing a > new release of wx_sugar to fix this problem with Ruby 1.9, along with any other outstanding bugs that > I can find in regards to wx_sugar I tried that but still got errors. A new release of wx_sugar would be great. Thanks for your reply. Philip -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthony.metcalf at anferny.me.uk Tue Nov 24 09:51:47 2009 From: anthony.metcalf at anferny.me.uk (Anthony Metcalf) Date: Tue, 24 Nov 2009 14:51:47 +0000 Subject: [wxruby-users] Wx::GridCellChoiceEditor get selected string Message-ID: <4B0BF303.8050709@anferny.me.uk> Hi, I'm using a Wx::GridCellChoiceEditor within a Wx:grid. I have it displaying as it should, but I now need to do something when a user selects a string. The only likely looking event I can find is evt_grid_cell_change. evt_grid_cell_change is calling the method I defined when I click off the choice box, assuming the choice changed. This is fine. What I need to do, is get the newly selected item (or preferably some client data asssociated with it) how do I do that? I can't see any likley methods, and inspecting the generated event is useless.... I currently have: # Set up the event evt_grid_cell_change {|event| cell_change(event)} #Set up the rows, there is more to this, but it's just putting values in cells... @characters.each do |char| weapons = Wx::GridCellChoiceEditor.new(char.weapons_list) @grid.insert_rows @grid.set_cell_editor(0,1,weapons) end #The method run when the selection changes def cell_change(event) row = event.get_row character = Character.find_by_name(@grid.get_cell_value(row,0)) character.held_weapon = ??? end What do I need to put in the ??? . As I said, ??? should ideally be the string selected, or some data associated with it.... Thanks Anthony -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: From anthony.metcalf at anferny.me.uk Tue Nov 24 10:19:56 2009 From: anthony.metcalf at anferny.me.uk (Anthony Metcalf) Date: Tue, 24 Nov 2009 15:19:56 +0000 Subject: [wxruby-users] Wx::GridCellChoiceEditor get selected string In-Reply-To: <4B0BF303.8050709@anferny.me.uk> References: <4B0BF303.8050709@anferny.me.uk> Message-ID: <4B0BF99C.2090606@anferny.me.uk> I re-read my email when it hit the list. I noticed a bit of code on the line above where I was asking about, and thought, I wonder.... Turns out I was seriously over thinking it.... def cell_change(event) row = event.get_row character = Character.find_by_name(@grid.get_cell_value(row,0)) character.held_weapon = @grid.get_cell_value(row,1) end Does the trick quite nicely. Doh. A -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: From plusgforce at gmail.com Tue Nov 24 14:35:46 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Tue, 24 Nov 2009 13:35:46 -0600 Subject: [wxruby-users] xrcise now works Message-ID: <536e2d6f0911241135y43b368ddhfb4418ca64d6f3fe@mail.gmail.com> Hi Mario, The following change to outputter.rb did work for me. It looks like adding a routine to string should also work but it didn't for me. Thanks for your help. -Philip ===== from RubyForge ========== Date: 2009-11-18 00:25 Sender: Konstantin Shabanov After changing 'each' method to 'each_line' in outputter.rb on lines 39 and 46 xrcise code generation seems to be working. ================================ From: Mario Steele To: General discussion of wxRuby Date: Mon, 23 Nov 2009 06:24:32 -0500 Subject: Re: [wxruby-users] xrcise not working Hello Philip, The problem you are having, is the fact that Ruby 1.9 String standard class no longer implements the each method on it. Which basically, for string, each splits the lines at the \n terminator, returning each line to the block, so you need to create a library file, and have it included, as follows: string_each.rb: class String def each self.split("\n").each do |line| yield line end end end Then there's two ways you can work this, either on the command line, do the following: xrcise -rstring_each -o TestWxFb.rb TestWxFb.xrc Or, modify the xrcise script itself, found in /home/myhome/gems/gems/wx_sugar-0.1.22/bin/xrcise And add a require 'string_each' before any other require. I will see about fixing this bug, and doing a new release of wx_sugar to fix this problem with Ruby 1.9, along with any other outstanding bugs that I can find in regards to wx_sugar. hth, Mario -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Wed Nov 25 11:40:23 2009 From: lists at ruby-forum.com (John Bentley) Date: Wed, 25 Nov 2009 17:40:23 +0100 Subject: [wxruby-users] Help with HtmlListBox.hit_test and painting on DC Message-ID: I need help getting this code to work. I am having trouble getting the hit_test to work. It seems to be true even when the mouse is not over the control (specifically to the right of the control). case when (ht = @htmlctrl.hit_test(@htmlctrl.screen_to_client evt.get_position)) != NOT_FOUND # ... I am also trying to paint on a DC. I have attached an example of this. If you need any additional information please ask. Thanks in advance. Attachments: http://www.ruby-forum.com/attachment/4291/test.rb -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Nov 25 12:27:35 2009 From: lists at ruby-forum.com (John Bentley) Date: Wed, 25 Nov 2009 18:27:35 +0100 Subject: [wxruby-users] Help with HtmlListBox.hit_test and painting on DC In-Reply-To: References: Message-ID: It seems I forgot to mention that the issue with the DC code is that it draws under the previous image when the window is resized. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Nov 25 13:42:33 2009 From: lists at ruby-forum.com (Gary Hasson) Date: Wed, 25 Nov 2009 19:42:33 +0100 Subject: [wxruby-users] wxRuby GUI textctrl not updating until end Message-ID: I have a wxRuby application that is working fine, except that it does not update the multi-line textctrl box until the application has completed processing. The program has a couple of nexted loops. On the inner loop, the program processes a file, then displays out the results, as outlined below: ... Start of inner loop process one file...very heavy cpu load puts "File number #{@new_file_count} processed" @textbox.append_text("File number #{@new_file_count} processed\n") End of inner loop ... The puts line is displayed in the terminal window on each pass through the loop. The "write to gui" line, @textbox..., does not display until all of the files have been processed. Ruby should process the gui line before going any further, so that implies that the gui does not process the line until later. What is going on here, and what do I do to get the lines displayed in the gui as each loop completes? Thanks, Gary -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Nov 25 14:58:39 2009 From: lists at ruby-forum.com (Peter Lane) Date: Wed, 25 Nov 2009 20:58:39 +0100 Subject: [wxruby-users] wxRuby GUI textctrl not updating until end In-Reply-To: References: Message-ID: <341cbaca604382ccdcb062990c197ead@ruby-forum.com> Hi Gary, Gary Hasson wrote: > I have a wxRuby application that is working fine, except that it does > not update the multi-line textctrl box until the application has > completed processing. > ... > > What is going on here, and what do I do to get the lines displayed in > the gui as each loop completes? > Have you used a thread for the busy loop? If not, that is likely your problem. I have been using the technique in the sample below to keep my GUIs updated. A timer in the Frame gets the GUI updated at regular intervals, and a Thread in the 'busy loop' is needed to separate the work from the GUI. If you leave the Thread out from 'print_value', then the GUI is updated only at the end. If you leave out the timer, then the Thread does not seem to work reliably, e.g. if you pass focus to another window. Let me know if this helps in your application. I would be interested to hear of a better solution though. cheers, Peter. require 'wx' class MyFrame < Wx::Frame def initialize super(nil, :title => "Controls") @text_field = Wx::TextCtrl.new(self, :style => Wx::TE_MULTILINE) button = Wx::Button.new(self, :label => "Show Values") evt_button(button) {print_value} main_sizer = Wx::BoxSizer.new Wx::VERTICAL main_sizer.add @text_field main_sizer.add button set_sizer main_sizer # -- this timer interrupts every 100ms and gets next thread active # -- if you don't have the timer, the GUI does not update if window # in background timer = Wx::Timer.new(self, Wx::ID_ANY) evt_timer(timer.id) {Thread.pass} timer.start(100) end def print_value Thread.new do 10.times do |i| puts "#{i} cycle" @text_field.append_text "#{i} cycle\n" sleep 1.0 end end end end Wx::App.run do MyFrame.new.show end -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Nov 25 15:50:27 2009 From: lists at ruby-forum.com (John Bentley) Date: Wed, 25 Nov 2009 21:50:27 +0100 Subject: [wxruby-users] Help with HtmlListBox.hit_test and painting on DC In-Reply-To: References: Message-ID: <099b8fc6f84567ba0f58c723afddaef4@ruby-forum.com> OK. I found a solution for the first issue. I still need help with painting on a DC. I fixed it by checking the x position. case when (ht = @htmlctrl.hit_test(@htmlctrl.screen_to_client evt.get_position)) != NOT_FOUND && @htmlctrl.screen_to_client(evt.get_position).x < @htmlctrl.get_client_size.width # ... -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 26 02:30:23 2009 From: lists at ruby-forum.com (Ben Ben) Date: Thu, 26 Nov 2009 08:30:23 +0100 Subject: [wxruby-users] how can i use windows xp style in wxruby Message-ID: <5e742fc6c30e31c58bbe320357b57b45@ruby-forum.com> sorry, i can't open the page: http://rubyonwindows.blogspot.com/2007/10/windows-xp-visual-style-controls-with.html so, can anyone send the content to me? thinks very much can put here or send me email: bencode at 163.com -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 26 07:50:53 2009 From: lists at ruby-forum.com (John Bentley) Date: Thu, 26 Nov 2009 13:50:53 +0100 Subject: [wxruby-users] how can i use windows xp style in wxruby In-Reply-To: <5e742fc6c30e31c58bbe320357b57b45@ruby-forum.com> References: <5e742fc6c30e31c58bbe320357b57b45@ruby-forum.com> Message-ID: <39a63bead78c03a05c6cbe047e6fea11@ruby-forum.com> Ben Ben wrote: > sorry, i can't open the page: > http://rubyonwindows.blogspot.com/2007/10/windows-xp-visual-style-controls-with.html > > so, can anyone send the content to me? thinks very much > > > can put here or send me email: bencode at 163.com This is the meat of it. Copy the following text into a new text file. Save the file as "rubyw.exe.manifest" in your ruby/bin folder, the same folder that contains rubyw.exe. You might also save a copy to the same folder as "ruby.exe.manifest". Ruby interpreter -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 26 08:44:57 2009 From: lists at ruby-forum.com (Ben Ben) Date: Thu, 26 Nov 2009 14:44:57 +0100 Subject: [wxruby-users] how can i use windows xp style in wxruby In-Reply-To: <39a63bead78c03a05c6cbe047e6fea11@ruby-forum.com> References: <5e742fc6c30e31c58bbe320357b57b45@ruby-forum.com> <39a63bead78c03a05c6cbe047e6fea11@ruby-forum.com> Message-ID: <70efbcfbd1d2e27788f25bc7e8206f82@ruby-forum.com> thanks!! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 26 09:18:31 2009 From: lists at ruby-forum.com (Gary Hasson) Date: Thu, 26 Nov 2009 15:18:31 +0100 Subject: [wxruby-users] wxRuby GUI textctrl not updating until end In-Reply-To: <341cbaca604382ccdcb062990c197ead@ruby-forum.com> References: <341cbaca604382ccdcb062990c197ead@ruby-forum.com> Message-ID: <1a4fbf3f055f382f01ae4cd4a974ab28@ruby-forum.com> Hi Peter, Your approached worked great for my application! The sleep line did not seem to have any effect, so I deleted it. Thanks for your help! Gary -- Posted via http://www.ruby-forum.com/. From plusgforce at gmail.com Sat Nov 28 16:46:45 2009 From: plusgforce at gmail.com (Philip Stephens) Date: Sat, 28 Nov 2009 15:46:45 -0600 Subject: [wxruby-users] 'Are you sure?' custom dialog not exiting cleanly Message-ID: <536e2d6f0911281346x346dfb5bmfdd467eaf0635681@mail.gmail.com> The following program does not exit cleanly after pressing 'Yes' when asked 'Are you sure'? How do I free up the resources after exiting? You can use wxsugar (xrcise) to try out this mini program if you wish to create sample1.rb . Thank you. -Philip =========== asample1.rb ==================================================== require 'wx' require 'sample1.rb' class DIA_Frame < DiaFrame def on_init set_affirmative_id(Wx::ID_YES) set_escape_id(Wx::ID_NO) end end class Main_Frame < MainFrame def on_init evt_close { confirm_closure } evt_button(@m_butexit) {self.close} end def confirm_closure dlg = DIA_Frame.new if(dlg.show_modal==Wx::ID_YES) then dlg.end_modal(Wx::ID_YES) self.destroy end end end class MyApp < Wx::App def on_init main_frame = Main_Frame.new() set_top_window(main_frame) set_exit_on_frame_delete(true) main_frame.show end end app = MyApp.new app.main_loop ============= sample1.xrc =========================================== # This class was automatically generated from XRC source. It is not # recommended that this file is edited directly; instead, inherit from # this class and extend its behaviour there. # # Source file: sample1.xrc # Generated at: 2009-11-27 18:13:59 -0600 class MainFrame < Wx::Frame attr_reader :m_statictext1, :m_butexit def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("sample1.xrc") xml.load_frame_subclass(self, parent, "MyFrame1") finder = lambda do | x | int_id = Wx::xrcid(x) begin Wx::Window.find_window_by_id(int_id, self) || int_id # Temporary hack to work around regression in 1.9.2; remove # begin/rescue clause in later versions rescue RuntimeError int_id end end @m_statictext1 = finder.call("m_staticText1") @m_butexit = finder.call("m_butExit") if self.class.method_defined? "on_init" self.on_init() end end end # This class was automatically generated from XRC source. It is not # recommended that this file is edited directly; instead, inherit from # this class and extend its behaviour there. # # Source file: sample1.xrc # Generated at: 2009-11-27 18:13:59 -0600 class DiaFrame < Wx::Dialog attr_reader :m_statictext4, :m_statictext5 def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("sample1.xrc") xml.load_dialog_subclass(self, parent, "MyDialog1") finder = lambda do | x | int_id = Wx::xrcid(x) begin Wx::Window.find_window_by_id(int_id, self) || int_id # Temporary hack to work around regression in 1.9.2; remove # begin/rescue clause in later versions rescue RuntimeError int_id end end @m_statictext4 = finder.call("m_staticText4") @m_statictext5 = finder.call("m_staticText5") if self.class.method_defined? "on_init" self.on_init() end end end -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Sat Nov 28 17:03:33 2009 From: alex at pressure.to (Alex Fenton) Date: Sat, 28 Nov 2009 22:03:33 +0000 Subject: [wxruby-users] 'Are you sure?' custom dialog not exiting cleanly In-Reply-To: <536e2d6f0911281346x346dfb5bmfdd467eaf0635681@mail.gmail.com> References: <536e2d6f0911281346x346dfb5bmfdd467eaf0635681@mail.gmail.com> Message-ID: <4B119E35.2020106@pressure.to> Philip Stephens wrote: > The following program does not exit cleanly after pressing 'Yes' when > asked 'Are you sure'? > How do I free up the resources after exiting? It looks like you either need to make the confirmation dialog a child of the main frame of the whole program, or else call dialog.destroy explicitly when you're finished with it, whatever the return value of show_modal def confirm_closure # dlg = DIA_Frame.new dlg = DIA_Frame.new(the_main_window) if(dlg.show_modal==Wx::ID_YES) then dlg.end_modal(Wx::ID_YES) self.destroy end end alex From axel.friedrich at siemens.com Mon Nov 30 02:57:08 2009 From: axel.friedrich at siemens.com (Friedrich, Axel) Date: Mon, 30 Nov 2009 08:57:08 +0100 Subject: [wxruby-users] installing wxruby 2.0.1. missing lwx_gtk2u_media-2.8 In-Reply-To: <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> References: <1BDD6C6D3250C54CA91DD9348C23774F06DA2577@DEFTHW99EA4MSX.ww902.siemens.net> <6ab01db6415db8130f66f96af46f8d19@ruby-forum.com> <1BDD6C6D3250C54CA91DD9348C23774F06DA275E@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA27D1@DEFTHW99EA4MSX.ww902.siemens.net> <1BDD6C6D3250C54CA91DD9348C23774F06DA281B@DEFTHW99EA4MSX.ww902.siemens.net> <165e5a503bcecdcfbea994a8b20b4f23@ruby-forum.com> Message-ID: <1BDD6C6D3250C54CA91DD9348C23774F1C13241E@DEFTHW99EA4MSX.ww902.siemens.net> Hi, I just want to tell you the outcome. I tried using Chauk-Mean's Ubuntu instruction on my openSUSE 11.1. But: The Linux-PC has _no_ connection to the web (isn't allowed to). Hence, I downloaded a lot of dependencies with my Windows-PC, transfered them to the Linux-PC by flash drive and installed them manually. But because the dependencies themselves required other dependencies, I gave up at some point. :/ Because Dirk Herzhauser had some more success with openSUSE 11.2, I installed openSUSE 11.2. and tried compiling wxWidgets from source, which worked without problems on openSUSE 11.1. But this time I got an error: ... In file included from ../src/gtk/gsockgtk.cpp:21: ../include/wx/gsocket.h:40: error: using typedef-name 'GSocket' after 'class' /usr/include/glib-2.0/gio/giotypes.h:120: error: 'GSocket' has a previous declaration here ... That's the condensed description. I give up for now. Axel