From shs at demosophia.net Thu Jul 1 10:59:21 2010 From: shs at demosophia.net (Svend Haugaard =?UTF-8?B?U8O4cmVuc2Vu?=) Date: Thu, 1 Jul 2010 16:59:21 +0200 Subject: [wxruby-users] File system event ? Message-ID: <20100701165921.6c4ee149@cybert.demosophia.net> Hey. I am making a little TaskBar app, whos task it is to monitor a file and change icon when the file is updated. First is there any way to catch a file change event direct in WxRuby? Does WxRuby have a way to catch system event directly? If I can't do it in WxRuby, how do I then combine the RInotify package with WxRuby. Exactly where do I put the rinotify.wait_for_events call ? Is there some way to a it to the App.main_loop ? Or should put it in a evt_idle? This might slow down UI. Or should I try to figure out how to make a separate thread that could wait and then generate a custom event. So what do you think, have any of you tried any thing like it before? PS. I am working on a linux box. From alex at pressure.to Fri Jul 2 12:21:57 2010 From: alex at pressure.to (Alex Fenton) Date: Fri, 02 Jul 2010 17:21:57 +0100 Subject: [wxruby-users] File system event ? In-Reply-To: <20100701165921.6c4ee149@cybert.demosophia.net> References: <20100701165921.6c4ee149@cybert.demosophia.net> Message-ID: <4C2E1225.3060505@pressure.to> On 01/07/2010 15:59, Svend Haugaard S?rensen wrote: > I am making a little TaskBar app, whos task it is to monitor a file and > change icon when the file is updated. > > First is there any way to catch a file change event direct in WxRuby? > Does WxRuby have a way to catch system event directly? No, not in the version of wxWidgets we're based on. I think there's been a recent GSOC project to add file system notifications to wxWidgets. > If I can't do it in WxRuby, how do I then combine the RInotify package > with WxRuby. > > Exactly where do I put the rinotify.wait_for_events call ? > I don't know RInotify, but I think you may need to use threads if it's the kind of call that waits and hands to a block (similar to TCP servers in Ruby). > Is there some way to a it to the App.main_loop ? > Not if the execution stops in wait_for_events - your whole UI will stop. > Or should put it in a evt_idle? This might slow down UI. > evt_idle are intended to do a short something then return. > Or should I try to figure out how to make a separate thread that > could wait and then generate a custom event. > > So what do you think, have any of you tried any thing like it before? > Yes, this is the way to go I'd think. It's perfectly do-able but needs more care. If using 1.8, you need to manually nudge Ruby's thread scheduler to give time to the RInotify thread. If using 1.9, this won't be needed, but you must not call GUI update code in the non-wx thread. GUI updates must be signalled by posting a Wx::Event to the GUI loop. a From lists at ruby-forum.com Sun Jul 4 18:29:38 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Mon, 5 Jul 2010 00:29:38 +0200 Subject: [wxruby-users] require 'wx' fails Message-ID: <10b43d3dea56bb6c0c2180703a99e450@ruby-forum.com> I've recently reloaded my system. For some reason, I can't get wxruby to initialize. In irb, I see the following require 'rubygems' require 'wx' LoadError: libwx_gtk2u_media-2.8.so.0: cannot open shared object file: No such file or directory - /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so from /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx.rb:12 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from (irb):1 This seems to say that a file is missing. When I list the directory, though, I see [michael at photon ~]$ ls /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib -l total 9732 drwxr-xr-x 3 root root 4096 2010-07-04 17:18 wx/ -rw-r--r-- 1 root root 1715 2010-07-04 17:18 wx.rb -rwxr-xr-x 1 root root 9939967 2010-07-04 17:18 wxruby2.so* Which seems clean. Can anyone offer any help here? Thanks in advance ---Michael -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Mon Jul 5 03:11:19 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Mon, 5 Jul 2010 14:11:19 +0700 Subject: [wxruby-users] require 'wx' fails In-Reply-To: <10b43d3dea56bb6c0c2180703a99e450@ruby-forum.com> References: <10b43d3dea56bb6c0c2180703a99e450@ruby-forum.com> Message-ID: Are you using ubuntu? if so, perhaps you download wrong gem because for new ubuntu, there is a special gem or if you want to be sure, check previous post about repo for wxruby On Mon, Jul 5, 2010 at 5:29 AM, Michael Satterwhite wrote: > I've recently reloaded my system. For some reason, I can't get wxruby to > initialize. In irb, I see the following > > require 'rubygems' > require 'wx' > LoadError: libwx_gtk2u_media-2.8.so.0: cannot open shared object file: > No such file or directory - > /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so > from /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require' > from /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wx.rb:12 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in > `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in > `require' > from (irb):1 > > This seems to say that a file is missing. When I list the directory, > though, I see > > [michael at photon ~]$ ls > /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib -l > total 9732 > drwxr-xr-x 3 root root 4096 2010-07-04 17:18 wx/ > -rw-r--r-- 1 root root 1715 2010-07-04 17:18 wx.rb > -rwxr-xr-x 1 root root 9939967 2010-07-04 17:18 wxruby2.so* > > Which seems clean. Can anyone offer any help here? > Thanks in advance > ---Michael > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Mon Jul 5 07:33:59 2010 From: alex at pressure.to (Alex Fenton) Date: Mon, 05 Jul 2010 12:33:59 +0100 Subject: [wxruby-users] require 'wx' fails In-Reply-To: <10b43d3dea56bb6c0c2180703a99e450@ruby-forum.com> References: <10b43d3dea56bb6c0c2180703a99e450@ruby-forum.com> Message-ID: <4C31C327.2070305@pressure.to> On 04/07/2010 23:29, Michael Satterwhite wrote: > I've recently reloaded my system. For some reason, I can't get wxruby to > initialize. In irb, I see the following > > require 'rubygems' > require 'wx' > LoadError: libwx_gtk2u_media-2.8.so.0: cannot open shared object file: > No such file or directory - > It looks like the wx library you are using hasn't got support for wxMediaCtrl included, whereas the wxRuby gem is expecting this class to be supported. It may be that this extra C++ library can be installed via your package manager. Have a look for wx-2.8-xxx packages that are available but not installed. If not, the easiest way may to be compile your own wxRuby from source. You'll need SWIG and the wx-2.8-dev files. The compile process should adapt and pick up the local configuration of wx. alex From shs at demosophia.net Mon Jul 5 10:57:33 2010 From: shs at demosophia.net (Svend Haugaard =?UTF-8?B?U8O4cmVuc2Vu?=) Date: Mon, 5 Jul 2010 16:57:33 +0200 Subject: [wxruby-users] Custom event problem. Message-ID: <20100705165733.050c82dd@cybert.demosophia.net> I have some problem making a custom event. It seem like the initilizer is not visible in the scope. Why is that? I have put a little test program in an attachment, can anybody tell me, what is wrong with it? -------------- next part -------------- A non-text attachment was scrubbed... Name: EventTest.rb Type: application/x-ruby Size: 713 bytes Desc: not available URL: From lists at ruby-forum.com Mon Jul 5 14:28:10 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Mon, 5 Jul 2010 20:28:10 +0200 Subject: [wxruby-users] Build Problem for wxruby Message-ID: I'm running under PCLinuxOS. I can't do a gem install for wxruby because PCLinuxOS doesn't have the libwx_gtk2u_media-2.8.so.0 library available anywhere in the repositories. It has the 2.6 version of the library, but that doesn't help me. This (I think) implies that I need to compile wxruby. When I run rake - after getting sources - I get the error: No such file or directory - /usr/lib/wx/include/wx/setup.h setup.h *IS* on my system. In fact, two of them are. They are located as follows: /usr/lib/wx/include/gtk2-unicode-release-2.8/wx --and-- /usr/lib/wx/include/multiarch-i386-linux/gtk2-unicode-release-2.8/wx Would someone be so kind as to offer some help? Thanks much. ---Michael -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Jul 6 07:20:17 2010 From: lists at ruby-forum.com (Cristian Ispas) Date: Tue, 6 Jul 2010 13:20:17 +0200 Subject: [wxruby-users] distributing and application In-Reply-To: References: <4C0C952F.9010900@gmx.de> <3776376e95c2cb36402324686c112898@ruby-forum.com> Message-ID: <87cbe3670d4e95966f27f09ad6e87cc4@ruby-forum.com> Sergio Ruiz wrote: > > hmm... i am starting to think i might just want to write this app with > something else.. > > my main goals are simplicity for the end user.. on three platforms.. > > thanks for all the input! Hello, I was also assessing these weeks the possibility of writing some GUI in wxruby, but I could not find an appropriate program to compile the resulting application for Win/Mac/Linux users. (have you tried ocra or crate?) What did you do in the meantime? have you found some useful program or you changed your mind on writing in wxruby? Cristian -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Jul 6 12:23:01 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Tue, 6 Jul 2010 18:23:01 +0200 Subject: [wxruby-users] Build Problem for wxruby In-Reply-To: References: Message-ID: <223450f560506508d01e29d0db636ad8@ruby-forum.com> I fixed this problem by adding a soft link to the directory containing setup.h -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Jul 6 12:25:56 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Tue, 6 Jul 2010 18:25:56 +0200 Subject: [wxruby-users] require 'wx' fails In-Reply-To: <4C31C327.2070305@pressure.to> References: <10b43d3dea56bb6c0c2180703a99e450@ruby-forum.com> <4C31C327.2070305@pressure.to> Message-ID: <51052b05683506f42b9c794a7b75ea34@ruby-forum.com> Alex Fenton wrote: > > If not, the easiest way may to be compile your own wxRuby from source. > You'll need SWIG and the wx-2.8-dev files. The compile process should > adapt and pick up the local configuration of wx. It was a good idea, but it doesn't work. The build of wxruby fails at link with /usr/bin/ld: cannot find -lwx_gtk2u_media-2.8 collect2: ld returned 1 exit status rake aborted! I think I'm going to have to remove the version of wxwidgets supplied by PCLinuxOS and do a source install. If anyone knows another way around this, I'm certainly listening. Thanks ---Michael -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Jul 6 12:30:31 2010 From: alex at pressure.to (Alex Fenton) Date: Tue, 06 Jul 2010 17:30:31 +0100 Subject: [wxruby-users] require 'wx' fails In-Reply-To: <51052b05683506f42b9c794a7b75ea34@ruby-forum.com> References: <10b43d3dea56bb6c0c2180703a99e450@ruby-forum.com> <4C31C327.2070305@pressure.to> <51052b05683506f42b9c794a7b75ea34@ruby-forum.com> Message-ID: <4C335A27.1020205@pressure.to> Michael Satterwhite wrote: > It was a good idea, but it doesn't work. The build of wxruby fails at > link with > > /usr/bin/ld: cannot find -lwx_gtk2u_media-2.8 > collect2: ld returned 1 exit status > rake aborted! > > I think I'm going to have to remove the version of wxwidgets supplied by > PCLinuxOS and do a source install. If anyone knows another way around > this, I'm certainly listening. That should work, following the compile flags given on the wiki. Before going that more drastic step, you could try force-ignoring MediaCtrl rake WXRUBY_EXCLUDED=MediaCtrl,MediaEvent alex From lists at ruby-forum.com Tue Jul 6 12:54:03 2010 From: lists at ruby-forum.com (Michael Satterwhite) Date: Tue, 6 Jul 2010 18:54:03 +0200 Subject: [wxruby-users] require 'wx' fails In-Reply-To: <4C335A27.1020205@pressure.to> References: <10b43d3dea56bb6c0c2180703a99e450@ruby-forum.com> <4C31C327.2070305@pressure.to> <51052b05683506f42b9c794a7b75ea34@ruby-forum.com> <4C335A27.1020205@pressure.to> Message-ID: <5af3732e79cfa9e361cd1b444d53a0b8@ruby-forum.com> Alex Fenton wrote: > Before going that more drastic step, you could try force-ignoring > MediaCtrl > > rake WXRUBY_EXCLUDED=MediaCtrl,MediaEvent Alex, I owe you. That solved the problem and wxruby seems to be working. At least require 'wx' returns true. THANK YOU VERY MUCH! ---Michael -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Jul 7 02:39:56 2010 From: lists at ruby-forum.com (Utkarsh Sengar) Date: Wed, 7 Jul 2010 08:39:56 +0200 Subject: [wxruby-users] Cannot load wxruby in IRB Message-ID: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> Hi, I am new to ruby and trying to make a simple desktop app using wxruby. When I do: require 'wx' I get this error: irb(main):001:0> require 'wx' LoadError: dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle, 9): no suitable image found. Did find: /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle: no matching architecture in universal wrapper - /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wx.rb:12:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wx.rb:12:in `' from (irb):1:in `require' from (irb):1 from /usr/local/bin/irb:12:in `
' Any suggestions? Thanks -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Jul 7 04:42:43 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 07 Jul 2010 09:42:43 +0100 Subject: [wxruby-users] Custom event problem. In-Reply-To: <20100705165733.050c82dd@cybert.demosophia.net> References: <20100705165733.050c82dd@cybert.demosophia.net> Message-ID: <4C343E03.3080504@pressure.to> On 05/07/2010 15:57, Svend Haugaard S?rensen wrote: > I have some problem making a custom event. > > It seem like the initilizer is not visible > in the scope. Why is that? > For some reason the allocator (constructor) function for Wx::Event is undefined - I've just checked the sources and I don't know why SWIG is doing that. It may be a regression. Can you inherit from Wx::CommandEvent or some other Event class instead. You are calling super with the parameters for Wx::CE anyway. That works fine for me (as per the sample). PS - at line 21 you call Wx::EvtHandler.process_event. #process_event is an instance method, not a class method. Every Window, plus the App, has an event_handler (with an accessor). You pass the event to one of those, normally the one where the event originates so that it can bubble upwards. hth alex From alex at pressure.to Wed Jul 7 04:45:47 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 07 Jul 2010 09:45:47 +0100 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> Message-ID: <4C343EBB.5080400@pressure.to> Hi On 07/07/2010 07:39, Utkarsh Sengar wrote: > I am new to ruby and trying to make a simple desktop app using wxruby. > Welcome. > When I do: require 'wx' I get this error: > Unfortunately, you can't use wx interactively in irb. A gui app depends on entering an 'event loop' where it waits for the user to do something. This will just hang in irb. > irb(main):001:0> require 'wx' > LoadError: > dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle, > What OS X version are you on? 1.9.3 is a very old version, the current release is 2.0.1. You may be on Snow Leopard (10.6) in which case you'll need to look in the recent m.l. archives for a user-contributed gem - unfortunately I haven't got the trunk stable to build on this version yet. alex From lists at ruby-forum.com Wed Jul 7 05:19:03 2010 From: lists at ruby-forum.com (Mr zengr) Date: Wed, 7 Jul 2010 11:19:03 +0200 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: <4C343EBB.5080400@pressure.to> References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> <4C343EBB.5080400@pressure.to> Message-ID: Thanks for the info Alex. I am running Mac OS X 10.6. I dug up the archives and got the 2.0.1 for 10.6 here: http://www.ruby-forum.com/topic/199011#905045 I installed the gem: sudo gem install wxruby-2.0.1-universal-darwin-10.gem Regarding "require 'wx'" in irb, I was just testing if I will be able to use wx in my ruby code or not. I guess, ONLY "require 'wx'" should give me a ->true right? So, after installing 2.0.1 and doing a "require 'wx'", i got this error: irb(main):001:0> require 'wx' LoadError: dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle, 9): Symbol not found: __ZN10wxCheckBox13MacControlHitEPvS0_ Referenced from: /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle Expected in: flat namespace - /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wx.rb:12:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wx.rb:12:in `' from (irb):1:in `require' from (irb):1 from /usr/local/bin/irb:12:in `
' I get the same error if i do a "require 'wx'" in a .rb file and try to run it. Thanks :) Alex Fenton wrote: > Hi > > On 07/07/2010 07:39, Utkarsh Sengar wrote: >> I am new to ruby and trying to make a simple desktop app using wxruby. >> > > Welcome. > >> When I do: require 'wx' I get this error: >> > > Unfortunately, you can't use wx interactively in irb. A gui app depends > on entering an 'event loop' where it waits for the user to do something. > This will just hang in irb. > >> irb(main):001:0> require 'wx' >> LoadError: >> dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle, >> > > What OS X version are you on? 1.9.3 is a very old version, the current > release is 2.0.1. You may be on Snow Leopard (10.6) in which case you'll > need to look in the recent m.l. archives for a user-contributed gem - > unfortunately I haven't got the trunk stable to build on this version > yet. > > alex -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Jul 7 05:34:36 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 07 Jul 2010 10:34:36 +0100 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> <4C343EBB.5080400@pressure.to> Message-ID: <4C344A2C.1020206@pressure.to> On 07/07/2010 10:19, Mr zengr wrote: > Thanks for the info Alex. > > I am running Mac OS X 10.6. I dug up the archives and got the 2.0.1 for > 10.6 here: http://www.ruby-forum.com/topic/199011#905045 > > I installed the gem: > > sudo gem install wxruby-2.0.1-universal-darwin-10.gem > > Regarding "require 'wx'" in irb, I was just testing if I will be able to > use wx in my ruby code or not. I guess, ONLY "require 'wx'" should give > me a ->true right? > Yes. Although ultimately it would be nice to be able to test a GUI design interactively. > So, after installing 2.0.1 and doing a "require 'wx'", i got this error: > > irb(main):001:0> require 'wx' > LoadError: > dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle, > 9): Symbol not found: __ZN10wxCheckBox13MacControlHitEPvS0_ > Sorry, I can't provide support for this gem - I didn't build it. You may be a bit stuck for getting wxRuby working with the system ruby provided in 10.6. Apple has made things difficult by moving to 64-bit architecture, since Carbon (that provides much of wxWidgets 2.8 GUI) is 32-bit only. I'm using 10.6 and for wxRuby applications I'm using my own 32-bit build of Ruby 1.9.1. This works just fine with the gems that are downloadable from Rubyforge. Alternatively I can use the 2.0.1 build by using the arch command - see following post. alex From alex at pressure.to Wed Jul 7 05:40:21 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 07 Jul 2010 10:40:21 +0100 Subject: [wxruby-users] OS X Snow Leopard + wxRuby 2.0.1 gem - WORKING Message-ID: <4C344B85.6000808@pressure.to> Hi It is possible to use the standard wxRuby 2.0.1 gem with the standard system ruby in /usr/bin/ruby in OS X 10.6 1) download the gem http://rubyforge.org/frs/download.php/63386/wxruby-2.0.1-universal-darwin-9.gem 2) install it from the downloaded file sudo gem install wxruby-2.0.1-universal-darwin-9.gem 3) run ruby like this, forcing 32-bit mode arch -i386 ruby -rubygems Have tested with a couple of samples and this works fine. Appreciate any feedback. Of course, we are still aiming to get full compatibility, but for various reasons this is quite difficult. Thanks to some advice on this page (comment #4) http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard alex From lists at ruby-forum.com Wed Jul 7 18:00:07 2010 From: lists at ruby-forum.com (Zhimin Zhan) Date: Thu, 8 Jul 2010 00:00:07 +0200 Subject: [wxruby-users] OS X Snow Leopard + wxRuby 2.0.1 gem - WORKING In-Reply-To: <4C344B85.6000808@pressure.to> References: <4C344B85.6000808@pressure.to> Message-ID: Thanks Alex. Tested it with my app on Snow Leopard, it started OK until "require 'nokogiri'" Here is output: /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle, 9): no suitable image found. Did find: (LoadError) /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle: mach-o, but wrong architecture - /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle I guess that's because Nokogiri is built with 64-bit. Zhimin -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Jul 7 18:42:31 2010 From: lists at ruby-forum.com (Chase Wilson) Date: Thu, 8 Jul 2010 00:42:31 +0200 Subject: [wxruby-users] Second thread working at slow speed Message-ID: I have program that does a bunch of file processing and the GUI froze up every time I ran it. I decided to do the trick of running my main code in a second thread and using the timer to update the gui every 100 ms. However, the problem is that the second thread that I run is working but very very slowly. Much slower than how it normally works. I have the timer: timer = Timer.new(self,ID_ANY) evt_timer(timer.id) {Thread.pass} timer.start(1000) my second thread: newthread = Thread.new do create_prompt_data create_groups create_xls end -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Wed Jul 7 19:27:13 2010 From: mario at ruby-im.net (Mario Steele) Date: Wed, 7 Jul 2010 19:27:13 -0400 Subject: [wxruby-users] OS X Snow Leopard + wxRuby 2.0.1 gem - WORKING In-Reply-To: References: <4C344B85.6000808@pressure.to> Message-ID: That would be correct, you would need a 32 bit copy of nokogiri, in order for it to work properly. On Wed, Jul 7, 2010 at 6:00 PM, Zhimin Zhan wrote: > Thanks Alex. > > Tested it with my app on Snow Leopard, it started OK until "require > 'nokogiri'" > > Here is output: > > /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle: > > dlopen(/Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle, > 9): no suitable image found. Did find: (LoadError) > > /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle: > mach-o, but wrong architecture - > /Library/Ruby/Gems/1.8/gems/nokogiri-1.4.2/lib/nokogiri/nokogiri.bundle > > > I guess that's because Nokogiri is built with 64-bit. > > 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 Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Wed Jul 7 19:28:28 2010 From: mario at ruby-im.net (Mario Steele) Date: Wed, 7 Jul 2010 19:28:28 -0400 Subject: [wxruby-users] Second thread working at slow speed In-Reply-To: References: Message-ID: That's cause whenever you pass the thread to another Ruby thread, it takes time away from the main thread. And since your Processing code is in a Secondary Thread, it gets less time then the Main Thread. On Wed, Jul 7, 2010 at 6:42 PM, Chase Wilson wrote: > I have program that does a bunch of file processing and the GUI froze up > every time I ran it. I decided to do the trick of running my main code > in a second thread and using the timer to update the gui every 100 ms. > However, the problem is that the second thread that I run is working but > very very slowly. Much slower than how it normally works. > > I have the timer: > timer = Timer.new(self,ID_ANY) > evt_timer(timer.id) {Thread.pass} > timer.start(1000) > > my second thread: > newthread = Thread.new do > create_prompt_data > create_groups > create_xls > end > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Jul 8 01:34:24 2010 From: lists at ruby-forum.com (Mr zengr) Date: Thu, 8 Jul 2010 07:34:24 +0200 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: <4C344A2C.1020206@pressure.to> References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> <4C343EBB.5080400@pressure.to> <4C344A2C.1020206@pressure.to> Message-ID: <55d87f032ab1d1b35383a477136de4da@ruby-forum.com> Hi Alex, I checked my ruby version and it was: ruby 1.9.1p0 (2009-01-20 revision 21700) [i386-darwin10.4.0] I followed your directions here: http://www.ruby-forum.com/topic/212707 but it didn't work. Any suggestions? Thanks Alex Fenton wrote: > On 07/07/2010 10:19, Mr zengr wrote: >> use wx in my ruby code or not. I guess, ONLY "require 'wx'" should give >> me a ->true right? >> > > Yes. Although ultimately it would be nice to be able to test a GUI > design interactively. > >> So, after installing 2.0.1 and doing a "require 'wx'", i got this error: >> >> irb(main):001:0> require 'wx' >> LoadError: >> dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-10/lib/wxruby2.bundle, >> 9): Symbol not found: __ZN10wxCheckBox13MacControlHitEPvS0_ >> > > Sorry, I can't provide support for this gem - I didn't build it. > > You may be a bit stuck for getting wxRuby working with the system ruby > provided in 10.6. Apple has made things difficult by moving to 64-bit > architecture, since Carbon (that provides much of wxWidgets 2.8 GUI) is > 32-bit only. > > I'm using 10.6 and for wxRuby applications I'm using my own 32-bit build > of Ruby 1.9.1. This works just fine with the gems that are downloadable > from Rubyforge. Alternatively I can use the 2.0.1 build by using the > arch command - see following post. > > alex -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jul 8 02:07:18 2010 From: lists at ruby-forum.com (Chase Wilson) Date: Thu, 8 Jul 2010 08:07:18 +0200 Subject: [wxruby-users] Second thread working at slow speed In-Reply-To: References: Message-ID: <8d471102d7e7368df9a0a57ab8bc0248@ruby-forum.com> Mario Steele wrote: > That's cause whenever you pass the thread to another Ruby thread, it > takes > time away from the main thread. And since your Processing code is in a > Secondary Thread, it gets less time then the Main Thread. No no, before I had created the second thread my computer would process the data and have a ton of CPU usage. Now with the thread it runs, but very very slowly and hardly any CPU usage. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Jul 8 04:07:57 2010 From: alex at pressure.to (Alex Fenton) Date: Thu, 08 Jul 2010 09:07:57 +0100 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: <55d87f032ab1d1b35383a477136de4da@ruby-forum.com> References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> <4C343EBB.5080400@pressure.to> <4C344A2C.1020206@pressure.to> <55d87f032ab1d1b35383a477136de4da@ruby-forum.com> Message-ID: <4C35875D.5070309@pressure.to> On 08/07/2010 06:34, Mr zengr wrote: > ruby 1.9.1p0 (2009-01-20 revision 21700) [i386-darwin10.4.0] > > I followed your directions here: http://www.ruby-forum.com/topic/212707 > but it didn't work. > What happened? From alex at pressure.to Thu Jul 8 04:16:35 2010 From: alex at pressure.to (Alex Fenton) Date: Thu, 08 Jul 2010 09:16:35 +0100 Subject: [wxruby-users] Second thread working at slow speed In-Reply-To: References: Message-ID: <4C358963.2000607@pressure.to> On 07/07/2010 23:42, Chase Wilson wrote: > I have program that does a bunch of file processing and the GUI froze up > every time I ran it. I decided to do the trick of running my main code > in a second thread and using the timer to update the gui every 100 ms. > Is there any way you can break up the file processing into small discrete tasks? If so, you could could have a queue of jobs and consume them one at a time in an evt_idle loop. This is a more efficient (and simpler) way of keeping the GUI responsive whilst handling long-running tasks. Ruby 1.8 green threads + Wx::Timer has some overhead (thread context switching) and isn't that efficient - it forces switching to the GUI thread when updates aren't needed. > However, the problem is that the second thread that I run is working but > very very slowly. Much slower than how it normally works. > > I have the timer: > timer = Timer.new(self,ID_ANY) > evt_timer(timer.id) {Thread.pass} > timer.start(1000) > This is switching context every 1000ms - i.e. every second. Did you mean timer.start(10) or (simpler, if you don't need later control) Timer.every(10) { Thread.pass } alex From lists at ruby-forum.com Thu Jul 8 04:23:40 2010 From: lists at ruby-forum.com (Mr zengr) Date: Thu, 8 Jul 2010 10:23:40 +0200 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: <4C35875D.5070309@pressure.to> References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> <4C343EBB.5080400@pressure.to> <4C344A2C.1020206@pressure.to> <55d87f032ab1d1b35383a477136de4da@ruby-forum.com> <4C35875D.5070309@pressure.to> Message-ID: <1fdb0ecb58d177bf315c4f744e9031e0@ruby-forum.com> Alex Fenton wrote: > On 08/07/2010 06:34, Mr zengr wrote: >> ruby 1.9.1p0 (2009-01-20 revision 21700) [i386-darwin10.4.0] >> >> I followed your directions here: http://www.ruby-forum.com/topic/212707 >> but it didn't work. >> > > What happened? I am sorry for not detailing the error, when I ran this: arch -i386 ruby -rubygems ruby-file.rb I got this error "arch: posix_spawnp: ruby: Bad CPU type in executable" So, did "uname -m" in my terminal and got i386. So, it seems I am in the 32bit kernel mode. That's why "ruby --version" also returned i386-darwin10.4.0. So, to summarize: 1. I am running 32bit ruby 1.9.1 on Mac OS X 10.6 Snow Leopard 2. I manually installed wxruby (2.0.1 universal-darwin-9) 3. When I do "require 'wx'" I get this error: /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in `require': dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError) /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in `' from ruby-file.rb:1:in `require' from ruby-file.rb:1:in `
' Thanks a lot for your help! -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Jul 8 05:17:43 2010 From: alex at pressure.to (Alex Fenton) Date: Thu, 08 Jul 2010 10:17:43 +0100 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: <1fdb0ecb58d177bf315c4f744e9031e0@ruby-forum.com> References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> <4C343EBB.5080400@pressure.to> <4C344A2C.1020206@pressure.to> <55d87f032ab1d1b35383a477136de4da@ruby-forum.com> <4C35875D.5070309@pressure.to> <1fdb0ecb58d177bf315c4f744e9031e0@ruby-forum.com> Message-ID: <4C3597B7.3090106@pressure.to> On 08/07/2010 09:23, Mr zengr wrote: > 1. I am running 32bit ruby 1.9.1 on Mac OS X 10.6 Snow Leopard > In that case, there should be no problem - just use the standard gem for Ruby 1.9: http://rubyforge.org/frs/download.php/63385/wxruby-ruby19-2.0.1-x86-darwin-9.gem You shouldn't need to mess around with 'arch' b/c both the executable and gem are simple 32-bit (actually, the gem is dual intel/ppc) > 2. I manually installed wxruby (2.0.1 universal-darwin-9) > Sounds like you may have installed the gem for Ruby 1.8 by mistake? From lists at ruby-forum.com Thu Jul 8 08:40:51 2010 From: lists at ruby-forum.com (Zhimin Zhan) Date: Thu, 8 Jul 2010 14:40:51 +0200 Subject: [wxruby-users] OS X Snow Leopard + wxRuby 2.0.1 gem - WORKING In-Reply-To: References: <4C344B85.6000808@pressure.to> Message-ID: <9f6a282c80332f75a588faab2c901c81@ruby-forum.com> Alex & Mario, Yes, My app now works on Snow Leopard (after using 32-bit nokogiri), Thanks! Regards, Zhimin -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jul 8 22:31:27 2010 From: lists at ruby-forum.com (Mr zengr) Date: Fri, 9 Jul 2010 04:31:27 +0200 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: <4C3597B7.3090106@pressure.to> References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> <4C343EBB.5080400@pressure.to> <4C344A2C.1020206@pressure.to> <55d87f032ab1d1b35383a477136de4da@ruby-forum.com> <4C35875D.5070309@pressure.to> <1fdb0ecb58d177bf315c4f744e9031e0@ruby-forum.com> <4C3597B7.3090106@pressure.to> Message-ID: <456e757f14bb68aa377aacc784aafde2@ruby-forum.com> Alex Fenton wrote: > On 08/07/2010 09:23, Mr zengr wrote: >> 1. I am running 32bit ruby 1.9.1 on Mac OS X 10.6 Snow Leopard >> > > In that case, there should be no problem - just use the standard gem for > Ruby 1.9: > > http://rubyforge.org/frs/download.php/63385/wxruby-ruby19-2.0.1-x86-darwin-9.gem I installed this gem and get the same error when I run this (http://wxruby.rubyforge.org/wiki/wiki.pl?Getting_Started) sample code by: $ ruby sample.rb /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wx.rb:12:in `require': dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError) /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle from /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wx.rb:12:in `' from ruby-file.rb:1:in `require' from ruby-file.rb:1:in `
' > > You shouldn't need to mess around with 'arch' b/c both the executable > and gem are simple 32-bit (actually, the gem is dual intel/ppc) > >> 2. I manually installed wxruby (2.0.1 universal-darwin-9) >> > > Sounds like you may have installed the gem for Ruby 1.8 by mistake? I am sorry for my never ending problems, I think i will shift to my Ubuntu VM. Thanks -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Jul 9 07:43:38 2010 From: alex at pressure.to (Alex Fenton) Date: Fri, 09 Jul 2010 12:43:38 +0100 Subject: [wxruby-users] Cannot load wxruby in IRB In-Reply-To: <456e757f14bb68aa377aacc784aafde2@ruby-forum.com> References: <07438afe0f92ef05b9a85508346d5c83@ruby-forum.com> <4C343EBB.5080400@pressure.to> <4C344A2C.1020206@pressure.to> <55d87f032ab1d1b35383a477136de4da@ruby-forum.com> <4C35875D.5070309@pressure.to> <1fdb0ecb58d177bf315c4f744e9031e0@ruby-forum.com> <4C3597B7.3090106@pressure.to> <456e757f14bb68aa377aacc784aafde2@ruby-forum.com> Message-ID: <4C370B6A.1080105@pressure.to> On 09/07/2010 03:31, Mr zengr wrote: > Alex Fenton wrote: > >> In that case, there should be no problem - just use the standard gem for >> Ruby 1.9: > $ ruby sample.rb > > /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wx.rb:12:in > `require': > dlopen(/usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle, > 9): no suitable image found. Did find: (LoadError) > /usr/local/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-darwin-9/lib/wxruby2.bundle: > no matching architecture in universal wrapper - > Hmm - did you compile your Ruby 1.9 under OS X 10.6? This may be the mismatch. My ruby 1.9 (which works with the gem) is a version I compiled before upgrading. There may be some compile flags for Ruby 1.9 to force arch and 10.5 compatibility. But I don't know what they are. Can you use Ruby 1.8? If so, the 10.6 system ruby in /usr/bin/ruby should work with the 1.8 gem, using arch. > I am sorry for my never ending problems, I think i will shift to my > Ubuntu VM. > No problem - I blame Apple! Each platform has its own annoyances, though. alex From real.sergeych at gmail.com Sat Jul 10 02:02:32 2010 From: real.sergeych at gmail.com (Sergey Chernov) Date: Sat, 10 Jul 2010 10:02:32 +0400 Subject: [wxruby-users] distributing and application In-Reply-To: <1da4ee85b7209ab2db80122b4d6d07cd@ruby-forum.com> References: <4C0C952F.9010900@gmx.de> <3776376e95c2cb36402324686c112898@ruby-forum.com> <3775376f58c938f84126cce8b13b6543@ruby-forum.com> <1da4ee85b7209ab2db80122b4d6d07cd@ruby-forum.com> Message-ID: I meant, you can write a great ui using ruby-cocoa, but it won't work anywhere but on ma?, while the intention was, as far as I got, make it work on "3 platforms" Yours, Sergey 21.06.2010, ? 18:53, Sergio Ruiz ???????(?): > Sergey Chernov wrote: >> cocoa is great but there will be "3 platforms" - am I wrong? >> > > not sure what you mean.. > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From lists at ruby-forum.com Sat Jul 10 13:03:13 2010 From: lists at ruby-forum.com (=?utf-8?Q?=c5=81ukasz_Korecki?=) Date: Sat, 10 Jul 2010 19:03:13 +0200 Subject: [wxruby-users] distributing and application In-Reply-To: <3776376e95c2cb36402324686c112898@ruby-forum.com> References: <4C0C952F.9010900@gmx.de> <3776376e95c2cb36402324686c112898@ruby-forum.com> Message-ID: <8b80e85857ff40ad597c7d3b33057e45@ruby-forum.com> > For Mac users I don't know. I never had a Mac. I've created a small github project showing how to package wxRuby app using Platypus (http://www.sveinbjorn.org/platypus). It's very quick and dirty solution, but should work for most cases http://github.com/plugawy/miniwx/ (I'm sorry for any grammar/spelling mistakes - english isn't my first language :-)) ?ukasz -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Mon Jul 12 00:28:39 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Mon, 12 Jul 2010 11:28:39 +0700 Subject: [wxruby-users] grid, press enter move cursor right Message-ID: Dear all I want wxgrid to move cursor right instead of down when I press enter how do I do that? -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From penguinroad at gmail.com Tue Jul 13 01:57:09 2010 From: penguinroad at gmail.com (hendra kusuma) Date: Tue, 13 Jul 2010 12:57:09 +0700 Subject: [wxruby-users] grid, press enter move cursor right In-Reply-To: References: Message-ID: to make it clear I have a grid then I use evt_grid_cell_change() do |event| grid_change(event) end in grid_change(event) I do alot of calculation but I want that after the calculation finish, cursor move right instead of going down I already tried move_cursor_right but it gives me error unless I pass false as parameter, then it will block the cell and the cell right to it but the cursor still going down I am not using table base, just the grid so, how to achieve what I need? On Mon, Jul 12, 2010 at 11:28 AM, hendra kusuma wrote: > Dear all > > I want wxgrid to move cursor right instead of down > when I press enter > > how do I do that? > > -- Suka linux? Kunjungi blog saya http://penguinroad.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From invite+zicz1=l1 at facebookmail.com Mon Jul 19 23:58:21 2010 From: invite+zicz1=l1 at facebookmail.com (Timothy McDowell) Date: Mon, 19 Jul 2010 20:58:21 -0700 Subject: [wxruby-users] Join me on Facebook Message-ID: <51c5b2ad7591c8119d197757d9990ce4@www.facebook.com> Hi General, I have started using Desktop Defender, an application on Facebook, and I think you would like it too. Facebook is a website that lets you connect with your friends, share photos, use applications and more. Thanks, Timothy To sign up for Facebook, follow the link below: http://www.facebook.com/p.php?app_id=113574023556&i=1454766675&k=Z21X5XQ4R2TF4JMFWE6UR5PQT3FJW62M&r Already have an account? Add this email address to your account: http://www.facebook.com/n/?merge_accounts.php&e=wxruby-users%40rubyforge.org&c=4f844b0188d47dd92753f5a82c1837d5 ======================================= wxruby-users at rubyforge.org was invited to join Facebook by Timothy McDowell. If you do not wish to receive this type of email from Facebook in the future, please click on the link below to unsubscribe. http://www.facebook.com/o.php?k=9a3e60&u=1289667093&mid=2af1c0bG4cdec215G0G8 Facebook, Inc. P.O. Box 10005, Palo Alto, CA 94303 -------------- next part -------------- An HTML attachment was scrubbed... URL: From empower at smart.net Wed Jul 21 09:38:10 2010 From: empower at smart.net (Jamal Mazrui) Date: Wed, 21 Jul 2010 09:38:10 -0400 Subject: [wxruby-users] Latest Windows setup Message-ID: <4C46F842.3050202@smart.net> I'm trying to use the latest Ruby for Windows but get the following error when I require wx. ruby.exe - Unable To Locate Component This application has failed to start because msvcrt-ruby18.dll was not found. Re-installing the application may fix this problem. I did a fresh install of Ruby 1.9.1 from RubyInstaller.org, followed by gem install wxruby. I ran irb from the C:\Ruby191\bin directory to make sure I was running the right Ruby version. I noticed that one of the documentation files said there was a bug in the gem installer necessitating a manual install to get the right version, but since that was over a year ago, I was hoping that issue has been corrected. Do I still need to do a manual install? Jamal From alex at pressure.to Wed Jul 21 09:54:34 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 21 Jul 2010 14:54:34 +0100 Subject: [wxruby-users] Latest Windows setup In-Reply-To: <4C46F842.3050202@smart.net> References: <4C46F842.3050202@smart.net> Message-ID: <4C46FC1A.40509@pressure.to> Jamal Mazrui wrote: > I'm trying to use the latest Ruby for Windows but get the following > error when I require wx. > > ruby.exe - Unable To Locate Component > > This application has failed to start because msvcrt-ruby18.dll was not > found. Re-installing the application may fix this problem. > > > I did a fresh install of Ruby 1.9.1 from RubyInstaller.org, followed > by gem install wxruby. I ran irb from the C:\Ruby191\bin directory to > make sure I was running the right Ruby version. It looks like you've installed a Ruby 1.8 gem onto Ruby 1.9. Try gem install wxruby-ruby19 cheers alex From giff.h92 at gmail.com Wed Jul 21 18:14:35 2010 From: giff.h92 at gmail.com (Hameed Gifford) Date: Wed, 21 Jul 2010 18:14:35 -0400 Subject: [wxruby-users] Error when loading wxruby Message-ID: <1279750475.12426.6.camel@hamstap85-laptop> I've had plenty of wonderful experience with WxRuby on a PC, but whenever I try it on my Ubuntu Linux, I get the same error. I've tried two different computers, and they do the same thing, so I'm wondering if it's an error within Wx. This is the error I get: /var/lib/gems/1.9.1/gems/wxruby-ruby19-2.0.0-x86_64-linux/lib/wx.rb:12:in `require': libwx_gtk2u_stc-2.8.so.0: cannot open shared object file: No such file or directory - /var/lib/gems/1.9.1/gems/wxruby-ruby19-2.0.0-x86_64-linux/lib/wxruby2.so (LoadError) from /var/lib/gems/1.9.1/gems/wxruby-ruby19-2.0.0-x86_64-linux/lib/wx.rb:12:in `' from /home/username/Documents/Projects/Ruby/ProjectName/lib/main.rb:1:in `require' from /home/username/Documents/Projects/Ruby/ProjectName/lib/main.rb:1:in `
' I'm using Ubuntu 10.04, NetBeans 6.9, Ruby 1.9.1, RubyGems 1.3.5, and everything sees each other just perfectly. No problems with the RubyGems platform in NetBeans. However, as you see from the error, WxRuby19 is version 2.0.0 instead of 2.0.1, and for whatever reason, when I try to install 2.0.1 it jumps back to 2.0.0, and when I try to update, it says 'nothing to update'. Should I unpack the 2.0.1 archive manually into the rubygems directory, and see if that fixes anything? - Hameed From empower at smart.net Fri Jul 23 08:58:26 2010 From: empower at smart.net (Jamal Mazrui) Date: Fri, 23 Jul 2010 08:58:26 -0400 Subject: [wxruby-users] Latest Windows setup In-Reply-To: <4C46FC1A.40509@pressure.to> References: <4C46F842.3050202@smart.net> <4C46FC1A.40509@pressure.to> Message-ID: <4C4991F2.2040507@smart.net> Thanks -- that worked. I found that I also had to gem uninstall wxruby Is it still necessary to require rubygems if wxruby was installed as a gem? A test program seems to run fine without that, but I want to make sure there are not negative side effects. Jamal On 7/21/2010 9:54 AM, Alex Fenton wrote: > Jamal Mazrui wrote: >> I'm trying to use the latest Ruby for Windows but get the following >> error when I require wx. >> >> ruby.exe - Unable To Locate Component >> >> This application has failed to start because msvcrt-ruby18.dll was not >> found. Re-installing the application may fix this problem. >> >> >> I did a fresh install of Ruby 1.9.1 from RubyInstaller.org, followed >> by gem install wxruby. I ran irb from the C:\Ruby191\bin directory to >> make sure I was running the right Ruby version. > > It looks like you've installed a Ruby 1.8 gem onto Ruby 1.9. Try gem > install wxruby-ruby19 > > cheers > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From bdloving at uncg.edu Fri Jul 23 16:03:40 2010 From: bdloving at uncg.edu (Bruce Loving) Date: Fri, 23 Jul 2010 16:03:40 -0400 Subject: [wxruby-users] using listcontrol Message-ID: hi, i a new to wxRuby, but have been able to create a frame/listcontrol and fill the list with items. What I do not understand is why the vertical scroll bar on the list does not respond? I have 15 items showing and 50 in the list. Do I need some event to activatte it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Fri Jul 23 16:25:48 2010 From: mario at ruby-im.net (Mario Steele) Date: Fri, 23 Jul 2010 16:25:48 -0400 Subject: [wxruby-users] Latest Windows setup In-Reply-To: <4C4991F2.2040507@smart.net> References: <4C46F842.3050202@smart.net> <4C46FC1A.40509@pressure.to> <4C4991F2.2040507@smart.net> Message-ID: Hello Jamal, It is best to require rubygems, as generally not all systems have RUBYOPT set, which is the Environment variable that contains the -rubygems option, which is more then likely setup on your system. If RUBYOPT isn't set, then RubyGems is never required. hth, Mario On Fri, Jul 23, 2010 at 8:58 AM, Jamal Mazrui wrote: > Thanks -- that worked. I found that I also had to > gem uninstall wxruby > > Is it still necessary to require rubygems if wxruby was installed as a gem? > A test program seems to run fine without that, but I want to make sure > there are not negative side effects. > > Jamal > > > On 7/21/2010 9:54 AM, Alex Fenton wrote: > >> Jamal Mazrui wrote: >> >>> I'm trying to use the latest Ruby for Windows but get the following >>> error when I require wx. >>> >>> ruby.exe - Unable To Locate Component >>> >>> This application has failed to start because msvcrt-ruby18.dll was not >>> found. Re-installing the application may fix this problem. >>> >>> >>> I did a fresh install of Ruby 1.9.1 from RubyInstaller.org, followed >>> by gem install wxruby. I ran irb from the C:\Ruby191\bin directory to >>> make sure I was running the right Ruby version. >>> >> >> It looks like you've installed a Ruby 1.8 gem onto Ruby 1.9. Try gem >> install wxruby-ruby19 >> >> cheers >> alex >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Fri Jul 23 16:27:26 2010 From: mario at ruby-im.net (Mario Steele) Date: Fri, 23 Jul 2010 16:27:26 -0400 Subject: [wxruby-users] using listcontrol In-Reply-To: References: Message-ID: It is hard for us to diagnose the problem, without a minimal sample of code, to go by. If you could, please create a minimal sample that replicates the problem, and send the code in your email to the list, and we will be able to figure out what is going on. Try not to post the original code, as it tends to have other stuff in there, that we don't need to replicate the problem. Thanks, Mario On Fri, Jul 23, 2010 at 4:03 PM, Bruce Loving wrote: > hi, i a new to wxRuby, but have been able to create a frame/listcontrol and > fill the list with items. > What I do not understand is why the vertical scroll bar on the list does > not respond? > I have 15 items showing and 50 in the list. Do I need some event to > activatte it? > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From empower at smart.net Fri Jul 23 18:51:26 2010 From: empower at smart.net (Jamal Mazrui) Date: Fri, 23 Jul 2010 18:51:26 -0400 Subject: [wxruby-users] Latest Windows setup In-Reply-To: References: <4C46F842.3050202@smart.net> <4C46FC1A.40509@pressure.to> <4C4991F2.2040507@smart.net> Message-ID: <4C4A1CEE.60803@smart.net> Thanks, Mario and Alex! In this case, I am building a Windows executable with Ocra and Ruby 1.9, so I infer that requiring rubygems is not needed. BTW, I am excited that a contemporary Ruby installer for Windows has finally been released! It had been a bummer having to use an outdated Ruby version on Windows. Now I am exploring compatibility issues. Can anyone confirm that Ruby 1.9.1 for Windows can run Rails without significant problems? Do Watir and Ruport run fine with the latest Ruby for Windows? I realize this is straying from the list subject, but I am not subscribed to any other Ruby lists at present, so hope for any answers I can get. Jamal On 7/23/2010 4:25 PM, Mario Steele wrote: > Hello Jamal, > > It is best to require rubygems, as generally not all systems have > RUBYOPT set, which is the Environment variable that contains the > -rubygems option, which is more then likely setup on your system. If > RUBYOPT isn't set, then RubyGems is never required. > > hth, > Mario > > On Fri, Jul 23, 2010 at 8:58 AM, Jamal Mazrui > wrote: > > Thanks -- that worked. I found that I also had to > gem uninstall wxruby > > Is it still necessary to require rubygems if wxruby was installed as > a gem? A test program seems to run fine without that, but I want to > make sure there are not negative side effects. > > Jamal > > > On 7/21/2010 9:54 AM, Alex Fenton wrote: > > Jamal Mazrui wrote: > > I'm trying to use the latest Ruby for Windows but get the > following > error when I require wx. > > ruby.exe - Unable To Locate Component > > This application has failed to start because > msvcrt-ruby18.dll was not > found. Re-installing the application may fix this problem. > > > I did a fresh install of Ruby 1.9.1 from RubyInstaller.org, > followed > by gem install wxruby. I ran irb from the C:\Ruby191\bin > directory to > make sure I was running the right Ruby version. > > > It looks like you've installed a Ruby 1.8 gem onto Ruby 1.9. Try gem > install wxruby-ruby19 > > cheers > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > -- > Mario Steele > Lieutenant Commander 3 > XO - Geo 99 > XO - STO IFT Fleet > Chief Engineer - Second Life > http://www.trekfederation.com > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From bdloving at uncg.edu Sun Jul 25 07:52:43 2010 From: bdloving at uncg.edu (Bruce Loving) Date: Sun, 25 Jul 2010 07:52:43 -0400 Subject: [wxruby-users] listcontrol problem Message-ID: trying to create a list control, filling with data, but it wont scroll vertically or respond to mouse click. ------------------------------------------- require 'rubygems' require 'wx' include Wx class MyFrame < Wx::Frame def initialize() super(nil,-1,'Wristband Manager',:size => [300,400]) @my_panel = Panel.new(self) show() end end class MasterList < Wx::ListCtrl def initialize(parent) super(parent,:size => [250,200],:style => Wx::LC_REPORT) create_layout add_entries end def create_layout self.insert_column(0, "Name") self.insert_column(1, "Courses") self.insert_column(2, "Band") self.set_column_width(0,100) self.set_column_width(1,25) self.set_column_width(2,50) end def add_entries name = 'Test01' 50.times do |idx| item0 = Wx::ListItem.new item0.set_text(name) item0.set_column(0) item0.set_id(idx) self.insert_item(item0) item1 = Wx::ListItem.new item1.set_text("15") item1.set_column(1) item1.set_id(idx) self.set_item(item1) item1 = Wx::ListItem.new item1.set_text("Green") item1.set_column(2) item1.set_id(idx) self.set_item(item1) name.succ! end end end class MyApp < App def on_init frame1 = MyFrame.new MasterList.new frame1 end end MyApp.new.main_loop() -------------- next part -------------- An HTML attachment was scrubbed... URL: From giff.h92 at gmail.com Sun Jul 25 12:36:40 2010 From: giff.h92 at gmail.com (Hameed Gifford) Date: Sun, 25 Jul 2010 12:36:40 -0400 Subject: [wxruby-users] listcontrol problem In-Reply-To: References: Message-ID: <1280075800.2468.24.camel@hamstap85-laptop> Okay, I'm noticing a few things here: 1. include Wx # if you have this, you don't have to have Wx:: in front of Wx classes or modules 2. # in MasterList#add_entries item1 = Wx::ListItem.new item1.set_text("Green") # ... name.succ! end # you might want to find a different local name for this ListItem, since it might be interfering with the one above it, unless that's what you intend. 3. # in My_App#on_init MasterList.new frame1 # you might want to create the master list within frame1, and set parent to self If those don't do anything, let someone else tell you what to do. - Hameed On Sun, 2010-07-25 at 07:52 -0400, Bruce Loving wrote: > trying to create a list control, filling with data, but it wont scroll > vertically or respond to mouse click. > ------------------------------------------- > require 'rubygems' > require 'wx' > include Wx > > class MyFrame < Wx::Frame > def initialize() > super(nil,-1,'Wristband Manager',:size => [300,400]) > @my_panel = Panel.new(self) > show() > end > end > > class MasterList < Wx::ListCtrl > def initialize(parent) > super(parent,:size => [250,200],:style => Wx::LC_REPORT) > create_layout > add_entries > end > > def create_layout > self.insert_column(0, "Name") > self.insert_column(1, "Courses") > self.insert_column(2, "Band") > self.set_column_width(0,100) > self.set_column_width(1,25) > self.set_column_width(2,50) > end > > def add_entries > name = 'Test01' > 50.times do |idx| > item0 = Wx::ListItem.new > item0.set_text(name) > item0.set_column(0) > item0.set_id(idx) > self.insert_item(item0) > > item1 = Wx::ListItem.new > item1.set_text("15") > item1.set_column(1) > item1.set_id(idx) > self.set_item(item1) > > item1 = Wx::ListItem.new > item1.set_text("Green") > item1.set_column(2) > item1.set_id(idx) > self.set_item(item1) > name.succ! > end > end > > > end > > class MyApp < App > def on_init > frame1 = MyFrame.new > MasterList.new frame1 > end > end > > MyApp.new.main_loop() > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From bdloving at uncg.edu Sun Jul 25 12:56:59 2010 From: bdloving at uncg.edu (Bruce Loving) Date: Sun, 25 Jul 2010 12:56:59 -0400 Subject: [wxruby-users] listcontrol problem In-Reply-To: <1280075800.2468.24.camel@hamstap85-laptop> References: <1280075800.2468.24.camel@hamstap85-laptop> Message-ID: Thanks, #3 did the trick! On Sun, Jul 25, 2010 at 12:36 PM, Hameed Gifford wrote: > Okay, I'm noticing a few things here: > > 1. > include Wx # if you have this, you don't have to have Wx:: in front of > Wx classes or modules > > 2. > # in MasterList#add_entries > item1 = Wx::ListItem.new > item1.set_text("Green") > # ... > name.succ! > end > # you might want to find a different local name for this ListItem, since > it might be interfering with the one above it, unless that's what you > intend. > > 3. > # in My_App#on_init > MasterList.new frame1 # you might want to create the master list within > frame1, and set parent to self > > > If those don't do anything, let someone else tell you what to do. > > - Hameed > > > On Sun, 2010-07-25 at 07:52 -0400, Bruce Loving wrote: > > trying to create a list control, filling with data, but it wont scroll > > vertically or respond to mouse click. > > ------------------------------------------- > > require 'rubygems' > > require 'wx' > > include Wx > > > > class MyFrame < Wx::Frame > > def initialize() > > super(nil,-1,'Wristband Manager',:size => [300,400]) > > @my_panel = Panel.new(self) > > show() > > end > > end > > > > class MasterList < Wx::ListCtrl > > def initialize(parent) > > super(parent,:size => [250,200],:style => Wx::LC_REPORT) > > create_layout > > add_entries > > end > > > > def create_layout > > self.insert_column(0, "Name") > > self.insert_column(1, "Courses") > > self.insert_column(2, "Band") > > self.set_column_width(0,100) > > self.set_column_width(1,25) > > self.set_column_width(2,50) > > end > > > > def add_entries > > name = 'Test01' > > 50.times do |idx| > > item0 = Wx::ListItem.new > > item0.set_text(name) > > item0.set_column(0) > > item0.set_id(idx) > > self.insert_item(item0) > > > > item1 = Wx::ListItem.new > > item1.set_text("15") > > item1.set_column(1) > > item1.set_id(idx) > > self.set_item(item1) > > > > item1 = Wx::ListItem.new > > item1.set_text("Green") > > item1.set_column(2) > > item1.set_id(idx) > > self.set_item(item1) > > name.succ! > > end > > end > > > > > > end > > > > class MyApp < App > > def on_init > > frame1 = MyFrame.new > > MasterList.new frame1 > > end > > end > > > > MyApp.new.main_loop() > > > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From giff.h92 at gmail.com Mon Jul 26 01:09:41 2010 From: giff.h92 at gmail.com (Hameed Gifford) Date: Mon, 26 Jul 2010 01:09:41 -0400 Subject: [wxruby-users] listcontrol problem In-Reply-To: References: <1280075800.2468.24.camel@hamstap85-laptop> Message-ID: <1280120981.10446.2.camel@hamstap85-laptop> No prob. Generally, you want to create window object within the initialize of the parent object. Keeps problems from happening. On Sun, 2010-07-25 at 12:56 -0400, Bruce Loving wrote: > Thanks, #3 did the trick! > > On Sun, Jul 25, 2010 at 12:36 PM, Hameed Gifford > wrote: > Okay, I'm noticing a few things here: > > 1. > include Wx # if you have this, you don't have to have Wx:: in > front of > Wx classes or modules > > 2. > # in MasterList#add_entries > item1 = Wx::ListItem.new > item1.set_text("Green") > > # ... > name.succ! > end > # you might want to find a different local name for this > ListItem, since > it might be interfering with the one above it, unless that's > what you > intend. > > 3. > # in My_App#on_init > MasterList.new frame1 # you might want to create the master > list within > frame1, and set parent to self > > > If those don't do anything, let someone else tell you what to > do. > > - Hameed > > > > On Sun, 2010-07-25 at 07:52 -0400, Bruce Loving wrote: > > trying to create a list control, filling with data, but it > wont scroll > > vertically or respond to mouse click. > > ------------------------------------------- > > require 'rubygems' > > require 'wx' > > include Wx > > > > class MyFrame < Wx::Frame > > def initialize() > > super(nil,-1,'Wristband Manager',:size => [300,400]) > > @my_panel = Panel.new(self) > > show() > > end > > end > > > > class MasterList < Wx::ListCtrl > > def initialize(parent) > > super(parent,:size => [250,200],:style => > Wx::LC_REPORT) > > create_layout > > add_entries > > end > > > > def create_layout > > self.insert_column(0, "Name") > > self.insert_column(1, "Courses") > > self.insert_column(2, "Band") > > self.set_column_width(0,100) > > self.set_column_width(1,25) > > self.set_column_width(2,50) > > end > > > > def add_entries > > name = 'Test01' > > 50.times do |idx| > > item0 = Wx::ListItem.new > > item0.set_text(name) > > item0.set_column(0) > > item0.set_id(idx) > > self.insert_item(item0) > > > > item1 = Wx::ListItem.new > > item1.set_text("15") > > item1.set_column(1) > > item1.set_id(idx) > > self.set_item(item1) > > > > item1 = Wx::ListItem.new > > item1.set_text("Green") > > item1.set_column(2) > > item1.set_id(idx) > > self.set_item(item1) > > name.succ! > > end > > end > > > > > > end > > > > class MyApp < App > > def on_init > > frame1 = MyFrame.new > > MasterList.new frame1 > > end > > end > > > > MyApp.new.main_loop() > > > > > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From bdloving at uncg.edu Mon Jul 26 18:07:40 2010 From: bdloving at uncg.edu (Bruce Loving) Date: Mon, 26 Jul 2010 18:07:40 -0400 Subject: [wxruby-users] wxruby messagedialog box Message-ID: any way to keep a dialog box inside its parent, instead of centered on the screen? require 'rubygems' require 'wx' include Wx class MyFrame < Frame def initialize() super(nil,-1,'Wristband Manager',:size => [400,600]) @my_panel = Panel.new(self) @mybutton = Button.new(self,-1,'click') evt_button(@mybutton) {onclick} show end def onclick diagYesno = MessageDialog.new(self,'are you sure','Process Request',YES_NO) case diagYesno.show_modal when Wx::ID_YES yesno = 'Yes' when Wx::ID_NO yesno = 'No' end puts yesno end end class MyApp < App def on_init frame1 = MyFrame.new end end ### Main Logic MyApp.new.main_loop() -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Mon Jul 26 18:35:23 2010 From: alex at pressure.to (Alex Fenton) Date: Mon, 26 Jul 2010 23:35:23 +0100 Subject: [wxruby-users] wxruby messagedialog box In-Reply-To: References: Message-ID: <4C4E0DAB.6090306@pressure.to> hi On 26/07/2010 23:07, Bruce Loving wrote: > any way to keep a dialog box inside its parent, instead of centered on > the screen? Try calling centre_on_parent() - or center_on_parent(), if you're that way inclined Dialog inherits this method from Wx::Window cheers alex From mario at ruby-im.net Tue Jul 27 07:10:56 2010 From: mario at ruby-im.net (Mario Steele) Date: Tue, 27 Jul 2010 07:10:56 -0400 Subject: [wxruby-users] wxruby messagedialog box In-Reply-To: <4C4E0DAB.6090306@pressure.to> References: <4C4E0DAB.6090306@pressure.to> Message-ID: You will need to do this, before you call show_modal, as show_modal will open the dialog, and wait for a User Response, before returning control back to your program, so just after the creation of your Dialog Object, you would call #centre_on_parent() or #center_on_parent(). On Mon, Jul 26, 2010 at 6:35 PM, Alex Fenton wrote: > hi > > > On 26/07/2010 23:07, Bruce Loving wrote: > >> any way to keep a dialog box inside its parent, instead of centered on the >> screen? >> > > Try calling centre_on_parent() - or center_on_parent(), if you're that way > inclined > > Dialog inherits this method from Wx::Window > > cheers > alex > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele Lieutenant Commander 3 XO - Geo 99 XO - STO IFT Fleet Chief Engineer - Second Life http://www.trekfederation.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bdloving at uncg.edu Tue Jul 27 09:55:53 2010 From: bdloving at uncg.edu (Bruce Loving) Date: Tue, 27 Jul 2010 09:55:53 -0400 Subject: [wxruby-users] wxruby messagedialog box In-Reply-To: References: <4C4E0DAB.6090306@pressure.to> Message-ID: hm, ok, read the docs, but it still doesnt center on parent also, how come button fills whole frame? require 'rubygems' require 'wx' include Wx class MyFrame < Frame def initialize() super(nil,-1,'The Rabbit Hole',:size => [300,300]) @diagYesno = MessageDialog.new(self,'are you sure','White Rabbit asks',YES_NO) @diagYesno.center_on_parent(BOTH) #@my_panel = Panel.new(self) @mybutton = Button.new(self,-1,'Drink Me',:pos =>[2,2],:size => [30,20]) evt_button(@mybutton) {onclick} show end def onclick case @diagYesno.show_modal when Wx::ID_YES yesno = 'Yes' when Wx::ID_NO yesno = 'No' end puts yesno end end class MyApp < App def on_init frame1 = MyFrame.new end end ### Main Logic MyApp.new.main_loop() -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Jul 27 16:05:40 2010 From: lists at ruby-forum.com (=?utf-8?Q?=c5=81ukasz_Korecki?=) Date: Tue, 27 Jul 2010 22:05:40 +0200 Subject: [wxruby-users] Dynamicaly loading panels Message-ID: <82380aef0b4910f6b7e885a578136a0c@ruby-forum.com> Hi I have created my GUI using wxFormBuilder. One of elements I've created is a panel which contains two labels and a button - this whole "widget" can be loaded through XRC into a standalone class (generated using Xrcise). Now - adding one one is quite easy: # create a new instance of the template, @content_panel is a panel on the main window (and has one vertical box sizer) status = StatusTemplate.new(@content_panel) status.data= item # my custom method for loading data to the widget status.show # show it However when I try to add it few times (in a loop or just by duplicating this code) it doesn't work. Only the most recently added panel can be seen. Any thoughts? -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Jul 28 02:00:06 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 28 Jul 2010 07:00:06 +0100 Subject: [wxruby-users] Dynamicaly loading panels In-Reply-To: <82380aef0b4910f6b7e885a578136a0c@ruby-forum.com> References: <82380aef0b4910f6b7e885a578136a0c@ruby-forum.com> Message-ID: <4C4FC766.8050402@pressure.to> On 27/07/2010 21:05, ?ukasz Korecki wrote: > One of elements I've created is a panel which contains two labels and a > button - this whole "widget" can be loaded through XRC into a standalone > class (generated using Xrcise). > > Now - adding one one is quite easy: > > # create a new instance of the template, @content_panel is a > panel on the main window (and has one vertical box sizer) > status = StatusTemplate.new(@content_panel) > status.data= item # my custom method for loading data to the > widget > status.show # show it > (This probably isn't needed - apart from Frames/Dialogs everything else starts off shown) > However when I try to add it few times (in a loop or just by duplicating > this code) it doesn't work. Only the most recently added panel can be > seen. > You don't show the code where you add it to the sizer - you have got that? Check the sizer.add parameters, and see what happens if you run the same code twice immediately. You may then need to use sizer.layout() to update the space given to each. cheers alex From lists at ruby-forum.com Wed Jul 28 04:30:01 2010 From: lists at ruby-forum.com (=?utf-8?Q?=c5=81ukasz_Korecki?=) Date: Wed, 28 Jul 2010 10:30:01 +0200 Subject: [wxruby-users] Dynamicaly loading panels In-Reply-To: <4C4FC766.8050402@pressure.to> References: <82380aef0b4910f6b7e885a578136a0c@ruby-forum.com> <4C4FC766.8050402@pressure.to> Message-ID: >> widget >> status.show # show it >> > > (This probably isn't needed - apart from Frames/Dialogs everything else > starts off shown) ah, good to know. wx widgets docs are quite hard to follow because I forgot everything I knew about c++ > You don't show the code where you add it to the sizer - you have got > that? Check the sizer.add parameters, and see what happens if you run > the same code twice immediately. You may then need to use sizer.layout() > to update the space given to each. I've added a sizer to the parent panel in the wxFormBuilder, but when I try to find it using Windows.find_by_window_id I get nil. Is there a way to get to a sizer contained in the panel? Thanks a lot! -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Jul 28 04:59:04 2010 From: alex at pressure.to (Alex Fenton) Date: Wed, 28 Jul 2010 09:59:04 +0100 Subject: [wxruby-users] Dynamicaly loading panels In-Reply-To: References: <82380aef0b4910f6b7e885a578136a0c@ruby-forum.com> <4C4FC766.8050402@pressure.to> Message-ID: <4C4FF158.1000101@pressure.to> On 28/07/2010 09:30, ?ukasz Korecki wrote: >> You don't show the code where you add it to the sizer - you have got >> that? Check the sizer.add parameters, and see what happens if you run >> the same code twice immediately. You may then need to use sizer.layout() >> to update the space given to each. >> > I've added a sizer to the parent panel in the wxFormBuilder, but when I > try to find it using Windows.find_by_window_id I get nil. Is there a way > to get to a sizer contained in the panel? > A Sizer isn't a Window, so you will get nil back. All Windows are shown on screen and have an id. There are several methods to get hold of an existing sizer: panel.sizer will return the Sizer managing panel's children, panel.containing_sizer will return the sizer which manages panel. Alternately, you can hold onto a reference of the sizer you want with an instance variable (since you're loading from XRC, you might navigate the sizers once at startup, then stuff it into a var for later use). alex From lists at ruby-forum.com Thu Jul 29 16:39:56 2010 From: lists at ruby-forum.com (=?utf-8?Q?=c5=81ukasz_Korecki?=) Date: Thu, 29 Jul 2010 22:39:56 +0200 Subject: [wxruby-users] Dynamicaly loading panels In-Reply-To: <4C4FF158.1000101@pressure.to> References: <82380aef0b4910f6b7e885a578136a0c@ruby-forum.com> <4C4FC766.8050402@pressure.to> <4C4FF158.1000101@pressure.to> Message-ID: <23fd3933dbc26fc5906cc24f90b9824f@ruby-forum.com> Alex Fenton wrote: > A Sizer isn't a Window, so you will get nil back. All Windows are shown > on screen and have an id. > Ah - that explains it all then. btw. naming widgets "windows" is only more confusing - odd choice I have to say. > There are several methods to get hold of an existing sizer: panel.sizer > will return the Sizer managing panel's children, panel.containing_sizer > will return the sizer which manages panel. > ...and that did the trick: status = StatusTemplate.new(@content_panel) status.data= item # my custom method for loading data to the widget @content_panel.sizer.add status Now I can elements to the list dynamically. (Now I have to work out how to work with scrollbars ;-)) Thank you very much for your help Alex! ?ukasz -- Posted via http://www.ruby-forum.com/.