From davidp at touringcyclist.com Sun Mar 1 12:55:16 2009 From: davidp at touringcyclist.com (David Peoples) Date: Sun, 01 Mar 2009 11:55:16 -0600 Subject: [wxruby-users] set_size doesn't work inside initialize block Message-ID: <1235930116.24699.17.camel@guppy> I'm putting a ListCtrl in a Frame, creating the ListCtrl during Frame.initialize(). I want to adjust the ListCtrl's height to fit the number of rows the control contains, not just hardcode the height (presuming the control's font will be different on different systems). I get the row height with ListCtrl.get_item_rect, calculate the new size, and call set_size. But that call has no effect. Is there a way around this? (I suppose I can make a temporary ListCtrl in the block, calculate the size from it, then destroy the temporary control, to work around this. But I'd prefer something less of a hack.) Here is sample code: require 'wx' include Wx class MinimalFrame < Frame def initialize(title) super(nil, :title => title, :size => [ 400, 400 ]) border_box = BoxSizer.new(HORIZONTAL) self.sizer = border_box @list_ctrl = ListCtrl.new(self, ID_ANY, DEFAULT_POSITION, Size.new(100, 100), LC_REPORT | LC_SINGLE_SEL | LC_HRULES | LC_VRULES, DEFAULT_VALIDATOR, "list_ctrl") @list_ctrl.set_size(Size.new(300,300)) border_box.add(@list_ctrl, 0, ALIGN_TOP | ALL, 10) end end App.run do self.app_name = 'Minimal' frame = MinimalFrame.new("Minimal wxRuby App") frame.show end # Calling set_size outside the initialize block # (such as in a menu event handler) *does* cause # the ListCtrl to resize. David Peoples From lists at ruby-forum.com Sun Mar 1 13:40:21 2009 From: lists at ruby-forum.com (Rooby Nooby) Date: Sun, 1 Mar 2009 19:40:21 +0100 Subject: [wxruby-users] wxRuby 2.0.0 released In-Reply-To: <49A94035.9040005@pressure.to> References: <49A94035.9040005@pressure.to> Message-ID: <81a9a7b0f386915f884fe2a0635780f9@ruby-forum.com> Hi Alex Congrats on the new release. Many thanks to yourself and the other contributors for your hard work and dedication. It's good to know that the wxRuby project is alive and thriving and I wish you continued success. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Sun Mar 1 13:41:17 2009 From: alex at pressure.to (Alex Fenton) Date: Sun, 01 Mar 2009 18:41:17 +0000 Subject: [wxruby-users] set_size doesn't work inside initialize block In-Reply-To: <1235930116.24699.17.camel@guppy> References: <1235930116.24699.17.camel@guppy> Message-ID: <49AAD6CD.9080403@pressure.to> David Peoples wrote: > I'm putting a ListCtrl in a Frame, creating the ListCtrl during > Frame.initialize(). I want to adjust the ListCtrl's height to fit the > number of rows the control contains, not just hardcode the height > (presuming the control's font will be different on different systems). You're using Sizers, which means you're renouncing explicitly setting pixel size in favour of allowing the sizer to manage platform differences and the user resizing the window. This is probably why your set_size call isn't working. If you want to control the height allocated to the ListCtrl within the sizer, specify its minimum size like this: @list_ctrl.min_size = 200, 200 And add it to the sizer with a proportion of 0 (ie, minimum size only) - as you have at the moment. Whenever you need to change the height, just call min_size= again, and then layout() the sizer. a From lists at ruby-forum.com Tue Mar 3 20:53:40 2009 From: lists at ruby-forum.com (Tim Ferrell) Date: Wed, 4 Mar 2009 02:53:40 +0100 Subject: [wxruby-users] constants not recognized? Message-ID: <8560fc1d9f17a116c20d135ca0f1bf89@ruby-forum.com> I just upgraded to wxRuby 2 and am having the following issue... With code like this: dd = Wx::DirDialog.new(@dialog, 'Select the folder to process...', File.join(@home, 'Desktop'), Wx::DD_DEFAULT_STYLE | Wx::DD_DIR_MUST_EXIST | Wx::DD_CHANGE_DIR) dd.show_modal == Wx::ID_OK ? @basedir = dd.get_path : exit I get the following error: uninitialized constant Wxruby2::DD_DEFAULT_STYLE (NameError) When I remove the style flags I get no such error... Ideas? I am on Mac OS X and I installed via the rubyforge gem... -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Mar 4 12:19:10 2009 From: lists at ruby-forum.com (Zignus Arcanniss) Date: Wed, 4 Mar 2009 18:19:10 +0100 Subject: [wxruby-users] a very simple wxRuby loading a xrc file Message-ID: Greetings, I am trying to get a very simple .xrc file to load with no interaction. This does run, but it will not exit cleanly. Can someone please help me? I have been making progress, but I just cannot seem to get that last bit. I am very new to wxruby. Thanks, Zignus samples.xrc 400,300 Sample 1 wxHORIZONTAL wxALIGN_CENTER_VERTICAL|wxALL 5 wxVERTICAL wxALIGN_CENTER_HORIZONTAL|wxALL 5 wxALIGN_CENTER_HORIZONTAL|wxALL 5 wxALIGN_CENTER_HORIZONTAL|wxALL 5 wxALIGN_CENTER_HORIZONTAL|wxALL 5 zignus.sample.rbw require 'wxruby' # # Application class. # class XrcApp < Wx::App def on_init Wx::init_all_image_handlers() # Initializes handlers for all supported controls/windows. In wxRuby versions 1.9.6 and later, this is called automatically for you, so there is no need to call this method xml = Wx::XmlResource.get() #Loads resources from the XML file file. If this file does not exist, or contains invalid XML, an exception will be raised; if successful, the loaded file name will be returneed. xml.init_all_handlers() #Initializes handlers for all supported controls/windows. In wxRuby versions 1.9.6 and later, this is called automatically for you, so there is no need to call this method xml.load("samples.xrc") #Loads resources from the XML file file. If this file does not exist, or contains invalid XML, an exception will be raised; if successful, the loaded file name will be returneed. # # Show the main frame. # frame = Wx::Frame.new(nil, -1, "Sample" ) #create the window frame.set_client_size(Wx::Size.new(200,200)) #sets the size of the window #sizer = Wx::BoxSizer.new(Wx::VERTICAL) xml.load_dialog_subclass(frame, nil, 'SAMPLE_DIALOG') #loads in the .xrc into the window! Yea!! #frame.set_sizer(sizer) frame.show() end end =begin =end XrcApp.new().main_loop() #Create a new object with no name from 'XrcApp' class and places in a loop. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Mar 4 13:53:42 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 04 Mar 2009 18:53:42 +0000 Subject: [wxruby-users] constants not recognized? In-Reply-To: <8560fc1d9f17a116c20d135ca0f1bf89@ruby-forum.com> References: <8560fc1d9f17a116c20d135ca0f1bf89@ruby-forum.com> Message-ID: <49AECE36.4090004@pressure.to> Tim Ferrell wrote: > I just upgraded to wxRuby 2 and am having the following issue... With > code like this: > What version did you upgrade from? > dd = Wx::DirDialog.new(@dialog, > 'Select the folder to process...', > File.join(@home, 'Desktop'), > Wx::DD_DEFAULT_STYLE | Wx::DD_DIR_MUST_EXIST | > Wx::DD_CHANGE_DIR) > dd.show_modal == Wx::ID_OK ? @basedir = dd.get_path : exit > > I get the following error: > > uninitialized constant Wxruby2::DD_DEFAULT_STYLE (NameError) Those constants look to be missing, thanks for the report. But I don't believe any recent change has done this. To work around this for now you can add the defines yourself: Wx::DD_DEFAULT_STYLE = Wx::DEFAULT_DIALOG_STYLE|Wx::RESIZE_BORDER Wx::DD_CHANGE_DIR = 0x0100 Wx::DD_DIR_MUST_EXIST = 0x0200 a From lists at ruby-forum.com Wed Mar 4 14:06:46 2009 From: lists at ruby-forum.com (Rooby Nooby) Date: Wed, 4 Mar 2009 20:06:46 +0100 Subject: [wxruby-users] wxRuby 2.0.0 problem Message-ID: <89bba5ce4716bc9e1f05e9d95eed9ff8@ruby-forum.com> Hi all, I'm having a problem getting the new wxRuby 2.0.0 to work. I'm using 64-bit Linux (Fedora) and I initially downloaded the pre-built 64-bit file which didn't work, so I gave up on that. I decided to download the source file and compile that instead, based on my recent experiences with 1.9.8 (see 'Problems running samples') and all the help I received from Alex and Mario. I ran 'rake clean' and 'rake clean_src' beforehand and then 'rake gem WXRUBY_VERSION=2.0.0'. This set the compiler going. I then entered 'sudo gem install wxruby-2.0.0-x86_64-linux.gem'. Let's see if that works... $ ruby minimal.rb /home/russell/.gem/ruby/1.8/gems/wxruby-2.0.0-x86_64-linux/lib/wx/classes/app.rb:16: [BUG] Segmentation fault ruby 1.8.6 (2008-08-11) [x86_64-linux] /usr/libexec/wxruby: No such file or directory. Obviously it didn't work. :-( I've attached a text file from Bug Buddy if it's useful. Any help would be gratefully appreciated. Attachments: http://www.ruby-forum.com/attachment/3387/wxruby-bugreport.txt -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Mar 4 14:09:55 2009 From: lists at ruby-forum.com (Tim Ferrell) Date: Wed, 4 Mar 2009 20:09:55 +0100 Subject: [wxruby-users] constants not recognized? In-Reply-To: <49AECE36.4090004@pressure.to> References: <8560fc1d9f17a116c20d135ca0f1bf89@ruby-forum.com> <49AECE36.4090004@pressure.to> Message-ID: Alex Fenton wrote: > > What version did you upgrade from? > 1.9.5 I think ... but this is new code anyway. I do know that the FD_* constants were working and are not now as well... maybe that helps? > Those constants look to be missing, thanks for the report. But I don't > believe any recent change has done this. > > To work around this for now you can add the defines yourself: > > Wx::DD_DEFAULT_STYLE = Wx::DEFAULT_DIALOG_STYLE|Wx::RESIZE_BORDER > Wx::DD_CHANGE_DIR = 0x0100 > Wx::DD_DIR_MUST_EXIST = 0x0200 > Great - thanks for that! Cheers, Tim -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Mar 4 14:13:57 2009 From: lists at ruby-forum.com (Tim Ferrell) Date: Wed, 4 Mar 2009 20:13:57 +0100 Subject: [wxruby-users] constants not recognized? In-Reply-To: References: <8560fc1d9f17a116c20d135ca0f1bf89@ruby-forum.com> <49AECE36.4090004@pressure.to> Message-ID: Tim Ferrell wrote: > 1.9.5 I think ... but this is new code anyway. I do know that the FD_* > constants were working and are not now as well... maybe that helps? Correction - only Wx::FD_DEFAULT_STYLE seems to be undefined... -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Mar 4 14:23:02 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 04 Mar 2009 19:23:02 +0000 Subject: [wxruby-users] constants not recognized? In-Reply-To: References: <8560fc1d9f17a116c20d135ca0f1bf89@ruby-forum.com> <49AECE36.4090004@pressure.to> Message-ID: <49AED516.4030205@pressure.to> Tim Ferrell wrote: >> 1.9.5 I think ... but this is new code anyway. I do know that the FD_* >> constants were working and are not now as well... maybe that helps? >> I don't think these have ever existed in wxRuby 1.9.x (though they should have). > Correction - only Wx::FD_DEFAULT_STYLE seems to be undefined... > Thanks again: Wx::FD_DEFAULT_STYLE = Wx::FD_OPEN alex From lists at ruby-forum.com Wed Mar 4 14:51:18 2009 From: lists at ruby-forum.com (Tim Ferrell) Date: Wed, 4 Mar 2009 20:51:18 +0100 Subject: [wxruby-users] constants not recognized? In-Reply-To: <49AED516.4030205@pressure.to> References: <8560fc1d9f17a116c20d135ca0f1bf89@ruby-forum.com> <49AECE36.4090004@pressure.to> <49AED516.4030205@pressure.to> Message-ID: <128284f490cb1ef11efa63739ef2a774@ruby-forum.com> Alex Fenton wrote: > I don't think these have ever existed in wxRuby 1.9.x (though they > should have). That is probably the case ... I went back and looked at a deployed app I had and I had used Wx::FD_OPEN instead of Wx::FD_DEFAULT_STYLE then anyway... Thanks! Tim -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Mar 4 17:40:28 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Wed, 4 Mar 2009 23:40:28 +0100 Subject: [wxruby-users] Incompatible encoding from drag and drop? Message-ID: Hi all, I'm trying to get a little app running which receives filenames via drag and drop. While it mostly runs fine, when I'm dropping a file with e.g. german umlauts or french accents (?, ?), I'm not able to open the file given by the droptarget-class. Seemingly the special characters get corrupted. See the small attached program to reproduce my problem. I condensed it to the absolute minimum to evoke the error. Thanks in advance for every hint and forgive me if that's a noobs question! Cheers, Raskolnikov. ruby 1.8.6 wxruby (2.0.0, 1.9.9) Attachments: http://www.ruby-forum.com/attachment/3393/testfolder.zip -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Mar 4 18:41:21 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 04 Mar 2009 23:41:21 +0000 Subject: [wxruby-users] Incompatible encoding from drag and drop? In-Reply-To: References: Message-ID: <49AF11A1.708@pressure.to> Christian Schmidt wrote: > I'm trying to get a little app running which receives filenames via drag > and drop. While it mostly runs fine, when I'm dropping a file with e.g. > german umlauts or french accents (?, ?), I'm not able to open the file > given by the droptarget-class. Seemingly the special characters get > corrupted. > You need to be sure that the text content of the file you're dropping in is in UTF-8 encoding. You should be able to set this in a text editor. If the text isn't in UTF-8, you can read it then convert it to UTF-8 using Ruby's iconv library. > See the small attached program to reproduce my problem. I condensed it > to the absolute minimum to evoke the error. Also, you should return true or false from on_drop_files, to signal to wxRuby whether or not the drop files action succeeded. hth alex From lists at ruby-forum.com Thu Mar 5 04:14:36 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Thu, 5 Mar 2009 10:14:36 +0100 Subject: [wxruby-users] Incompatible encoding from drag and drop? In-Reply-To: <49AF11A1.708@pressure.to> References: <49AF11A1.708@pressure.to> Message-ID: <3d0b31fa449bb78333a4651c1ebfc834@ruby-forum.com> Hi Alex, thank you for the reply! The Problem isn't reading the file but opening it...! The program throws an exception if, for instance, you try to drop the file in the attached zip onto it. My program will read in mp3-files and examine them with id3lib-ruby, so I don't have influence on the file's contents anyway. Thanks in advance, Christian. Alex Fenton wrote: > Christian Schmidt wrote: >> I'm trying to get a little app running which receives filenames via drag >> and drop. While it mostly runs fine, when I'm dropping a file with e.g. >> german umlauts or french accents (?, ?), I'm not able to open the file >> given by the droptarget-class. Seemingly the special characters get >> corrupted. >> > > You need to be sure that the text content of the file you're dropping in > is in UTF-8 encoding. You should be able to set this in a text editor. > > If the text isn't in UTF-8, you can read it then convert it to UTF-8 > using Ruby's iconv library. > >> See the small attached program to reproduce my problem. I condensed it >> to the absolute minimum to evoke the error. > > Also, you should return true or false from on_drop_files, to signal to > wxRuby whether or not the drop files action succeeded. > > hth > alex -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Mar 5 11:07:37 2009 From: lists at ruby-forum.com (Zignus Arcanniss) Date: Thu, 5 Mar 2009 17:07:37 +0100 Subject: [wxruby-users] a very simple wxRuby loading a xrc file In-Reply-To: References: Message-ID: <0e4e2b0aa6db38bb64cb17b124fc5073@ruby-forum.com> I figured some things out. You should use at the top of your Ruby code: require 'wxruby' include Wx Here is my code that works: require 'wxruby' include Wx # Application class. # class XrcApp < Wx::App def on_init Wx::init_all_image_handlers() xml = Wx::XmlResource.get() xml.init_all_handlers() xml.load("SimplePanel.xrc") # # Show the main frame. # frame = Wx::Frame.new( nil, -1, 'Simple' ) frame.set_client_size( Wx::Size.new( 200, 200)) xml.load_panel( frame, 'ID_WXPANEL') frame.show() end end XrcApp.new().main_loop() and I created new .xrc file to go with it. SimplePanel.xrc Simple 1 wxVERTICAL wxALIGN_CENTER_HORIZONTAL|wxALL 5 wxALIGN_CENTER_HORIZONTAL|wxALL 5 wxALIGN_CENTER_HORIZONTAL|wxALL 5 wxALIGN_CENTER_HORIZONTAL|wxALL 5 There it is. Thanks, Zignus -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Mar 5 11:17:01 2009 From: lists at ruby-forum.com (Rooby Nooby) Date: Thu, 5 Mar 2009 17:17:01 +0100 Subject: [wxruby-users] wxRuby 2.0.0 problem In-Reply-To: <89bba5ce4716bc9e1f05e9d95eed9ff8@ruby-forum.com> References: <89bba5ce4716bc9e1f05e9d95eed9ff8@ruby-forum.com> Message-ID: <64d2cbf9db7a798064941d8c66b787a0@ruby-forum.com> Just thought I'd better add that I've now fixed the problem (which was my from own doing), after some investigation. At some stage I must have entered 'gem install...' instead of 'sudo gem install...' which created a gem in my home folder and seemed to confuse things. After deleting the .gem folder and its contents from my home folder, it worked. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Mar 5 11:32:50 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 05 Mar 2009 16:32:50 +0000 Subject: [wxruby-users] a very simple wxRuby loading a xrc file In-Reply-To: <0e4e2b0aa6db38bb64cb17b124fc5073@ruby-forum.com> References: <0e4e2b0aa6db38bb64cb17b124fc5073@ruby-forum.com> Message-ID: <49AFFEB2.7000602@pressure.to> Zignus Arcanniss wrote: > I figured some things out. > You should use at the top of your Ruby code: > require 'wxruby' What version of wxRuby are you using? require 'wxruby' was used for the very old version 0.6.0. I strongly recommend that you use version 2.0.0. The old version is very buggy, has lots of missing features etc. a From alex at pressure.to Thu Mar 5 11:34:59 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 05 Mar 2009 16:34:59 +0000 Subject: [wxruby-users] Incompatible encoding from drag and drop? In-Reply-To: <3d0b31fa449bb78333a4651c1ebfc834@ruby-forum.com> References: <49AF11A1.708@pressure.to> <3d0b31fa449bb78333a4651c1ebfc834@ruby-forum.com> Message-ID: <49AFFF33.2060800@pressure.to> Christian Schmidt wrote: > The Problem isn't reading the file but opening it...! The program throws > an exception if, for instance, you try to drop the file in the attached > zip onto it. OK - it helps if you post the error message you get so we can see what's going wrong. I have a file whose name has accented characters, and it works fine for me (Ruby 1.8, 1.9, OS X, wxRuby 2.0.0). Can you say what platform and version of wxRuby you're using? alex From lists at ruby-forum.com Thu Mar 5 14:17:21 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Thu, 5 Mar 2009 20:17:21 +0100 Subject: [wxruby-users] Incompatible encoding from drag and drop? In-Reply-To: <49AFFF33.2060800@pressure.to> References: <49AF11A1.708@pressure.to> <3d0b31fa449bb78333a4651c1ebfc834@ruby-forum.com> <49AFFF33.2060800@pressure.to> Message-ID: Hi again, it really works on your box? Ok, on my system, when I use the example file, it throws: "No such file or directory - C:\?????.txt" I'm working on XP-Home, SP3. German locales ruby -v: ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] gem list wxruby: wxruby (2.0.0, 1.9.9) Looking forward to your answer, Christian. Alex Fenton wrote: > Christian Schmidt wrote: >> The Problem isn't reading the file but opening it...! The program throws >> an exception if, for instance, you try to drop the file in the attached >> zip onto it. > > OK - it helps if you post the error message you get so we can see what's > going wrong. > > I have a file whose name has accented characters, and it works fine for > me (Ruby 1.8, 1.9, OS X, wxRuby 2.0.0). Can you say what platform and > version of wxRuby you're using? > > alex -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 6 08:16:26 2009 From: lists at ruby-forum.com (Rooby Nooby) Date: Fri, 6 Mar 2009 14:16:26 +0100 Subject: [wxruby-users] wxDatePickerCtrl In-Reply-To: References: <4939A477.1040507@pressure.to> <499AAF42.7020507@pressure.to> Message-ID: Does anyone know if there is any way to show the date in a wxDatePickerCtrl in UK date format (dd/mm/yyyy) rather than the default mm/dd/yyyy? -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Mar 6 10:07:03 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 06 Mar 2009 15:07:03 +0000 Subject: [wxruby-users] Incompatible encoding from drag and drop? In-Reply-To: References: <49AF11A1.708@pressure.to> <3d0b31fa449bb78333a4651c1ebfc834@ruby-forum.com> <49AFFF33.2060800@pressure.to> Message-ID: <49B13C17.4070501@pressure.to> Christian Schmidt wrote: > it really works on your box? > Yes, the reason being that in OS X, file names are encoded in UTF-8, and this is the encoding of the string file name that wxRuby returns. > Ok, on my system, when I use the example file, it throws: > > "No such file or directory - C:\?????.txt" > > I'm working on XP-Home, SP3. German locales > ruby -v: ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] On Windows, file names aren't encoded in UTF-8, but in a local encoding (for me, and probably you, CP1252). So the filename returned by wxRuby doesn't exist. I think we should fix this so that wxRuby methods that accept or return file paths return those strings in an encoding that can be passed straight to Ruby's File/Dir methods. In the meantime, you can work around this by manually converting the filepaths to the correct encoding before opening them: require 'iconv' # at the top of your script files.each do | file | if Wx::PLATFORM == 'WXMSW' file = Iconv.conv('CP1252', 'UTF-8', file) end .... process file as normal end alex From alex at pressure.to Fri Mar 6 10:11:49 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 06 Mar 2009 15:11:49 +0000 Subject: [wxruby-users] wxDatePickerCtrl In-Reply-To: References: <4939A477.1040507@pressure.to> <499AAF42.7020507@pressure.to> Message-ID: <49B13D35.5050408@pressure.to> Rooby Nooby wrote: > Does anyone know if there is any way to show the date in a > wxDatePickerCtrl in UK date format (dd/mm/yyyy) rather than the default > mm/dd/yyyy? > Try adding this somewhere early in your App.run / App#on_init code: Wx::App.run do Wx::Locale.locale = 'en_GB' ... end a From lists at ruby-forum.com Fri Mar 6 10:26:32 2009 From: lists at ruby-forum.com (Rooby Nooby) Date: Fri, 6 Mar 2009 16:26:32 +0100 Subject: [wxruby-users] wxDatePickerCtrl In-Reply-To: <49B13D35.5050408@pressure.to> References: <4939A477.1040507@pressure.to> <499AAF42.7020507@pressure.to> <49B13D35.5050408@pressure.to> Message-ID: Success. Many thanks for your help, and also for recently sorting out the bug with the Date Picker. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Mar 7 05:18:55 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Sat, 7 Mar 2009 11:18:55 +0100 Subject: [wxruby-users] Incompatible encoding from drag and drop? In-Reply-To: <49B13C17.4070501@pressure.to> References: <49AF11A1.708@pressure.to> <3d0b31fa449bb78333a4651c1ebfc834@ruby-forum.com> <49AFFF33.2060800@pressure.to> <49B13C17.4070501@pressure.to> Message-ID: <89829456ddb0aaddc8b2209ae02b730d@ruby-forum.com> Hi Alex, thanks a lot! It works like a charm. Have a nice weekend, Christian. Alex Fenton wrote: > Christian Schmidt wrote: >> it really works on your box? >> > > Yes, the reason being that in OS X, file names are encoded in UTF-8, and > this is the encoding of the string file name that wxRuby returns. >> Ok, on my system, when I use the example file, it throws: >> >> "No such file or directory - C:\?????.txt" >> >> I'm working on XP-Home, SP3. German locales >> ruby -v: ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] > > On Windows, file names aren't encoded in UTF-8, but in a local encoding > (for me, and probably you, CP1252). So the filename returned by wxRuby > doesn't exist. > > I think we should fix this so that wxRuby methods that accept or return > file paths return those strings in an encoding that can be passed > straight to Ruby's File/Dir methods. > > In the meantime, you can work around this by manually converting the > filepaths to the correct encoding before opening them: > > require 'iconv' # at the top of your script > > files.each do | file | > if Wx::PLATFORM == 'WXMSW' > file = Iconv.conv('CP1252', 'UTF-8', file) > end > .... process file as normal > end > > alex -- Posted via http://www.ruby-forum.com/. From davidp at touringcyclist.com Sat Mar 7 11:56:09 2009 From: davidp at touringcyclist.com (David Peoples) Date: Sat, 07 Mar 2009 10:56:09 -0600 Subject: [wxruby-users] StaticText-only Notebook page eats tab key Message-ID: <1236444969.1439.24.camel@guppy> I'm working on the keyboard interface for a small application. The app has several controls on a Panel. One of those controls is a Notebook with 4 pages, each of which is another panel. Three of the tab panels contain ListCtrls, the fourth has only StaticText controls. The Notebook is in the middle of the tab order. When one of the ListCtrl tabs is selected, the tab order progresses normally: through each control before the notebook, then to the notebook's tab, then to the control(s) on that page of the notebook, then back off the notebook to the controls later in the tab order. (The progression with shift-tab is a bit weird -- always to the tab first, *then* backwards through the controls on that page, then back through the controls before the notebook. But I can live with that.) The problem is with the fourth tab that has only StaticText controls. If that tab is visible, the tab progression stops once the notebook is reached. The focus goes to the tab itself like normal, then the next tab key entry makes the focus disappear, and further tab keystrokes do nothing. Sample code below demonstrates the problem. I hadn't noticed it in my real app, but in this sample it looks like the focus is going to one of the controls on the *other*, hidden page of the notebook, then getting stuck, presumably since that control is hidden and not supposed to accept keystrokes. Is there something I'm doing wrong? Is there some window other than a Panel that is better for holding controls in Notebooks? Or is this just the way the Notebook widget works, and I have to live with it? (I know I could put a control that accepts keystrokes on that page to work around the problem, but that would have no useful function on the page in question in the actual app.) David Peoples #!/usr/bin/env ruby require 'wx' include Wx class MainFrame < Frame def initialize(title) super(nil, :title => title) panel_1 = Panel.new(self) box_1 = BoxSizer.new(VERTICAL) panel_1.sizer = box_1 box_1.add(TextCtrl.new(panel_1, ID_ANY), 0, ALIGN_LEFT | ALL, 10) box_1.add(TextCtrl.new(panel_1, ID_ANY), 0, ALIGN_LEFT | ALL, 10) nb_1 = Notebook.new(panel_1, ID_ANY, DEFAULT_POSITION, DEFAULT_SIZE, NB_TOP, "notebook_1") box_1.add(nb_1, 0, ALIGN_LEFT | ALL, 10) panel_n1 = Panel.new(nb_1) box_n1 = BoxSizer.new(VERTICAL) panel_n1.sizer = box_n1 box_n1.add(TextCtrl.new(panel_n1, ID_ANY), 0, ALIGN_LEFT | ALL, 10) box_n1.add(TextCtrl.new(panel_n1, ID_ANY), 0, ALIGN_LEFT | ALL, 10) panel_n2 = Panel.new(nb_1) box_n2 = BoxSizer.new(VERTICAL) panel_n2.sizer = box_n2 box_n2.add(StaticText.new(panel_n2, ID_ANY, 'Text 1'), 0, ALIGN_LEFT | ALL, 10) box_n2.add(StaticText.new(panel_n2, ID_ANY, 'Text 2'), 0, ALIGN_LEFT | ALL, 10) nb_1.add_page(panel_n1, "Tab 1", true) nb_1.add_page(panel_n2, "Tab 2", false) box_1.add(TextCtrl.new(panel_1, ID_ANY), 0, ALIGN_LEFT | ALL, 10) end end Wx::App.run do self.app_name = 'TestNotebook' frame = MainFrame.new("Test notebook tab order") frame.show end From davidp at touringcyclist.com Sat Mar 7 13:47:31 2009 From: davidp at touringcyclist.com (David Peoples) Date: Sat, 07 Mar 2009 12:47:31 -0600 Subject: [wxruby-users] StaticText-only Notebook page eats tab key In-Reply-To: <1236444969.1439.24.camel@guppy> References: <1236444969.1439.24.camel@guppy> Message-ID: <1236451651.1439.27.camel@guppy> I forgot to mention that I'm testing this on Linux, so this is wxGTK-2.8.9 and the wxruby 2.0.0 gem. David From lists at ruby-forum.com Sat Mar 7 20:19:44 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Sun, 8 Mar 2009 02:19:44 +0100 Subject: [wxruby-users] ListCtrl.get_selections broken? Message-ID: <707d93a5b0ef0876ec165dc3f2e5a042@ruby-forum.com> Hi again, may it be that ListCtrl.get_selections is broken? Or did I misunderstand sth. in the docs? I'm always getting 0 as the size of the returned array while get_selected_item_count is reporting the correct number. See the attachment or the following lines for a program that demonstrates this. require 'wx' include Wx class MyFrame < Frame def initialize super nil, -1, "ListCtrl Error" @list = ListCtrl.new(self, -1, DEFAULT_POSITION, DEFAULT_SIZE, LC_REPORT) @list.insert_column(0, 'abc') li = ListItem.new() li.set_state LIST_STATE_SELECTED li.set_text '123' @list.insert_item(li) li.set_text '234' @list.insert_item(li) li.set_text '345' @list.insert_item(li) li.set_text '456' @list.insert_item(li) puts @list.get_selected_item_count # --> 4 puts @list.get_selections.size # --> 0 end end class MyApp < App def on_init f = MyFrame.new f.show end end MyApp.new.main_loop I hope I'm doing something wrong. Cheers, Christian. Attachments: http://www.ruby-forum.com/attachment/3407/ListCtrl_Err_demo.rb.rb -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Sun Mar 8 03:24:10 2009 From: alex at pressure.to (Alex Fenton) Date: Sun, 08 Mar 2009 07:24:10 +0000 Subject: [wxruby-users] ListCtrl.get_selections broken? In-Reply-To: <707d93a5b0ef0876ec165dc3f2e5a042@ruby-forum.com> References: <707d93a5b0ef0876ec165dc3f2e5a042@ruby-forum.com> Message-ID: <49B3729A.6080403@pressure.to> Christian Schmidt wrote: > I'm always getting 0 as the size of the returned array while > get_selected_item_count is reporting the correct number. > It works OK for me. I think the problem is the way you are adding items to the list. > @list = ListCtrl.new(self, -1, DEFAULT_POSITION, DEFAULT_SIZE, > LC_REPORT) > Note - this can be written ListCtrl.new(self, :style => LC_REPORT). You almost never need to use the clumsy 'DEFAULT_POSITION', 'DEFAULT_SIZE' etc. Use named arguments and these will be taken care of. > li = ListItem.new() > li.set_state > > li.set_text '123' > @list.insert_item(li) > li.set_text '234' > @list.insert_item(li) > Your problem is here, I think. Each ListItem object represents a unique object in the list. The row it's in is identified by an attribute 'id'. However, you're adding the same object multiple times. Do it like this instead, creating a new ListItem for each: li = Wx::ListItem.new li.state = LIST_STATE_SELECTED li.id = 0 # For row 0 li.text = '123' @list.insert_item li alex From lists at ruby-forum.com Sun Mar 8 09:09:25 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Sun, 8 Mar 2009 14:09:25 +0100 Subject: [wxruby-users] ListCtrl.get_selections broken? In-Reply-To: <49B3729A.6080403@pressure.to> References: <707d93a5b0ef0876ec165dc3f2e5a042@ruby-forum.com> <49B3729A.6080403@pressure.to> Message-ID: Alex Fenton wrote: > Note - this can be written ListCtrl.new(self, :style => LC_REPORT). You > almost never need to use the clumsy 'DEFAULT_POSITION', 'DEFAULT_SIZE' > etc. Use named arguments and these will be taken care of. This is great! I've always been annoyed by that, since I practically never need to explicitly set those using sizer based layout. >> li = ListItem.new() >> li.set_state >> >> li.set_text '123' >> @list.insert_item(li) >> li.set_text '234' >> @list.insert_item(li) >> I didn't use the ListItem helper-class in the original program. Just wanted to make it easier for you to reproduce the problem by selecting the items at startup. I was using @list.insert_item(pos, 'item') and @list.set_item(pos, col, 'property') originally. > Your problem is here, I think. Each ListItem object represents a unique > object in the list. The row it's in is identified by an attribute 'id'. > However, you're adding the same object multiple times. Do it like this > instead, creating a new ListItem for each: > > li = Wx::ListItem.new > li.state = LIST_STATE_SELECTED > li.id = 0 # For row 0 > li.text = '123' > @list.insert_item li I've been playing around with this now. I thought, it might also be a problem of references getting lost somewhere. So I modified it as follows: @li1 = ListItem.new() @li1.set_state LIST_STATE_SELECTED @li1.set_text '123' @li1.id = 0 @list.insert_item(@li1) @li2 = ListItem.new() @li2.set_state LIST_STATE_SELECTED @li2.id = 1 @li2.set_text '234' @list.insert_item(@li2) ... But still no luck: get_selections.size == 0! Christian. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Mar 10 02:08:22 2009 From: lists at ruby-forum.com (Martin Ceronio) Date: Tue, 10 Mar 2009 07:08:22 +0100 Subject: [wxruby-users] Blocking socket IO and wxRuby Message-ID: <239cdb4ca5d30a259b1924424a3b73f2@ruby-forum.com> I have just found out (after spending lots of time trying to figure out why my wxruby app is always hanging) that blocking on socket IO is the reason. I have seen the tutorial at http://wxruby.rubyforge.org/wiki/wiki.pl?Sockets after following a link in a lang.ruby.wxruby.user post. Is there a simpler way to approach this? Thanks, Martin -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Mar 10 14:50:00 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 10 Mar 2009 18:50:00 +0000 Subject: [wxruby-users] StaticText-only Notebook page eats tab key In-Reply-To: <1236444969.1439.24.camel@guppy> References: <1236444969.1439.24.camel@guppy> Message-ID: <49B6B658.9070106@pressure.to> Hi David David Peoples wrote: > I'm working on the keyboard interface for a small application. The app > has several controls on a Panel. One of those controls is a Notebook > with 4 pages, each of which is another panel. Three of the tab panels > contain ListCtrls, the fourth has only StaticText controls. > > > ... > The problem is with the fourth tab that has only StaticText controls. If > that tab is visible, the tab progression stops once the notebook is > reached. The focus goes to the tab itself like normal, then the next tab > key entry makes the focus disappear, and further tab keystrokes do > nothing. > > Sample code below demonstrates the problem. I hadn't noticed it in my > real app, but in this sample it looks like the focus is going to one of > the controls on the *other*, hidden page of the notebook, then getting > stuck, presumably since that control is hidden and not supposed to > accept keystrokes. Thanks for the report and the example. I get the same thing on GTK. I spent a little time with it but couldn't get to the bottom of what's happening here. As point 6, second list here says, tab traversal is platform dependent: http://www.wxwidgets.org/docs/technote/wxaccesstips.htm So I'm not sure whether this is a wxWidgets bug, or a problem for Gtk apps in general which have a notebook pane containing no controls which accepts focus (see Window#accepts_focus). It's probably best to work around it by avoiding problematic layouts, or you may be able to code around it by using various classes / events related to focus and keyboard navigation (FocusEvent, ChildFocusEvent and NavigationKeyEvent). NB FocusEvent#get_window is missing in 2.0.0 but fixed in SVN. If you're able to get to figure it out, please do post a bug to the wxWidgets tracker. http://trac.wxwidgets.org/ a From davidp at touringcyclist.com Tue Mar 10 23:18:49 2009 From: davidp at touringcyclist.com (David Peoples) Date: Tue, 10 Mar 2009 22:18:49 -0500 Subject: [wxruby-users] StaticText-only Notebook page eats tab key In-Reply-To: <49B6B658.9070106@pressure.to> References: <1236444969.1439.24.camel@guppy> <49B6B658.9070106@pressure.to> Message-ID: <1236741529.8085.24.camel@guppy> On Tue, 2009-03-10 at 18:50 +0000, Alex Fenton wrote: > Hi David > > Thanks for the report and the example. I get the same thing on GTK. I > spent a little time with it but couldn't get to the bottom of what's > happening here. As point 6, second list here says, tab traversal is > platform dependent: > > http://www.wxwidgets.org/docs/technote/wxaccesstips.htm > > So I'm not sure whether this is a wxWidgets bug, or a problem for Gtk > apps in general which have a notebook pane containing no controls which > accepts focus (see Window#accepts_focus). > > It's probably best to work around it by avoiding problematic layouts, or > you may be able to code around it by using various classes / events > related to focus and keyboard navigation (FocusEvent, ChildFocusEvent > and NavigationKeyEvent). NB FocusEvent#get_window is missing in 2.0.0 > but fixed in SVN. > > If you're able to get to figure it out, please do post a bug to the > wxWidgets tracker. > > http://trac.wxwidgets.org/ > > a > Alex, Thanks for your help. I have one more observation / clue about this problem. I hooked up the ChildFocusEvent to report what has focus when the tab sequence gets trapped, and my original guess (that the focus is going to one of the controls on a hidden page) was wrong. The focus is going to the Panel itself of the visible tab page. I don't understand C++ well enough to make much of the wxWidgets code so I won't be the source of a patch, but perhaps that clue can help someone else find the problem. (I think I've seen evidence that the tab sequence won't jump from a set of controls on one panel to the controls on another panel, just keeps cycling through the first panel's set. If true, that might be related to this issue. But I can't reproduce the demonstrating code, so maybe I imagined that (or some other bug in my code caused it). I'm working around the problem right now by using ListCtrls in report mode to display the info that had been in the static text controls. It is ugly but it works. I'll think some more about using the ChildFocusEvent and NavigationKeyEvent events to force the focus beyond the trap. My first attempt kept getting stuck in a loop in shift-tab because of the notebook's weird sequence when tabbing backwards. But I might have given up too quickly. David From davidp at touringcyclist.com Wed Mar 11 01:00:18 2009 From: davidp at touringcyclist.com (David Peoples) Date: Wed, 11 Mar 2009 00:00:18 -0500 Subject: [wxruby-users] Documentation changes? Message-ID: <1236747618.8085.99.camel@guppy> I'm embarrassed but willing to admit that I completely missed for a couple weeks the "wxRuby Overview" page of the documentation that explains the more ruby-like calling method with named arguments. I realized something was up when working through the examples, and finally found the relevant page when I knew it must be there. For slow guys like me, I'd like to see the whole documentation updated to include the "keyword parameter" calling method for every function in every class. I know, a ton of work, where's my patch? I don't have that patch, but I do have a suggestion slightly more practical. I think every class description page could have a section near the top with a paragraph similar to this one taken from the "overview" page: --------------------------------------------------------------------- As of version 1.9.1, it is possible to use named keyword arguments to specify constructor parameters in arbitrary order. The names of the arguments can be got from the class documentation. Omitted arguments will be given their default value. The above call could look like text = Wx::TextCtrl.new(parent, :text => 'some text', :style => Wx::TE_MULTILINE) For a full description of the new calling style, see the [wxRuby Overview] --------------------------------------------------------------------- Any comments? What is the procedure for submitting patches to the wxRuby documentation? David Peoples From chauk.mean at gmail.com Wed Mar 11 06:07:18 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Wed, 11 Mar 2009 11:07:18 +0100 Subject: [wxruby-users] Documentation changes? In-Reply-To: <1236747618.8085.99.camel@guppy> References: <1236747618.8085.99.camel@guppy> Message-ID: Hi David, On Wed, Mar 11, 2009 at 6:00 AM, David Peoples wrote: > I'm embarrassed but willing to admit that I completely missed for a > couple weeks the "wxRuby Overview" page of the documentation that > explains the more ruby-like calling method with named arguments. I > realized something was up when working through the examples, and finally > found the relevant page when I knew it must be there. > > For slow guys like me, I'd like to see the whole documentation updated > to include the "keyword parameter" calling method for every function in > every class. I know, a ton of work, where's my patch? FYI, in addition to constructors for Window and its subclasses, there are 2 other methods that support named arguments : - ToolBar#add_item - Sizer#add_item They are described in the overview part and the detailed part of the corresponding documentation page : - http://wxruby.rubyforge.org/doc/toolbar.html#ToolBar_additem - http://wxruby.rubyforge.org/doc/sizer.html#Sizer_additem > I don't have that patch, but I do have a suggestion slightly more > practical. I think every class description page could have a section > near the top with a paragraph similar to this one taken from the > "overview" page: For the Window constructors, instead of duplicating the description in each method of each class, a link to the wxRuby overview could be sufficient. > What is the procedure for submitting patches to the wxRuby documentation? This is described at : http://wxruby.rubyforge.org/wiki/wiki.pl?DocumentingWxRuby Note that since the release of wxRuby-2.0, there has been some reorganisation in the subversion repository. You should check out for the stable 2.0 branch : http://wxruby.rubyforge.org/svn/branches/wxruby_2_0_stable Cheers. Chauk-Mean. From alex at pressure.to Wed Mar 11 09:27:13 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 11 Mar 2009 13:27:13 +0000 Subject: [wxruby-users] ListCtrl.get_selections broken? Message-ID: <49B7BC31.7060908@pressure.to> Christian - you didn't say, but I'm assuming you're working on Windows b/c I now tried it there and can reproduce the problem. I've no idea why Windows differs here, but fortunately it's easy to fix. The definition of get_selections is in Ruby and is in lib/wx/classes/listctrl.rb. If you want the definition that works on Windows, add something like this to your script: class Wx::ListCtrl def get_selections selections = [] item = get_next_item(-1, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED) while item >= 0 selections << item item = get_next_item(item, Wx::LIST_NEXT_BELOW, Wx::LIST_STATE_SELECTED) end selections end end The only change is Wx::LIST_NEXT_ALL was previously LIST_NEXT_BELOW. I'll apply this to wxRuby once I've tested on other platforms. Thanks again for the report. a From transfire at gmail.com Thu Mar 12 14:52:37 2009 From: transfire at gmail.com (Trans) Date: Thu, 12 Mar 2009 14:52:37 -0400 Subject: [wxruby-users] Grid#get_selected_rows not working? Message-ID: <4b6f054f0903121152t659159d4n9ba6a0027770d302@mail.gmail.com> Working with wxGrid. I can't seem to get any results for #get_selection_rows. The array is alwasy empty. I ended up having to something tricky: rows = [] # @grid.get_selection_rows (not working) top = @grid.get_selection_block_top_left.map{ |r,c| r } bot = @grid.get_selection_block_bottom_right.map{ |r,c| r } top.each_with_index do |t, i| rows.concat((t..bot[i]).to_a) end Did I miss something or is this in fact a bug? From alex at pressure.to Thu Mar 12 17:27:10 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Mar 2009 21:27:10 +0000 Subject: [wxruby-users] Documentation changes? In-Reply-To: <1236747618.8085.99.camel@guppy> References: <1236747618.8085.99.camel@guppy> Message-ID: <49B97E2E.2060605@pressure.to> David Peoples wrote: > I'm embarrassed but willing to admit that I completely missed for a > couple weeks the "wxRuby Overview" page of the documentation that > explains the more ruby-like calling method with named arguments. I > realized something was up when working through the examples, and finally > found the relevant page when I knew it must be there. > Thanks for the suggestion. I'm aware that quite a bit of the sample and tutorial code demonstrates a wxRuby style that's a bit dated, and could be simplified, but it gradually gets updated as someone finds the time. On the wiki I created a new page with suggestions for wxRuby programming style, and linked it from the home page. Hopefully this will help people find the nicer options quicker: http://wxruby.rubyforge.org/wiki/wiki.pl?StyleGuide > I don't have that patch, but I do have a suggestion slightly more > practical. I think every class description page could have a section > near the top with a paragraph similar to this one taken from the > "overview" page: > Like Chauk-Mean, I'm not sure this is quite the way to go about it. Although it's good that we have pretty complete and accurate API reference, the documentation layout and linking could be much improved. It's something we're looking into for future development, but unfortunately there's no documentation system out there that really meets our requirement. We settled on Textile as being reasonably easy to write and output, but it's not really a code documentation format. The formatting of code gets messy and the results aren't the best. RDoc (in the ruby standard library) is too simplistic - for example, it doesn't support type annotations for method arguments, which is important in learning wxRuby. The developers seem unwilling to consider adding this. Docbook produces lovely docs, but is pretty painful to write. cheers alex From lists at ruby-forum.com Thu Mar 12 17:42:15 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Thu, 12 Mar 2009 22:42:15 +0100 Subject: [wxruby-users] ListCtrl.get_selections broken? In-Reply-To: <49B7BC31.7060908@pressure.to> References: <49B7BC31.7060908@pressure.to> Message-ID: Hi Alex, you're right, I'm working on Win XP - hence your workaround fixed it for me. Btw.: It's me who has to thank you again for your great help! Thank you for making wxRuby and also for providing such a great support! Christian. Alex Fenton wrote: > Christian - you didn't say, but I'm assuming you're working on Windows > b/c I now tried it there and can reproduce the problem. > > I've no idea why Windows differs here, but fortunately it's easy to fix. > The definition of get_selections is in Ruby and is in > lib/wx/classes/listctrl.rb. If you want the definition that works on > Windows, add something like this to your script: > > class Wx::ListCtrl > def get_selections > selections = [] > item = get_next_item(-1, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED) > while item >= 0 > selections << item > item = get_next_item(item, Wx::LIST_NEXT_BELOW, > Wx::LIST_STATE_SELECTED) > end > selections > end > end > > The only change is Wx::LIST_NEXT_ALL was previously LIST_NEXT_BELOW. > > I'll apply this to wxRuby once I've tested on other platforms. Thanks > again for the report. > > a -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Mar 12 18:14:27 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Mar 2009 22:14:27 +0000 Subject: [wxruby-users] Documentation changes? In-Reply-To: <49B97E2E.2060605@pressure.to> References: <1236747618.8085.99.camel@guppy> <49B97E2E.2060605@pressure.to> Message-ID: <49B98943.6070401@pressure.to> Alex Fenton wrote: > On the wiki I created a new page with suggestions for wxRuby > programming style, and linked it from the home page. Hopefully this > will help people find the nicer options quicker: > > http://wxruby.rubyforge.org/wiki/wiki.pl?StyleGuide PS - I hope you like the updated layout for the wiki, comments welcome. A big thank you to Chauk-Mean for providing us a much better looking logo - a ruby-ish twist on the wxWidgets design. alex From alex at pressure.to Thu Mar 12 18:42:09 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Mar 2009 22:42:09 +0000 Subject: [wxruby-users] Grid#get_selected_rows not working? In-Reply-To: <4b6f054f0903121152t659159d4n9ba6a0027770d302@mail.gmail.com> References: <4b6f054f0903121152t659159d4n9ba6a0027770d302@mail.gmail.com> Message-ID: <49B98FC1.9060000@pressure.to> Hi Trans Trans wrote: > Working with wxGrid. I can't seem to get any results for > #get_selection_rows. Hmm, it (get_selected_rows, there's not a method get_selection_rows) seems to work OK to me. I tweaked the grid sample line 27 so it reads: evt_menu(1003) { @grid.select_row(1); p @grid.selected_rows } And that returns [1]. However (any maybe this is where the confusion lies) Grid#selected_rows only returns rows that have been selected as such, ie by clicking on the row label, or programmatically with select_row. Rows that have some cells, or even all cells selected by click-dragging won't be returned, because they're not 'selected-as-rows'. If that's what you need, then I guess you may have to resort to more complicated strategies: > rows = [] # @grid.get_selection_rows (not working) > top = @grid.get_selection_block_top_left.map{ |r,c| r } > bot = @grid.get_selection_block_bottom_right.map{ |r,c| r } > top.each_with_index do |t, i| > rows.concat((t..bot[i]).to_a) > end > Note that if you want all rows where anything is selected, you'll also need to call get_selected_cells to get selections not in a block. See below for a suggested useful method > Did I miss something or is this in fact a bug? Not a bug, I think, but definitely not something very clear in the docs. And the API for multiple selections is not exactly comfortable. In another version we should probably add a simpler method like: # Returns an array of co-ordinates of every selected cell. def get_all_selected_cells cells = [] selection_block_top_left.zip(selection_block_bottom_right) do | coords | x1, y1, x2, y2 = coords.flatten (x1..x2).each { | x | (y1..y2).each { | y | cells << [x, y] } } end selected_cells.each { | c | cells << c } cells.sort! cells end With this you could get all rows with any selection with just all_selected_cells.map { | c | c.first }.uniq a From transfire at gmail.com Thu Mar 12 20:35:00 2009 From: transfire at gmail.com (Trans) Date: Thu, 12 Mar 2009 20:35:00 -0400 Subject: [wxruby-users] Grid#get_selected_rows not working? In-Reply-To: <49B98FC1.9060000@pressure.to> References: <4b6f054f0903121152t659159d4n9ba6a0027770d302@mail.gmail.com> <49B98FC1.9060000@pressure.to> Message-ID: <4b6f054f0903121735m3bfdb1f2pfbb2e30c9b0ce558@mail.gmail.com> On Thu, Mar 12, 2009 at 6:42 PM, Alex Fenton wrote: > Hi Trans > > Trans wrote: >> >> Working with wxGrid. I can't seem to get any results for >> #get_selection_rows. > > Hmm, it (get_selected_rows, there's not a method get_selection_rows) seems > to work OK to me. I tweaked the grid sample line 27 so it reads: > > ? evt_menu(1003) { @grid.select_row(1); p @grid.selected_rows } > > And that returns [1]. > > However (any maybe this is where the confusion lies) Grid#selected_rows only > returns rows that have been selected as such, ie by clicking on the row > label, or programmatically with select_row. Hmm... that seems odd to me since I'm using row selection mode @grid.set_selection_mode(1) But yea, that seems to be the problem. > Rows that have some cells, or even all cells selected by click-dragging > won't be returned, because they're not 'selected-as-rows'. If that's what > you need, then I guess you may have to resort to more complicated > strategies: > >> ? ? ?rows = [] ?# @grid.get_selection_rows (not working) >> ? ? ?top = @grid.get_selection_block_top_left.map{ |r,c| r } >> ? ? ?bot = @grid.get_selection_block_bottom_right.map{ |r,c| r } >> ? ? ?top.each_with_index do |t, i| >> ? ? ? ?rows.concat((t..bot[i]).to_a) >> ? ? ?end >> > > Note that if you want all rows where anything is selected, you'll also need > to call get_selected_cells to get selections not in a block. See below for a > suggested useful method > >> Did I miss something or is this in fact a bug? > > Not a bug, I think, but definitely not something very clear in the docs. And > the API for multiple selections is not exactly comfortable. In another > version we should probably add a simpler method like: > > # Returns an array of co-ordinates of every selected cell. > def get_all_selected_cells > ? ? cells = [] > ? ? selection_block_top_left.zip(selection_block_bottom_right) do | coords | > ? ? ? x1, y1, x2, y2 = coords.flatten > ? ? ? (x1..x2).each { | x | (y1..y2).each { | y | cells << [x, y] } } > ? ? end > ? ? selected_cells.each { | c | cells << c } > ? ? cells.sort! > ? ? cells > end > > With this you could get all rows with any selection with just > > ?all_selected_cells.map { | c | c.first }.uniq Yes, something easier to use would be very helpful. Thanks, T. From alex at pressure.to Fri Mar 13 03:49:16 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 13 Mar 2009 07:49:16 +0000 Subject: [wxruby-users] Grid#get_selected_rows not working? In-Reply-To: <4b6f054f0903121735m3bfdb1f2pfbb2e30c9b0ce558@mail.gmail.com> References: <4b6f054f0903121152t659159d4n9ba6a0027770d302@mail.gmail.com> <49B98FC1.9060000@pressure.to> <4b6f054f0903121735m3bfdb1f2pfbb2e30c9b0ce558@mail.gmail.com> Message-ID: <49BA0FFC.2020505@pressure.to> Trans wrote: > Hmm... that seems odd to me since I'm using row selection mode > > @grid.set_selection_mode(1) > > But yea, that seems to be the problem. > You didn't mention that; it definitely seems odd to me that it works that way with the row grid select mode on. But it seems to be intended: http://trac.wxwidgets.org/ticket/2576 http://lists.wxwidgets.org/pipermail/wx-users/2007-February/097640.html You could file a bug/patch for wxWidgets to request a fix. >> def get_all_selected_cells >> .... > > Yes, something easier to use would be very helpful. Well, feel free to make use of it as it stands ... with complex widgets like Grid subclassing is often a neater way to organise code anyway. cheers a From transfire at gmail.com Mon Mar 16 12:48:35 2009 From: transfire at gmail.com (Trans) Date: Mon, 16 Mar 2009 12:48:35 -0400 Subject: [wxruby-users] Tabs Message-ID: <4b6f054f0903160948v19e573c9i787a7b469097e846@mail.gmail.com> Can anyone tell me how to create a tabbed interface? I tried using the Notebook control but I could not get it to work. I'm trying to put a Grid on one of the Notebook pages. Thanks, Trans From luc.traonmilin at gmail.com Mon Mar 16 13:25:44 2009 From: luc.traonmilin at gmail.com (Luc Traonmilin) Date: Mon, 16 Mar 2009 18:25:44 +0100 Subject: [wxruby-users] Tabs In-Reply-To: <4b6f054f0903160948v19e573c9i787a7b469097e846@mail.gmail.com> References: <4b6f054f0903160948v19e573c9i787a7b469097e846@mail.gmail.com> Message-ID: <49BE8B98.3020307@gmail.com> Trans a ?crit : > Can anyone tell me how to create a tabbed interface? I tried using the > Notebook control but I could not get it to work. > > I'm trying to put a Grid on one of the Notebook pages. > > Thanks, > Trans > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > Here is some code I used in a small app: # the tabbed interface # create the notebook @notebook = Notebook.new( @frame, # the parent frame 1, DEFAULT_POSITION, DEFAULT_SIZE, 0, 'notebook') welcome_text = StaticText.new( @notebook, 2, "\nClick on a project node to open it or create a new project.", DEFAULT_POSITION, DEFAULT_SIZE, 0, "welcomeText") @notebook.add_page( welcome_text, "Welcome", true, -1) Hope it's useful From luc.traonmilin at gmail.com Mon Mar 16 13:26:48 2009 From: luc.traonmilin at gmail.com (Luc Traonmilin) Date: Mon, 16 Mar 2009 18:26:48 +0100 Subject: [wxruby-users] Tabs In-Reply-To: <49BE8B98.3020307@gmail.com> References: <4b6f054f0903160948v19e573c9i787a7b469097e846@mail.gmail.com> <49BE8B98.3020307@gmail.com> Message-ID: <49BE8BD8.2070700@gmail.com> Luc Traonmilin a ?crit : > Trans a ?crit : >> Can anyone tell me how to create a tabbed interface? I tried using the >> Notebook control but I could not get it to work. >> >> I'm trying to put a Grid on one of the Notebook pages. >> >> Thanks, >> Trans >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> > Here is some code I used in a small app: > > # the tabbed interface > # create the notebook > @notebook = Notebook.new( > @frame, # the parent frame > 1, > DEFAULT_POSITION, > DEFAULT_SIZE, 0, > 'notebook') > welcome_text = StaticText.new( > @notebook, 2, "\nClick on a project node to open it or > create a new project.", > DEFAULT_POSITION, > DEFAULT_SIZE, > 0, > "welcomeText") > @notebook.add_page( > welcome_text, "Welcome", > true, > -1) > > Hope it's useful > Sorry about bad formatting... thunderbird messed it all From davidp at touringcyclist.com Mon Mar 16 14:03:05 2009 From: davidp at touringcyclist.com (David Peoples) Date: Mon, 16 Mar 2009 13:03:05 -0500 Subject: [wxruby-users] Tabs In-Reply-To: <4b6f054f0903160948v19e573c9i787a7b469097e846@mail.gmail.com> References: <4b6f054f0903160948v19e573c9i787a7b469097e846@mail.gmail.com> Message-ID: <49BE9459.4070400@touringcyclist.com> Trans wrote: > Can anyone tell me how to create a tabbed interface? I tried using the > Notebook control but I could not get it to work. > > I'm trying to put a Grid on one of the Notebook pages. > > Thanks, > Trans > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users It is fairly straightforward. I think the key is to attach the controls to Wx::Panels, then add the panels to the notebook. See the sample code below. #!/usr/bin/env ruby require 'wx' include Wx class MainFrame < Frame def initialize(title) super(nil, :title => title) panel_1 = Panel.new(self) box_1 = BoxSizer.new(VERTICAL) panel_1.sizer = box_1 notebook = Notebook.new(panel_1, :style => NB_TOP) box_1.add(notebook, 0, ALIGN_LEFT | ALL, 10) panel_n1 = Panel.new(notebook) box_n1 = BoxSizer.new(VERTICAL) panel_n1.sizer = box_n1 box_n1.add(TextCtrl.new(panel_n1), 0, ALIGN_LEFT | ALL, 10) box_n1.add(TextCtrl.new(panel_n1), 0, ALIGN_LEFT | ALL, 10) panel_n2 = Panel.new(notebook) box_n2 = BoxSizer.new(VERTICAL) panel_n2.sizer = box_n2 grid_n2 = Grid.new(panel_n2, :size => [270, 140]) grid_n2.create_grid(3,2) box_n2.add(grid_n2, 0, ALIGN_LEFT | ALL, 10) notebook.add_page(panel_n1, "Tab 1", true) notebook.add_page(panel_n2, "Tab 2", false) end end Wx::App.run do self.app_name = 'TestNotebook' frame = MainFrame.new("Test notebook") frame.show end -- David Peoples davidp at touringcyclist.com The Touring Cyclist http://www.touringcyclist.com 11816 St. Charles Rock Road, Bridgeton, MO 63044 tel: 314-739-4648 fax: 314-739-4972 From lists at ruby-forum.com Mon Mar 16 15:26:04 2009 From: lists at ruby-forum.com (Michael Satterwhite) Date: Mon, 16 Mar 2009 20:26:04 +0100 Subject: [wxruby-users] wxFormBuilder Event Question Message-ID: <147a86b9b29767b7d885c80ba9fd69e8@ruby-forum.com> I'm learning these tools right now, and I have a question regarding events. In wxFormBuilder, there is the facility to add events to an object. When I look at the generated .xrc, however, I don't see any reference to that event. What's the purpose of specifying an event here if it isn't saved to the .xrc? -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Mar 16 18:47:55 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 16 Mar 2009 22:47:55 +0000 Subject: [wxruby-users] wxFormBuilder Event Question In-Reply-To: <147a86b9b29767b7d885c80ba9fd69e8@ruby-forum.com> References: <147a86b9b29767b7d885c80ba9fd69e8@ruby-forum.com> Message-ID: <49BED71B.7040307@pressure.to> Michael Satterwhite wrote: > I'm learning these tools right now, and I have a question regarding > events. > > In wxFormBuilder, there is the facility to add events to an object. When > I look at the generated .xrc, however, I don't see any reference to that > event. What's the purpose of specifying an event here if it isn't saved > to the .xrc? > I haven't used wxFormBuilder, but generally, wx designers (like FormBuilder, DialogBlocks) save (just) layout to XRC. XRC as an XML format describes how a window/frame/dialog is composed, but nothing about how it interacts. They then can use their own custom format to save data beyond what XRC permits - eg events. But AFAIK there is no standard for this, so although it could be useful in Ruby, it's not at the moment. a From mario at ruby-im.net Tue Mar 17 17:51:30 2009 From: mario at ruby-im.net (Mario Steele) Date: Tue, 17 Mar 2009 16:51:30 -0500 Subject: [wxruby-users] wxFormBuilder Event Question In-Reply-To: <49BED71B.7040307@pressure.to> References: <147a86b9b29767b7d885c80ba9fd69e8@ruby-forum.com> <49BED71B.7040307@pressure.to> Message-ID: On Mon, Mar 16, 2009 at 5:47 PM, Alex Fenton wrote: > Michael Satterwhite wrote: > >> I'm learning these tools right now, and I have a question regarding >> events. >> >> In wxFormBuilder, there is the facility to add events to an object. When >> I look at the generated .xrc, however, I don't see any reference to that >> event. What's the purpose of specifying an event here if it isn't saved >> to the .xrc? >> >> > > I haven't used wxFormBuilder, but generally, wx designers (like > FormBuilder, DialogBlocks) save (just) layout to XRC. XRC as an XML format > describes how a window/frame/dialog is composed, but nothing about how it > interacts. They then can use their own custom format to save data beyond > what XRC permits - eg events. But AFAIK there is no standard for this, so > although it could be useful in Ruby, it's not at the moment. > > > a > To expand on this further, especially since I'm the one who recommends wxFormBuilder, the event "attachment" that you see in the editor, is only useful when generating C++ Source code that will be compiled later. It does absolutely nothing for attaching events to function names in the XRC file itself. -- 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 Mar 17 18:07:03 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Tue, 17 Mar 2009 23:07:03 +0100 Subject: [wxruby-users] Event-Issue with TreeCtrl with "TR_MULTIPLE" Message-ID: Hi, I've yet another issue with my favourite toolkit. When I'm adding a TreeCtrl that has the TR_MULTIPLE style set, the event "evt_tree_sel_changed" most oftenly gets fired multiple times (whereas a TreeCtrl with single selection only fires once - as expected). The exception is the automatic root-selection at program startup and when I'm widening or narrowing the selected nodes holding ctrl and using the cursor keys. See the attachment or below for an example how to reproduce this. I'm working on WinXP, wxRuby 2.0.0, ruby 1.8.6 require 'wx' include Wx class MyFrame < Frame def initialize super nil, -1, "Tree: select-event error?" @tree = TreeCtrl.new(self, -1, :style => TR_MULTIPLE) @root = @tree.add_root 'root', 0 ['one', 'two', 'three', 'four'].each do |i| add i end @tree.expand @root @num_sels = 0 evt_tree_sel_changed(@tree) do |e| @num_sels += 1 puts "sel event #{@num_sels}" end end def add item node = @tree.insert_item @root, 0, item, 1 child = @tree.insert_item node, 0, "child", 2 @tree.insert_item child, 0, "grand-child", 2 @tree.expand node @tree.expand child end end class MyApp < App def on_init f = MyFrame.new f.show end end MyApp.new.main_loop Thanks in advance for any hint, Christian. Attachments: http://www.ruby-forum.com/attachment/3454/tree_mult_selection_event.rb -- Posted via http://www.ruby-forum.com/. From fabio.petrucci at gmail.com Wed Mar 18 04:28:31 2009 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Wed, 18 Mar 2009 09:28:31 +0100 Subject: [wxruby-users] restarting an application Message-ID: Hi folks, i was wondering if is there any way to automatically restart wxruby application. A sample code would be appreciated. thank you all. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Mar 18 06:11:46 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 18 Mar 2009 10:11:46 +0000 Subject: [wxruby-users] restarting an application In-Reply-To: References: Message-ID: <49C0C8E2.4090403@pressure.to> Fabio Petrucci wrote: > i was wondering if is there any way to automatically restart wxruby > application. Can you explain a bit more what you mean? Under what circumstances would the application be ending? If it's an exception, rescue it at the most appropriate level. You can't enter Wx::App's main loop more than once in a script, but you can have no visible frames/dialogs. If you don't want to end the application, hide() the frame, rather than close(). a From fabio.petrucci at gmail.com Wed Mar 18 07:56:07 2009 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Wed, 18 Mar 2009 12:56:07 +0100 Subject: [wxruby-users] restarting an application In-Reply-To: <49C0C8E2.4090403@pressure.to> References: <49C0C8E2.4090403@pressure.to> Message-ID: Hi Alex, Can you explain a bit more what you mean? Under what circumstances would the > application be ending? If it's an exception, rescue it at the most > appropriate level. basically the idea i to upgrade the application via network and, after the upgrade process, restart to reload everything (xrc-layouts, models, configurations...). -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Mar 18 08:09:58 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 18 Mar 2009 12:09:58 +0000 Subject: [wxruby-users] restarting an application In-Reply-To: References: <49C0C8E2.4090403@pressure.to> Message-ID: <49C0E496.4070402@pressure.to> Fabio Petrucci wrote: > basically the idea i to upgrade the application via network and, > after the upgrade process, restart to reload everything (xrc-layouts, > models, configurations...). In that case I think the best thing would be to start a fresh ruby process, otherwise you will have all the old models etc already loaded. This works for me on OS X: Wx::App.run do def self.on_exit exec("ruby #$0") end .... end This assumes the environment's ruby is the right one to start the app. Note that you'll want to have your editor handy to comment out the restart else you'll end up in a permanent loop. In your case, you'll want to wrap the exec in some sort of conditional which checks for restart after upgrade. If it's an open app, I'd be interested to hear about/see examples of code updating over net whenever you're ready. alex From fabio.petrucci at gmail.com Wed Mar 18 08:55:30 2009 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Wed, 18 Mar 2009 13:55:30 +0100 Subject: [wxruby-users] restarting an application In-Reply-To: <49C0E496.4070402@pressure.to> References: <49C0C8E2.4090403@pressure.to> <49C0E496.4070402@pressure.to> Message-ID: > This works for me on OS X: > > Wx::App.run do > def self.on_exit > exec("ruby #$0") > end > .... > end > thank you, i'll have a go with your solution > If it's an open app, I'd be interested to hear about/see examples of code > updating over net whenever you're ready. > It's just a vague idea, i don't know yet how to implement it and tools to use, suggestions are wellcome. cheers, bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erubin at valcom.com Thu Mar 19 10:00:41 2009 From: erubin at valcom.com (Eric Rubin) Date: Thu, 19 Mar 2009 10:00:41 -0400 Subject: [wxruby-users] Distributing Windows WxRuby apps Message-ID: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> I've developed a WxRuby app that only runs under Windows. I've been using RubyScript2exe to build an executable for distribution, but it stopped working one day and I haven't been able to figure out why. I'm also not very confident that it will work when I go to Ruby 1.9. What other options do I have? I could use InstallShield, or something like it to install ruby.exe along with my .rb files and any DLLs, etc. that I may need. Someone suggested that I switch to IronRuby and run my app with .NET's DLR. Does WxRuby work with IronRuby? How are other people distributing WxRuby app on Windows? Eric Rubin -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Thu Mar 19 11:50:09 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 19 Mar 2009 15:50:09 +0000 Subject: [wxruby-users] Distributing Windows WxRuby apps In-Reply-To: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> References: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> Message-ID: <49C269B1.40507@pressure.to> Hi Eric Eric Rubin wrote: > > I?ve developed a WxRuby app that only runs under Windows. I?ve been > using RubyScript2exe to build an executable for distribution, but it > stopped working one day and I haven?t been able to figure out why. > Try packaging it so that error messages are put to the console and run it from the terminal. It should show what's wrong. > What other options do I have? > http://rubyforge.org/pipermail/wxruby-users/2008-October/004248.html > I could use InstallShield, or something like it to install ruby.exe > along with my .rb files and any DLLs, etc. that I may need. Someone > suggested that I switch to IronRuby and run my app with .NET?s DLR. > Does WxRuby work with IronRuby? > Not AFAIK. > How are other people distributing WxRuby app on Windows? > I described how I do it here. http://rubyforge.org/pipermail/wxruby-users/2008-October/004258.html cheers alex From transfire at gmail.com Thu Mar 19 14:09:35 2009 From: transfire at gmail.com (Trans) Date: Thu, 19 Mar 2009 14:09:35 -0400 Subject: [wxruby-users] xrc file and WxGrid Message-ID: <4b6f054f0903191109q2c5ed3f7p45cfb29d61728da6@mail.gmail.com> Has anyone any experience with using a XRC file that setsup a Wx::Grid? I'm using wxFormBuilder, in which I setup a grid in a boxsizer, with column names and all. But when I render it via Ruby the grid is just a small empty gray box, and I can't seem to manipulate it at all. I tried adding columns, resizing columns, populating it with data, etc. but still nothing. I look at the XRC file and see that this is all it is: wxALL 5 Does XRC not handle Wx::Grid properties? ~Trans. From mario at ruby-im.net Thu Mar 19 14:23:58 2009 From: mario at ruby-im.net (Mario Steele) Date: Thu, 19 Mar 2009 13:23:58 -0500 Subject: [wxruby-users] xrc file and WxGrid In-Reply-To: <4b6f054f0903191109q2c5ed3f7p45cfb29d61728da6@mail.gmail.com> References: <4b6f054f0903191109q2c5ed3f7p45cfb29d61728da6@mail.gmail.com> Message-ID: No, wxWidgets and further more wxRuby can use just about any control defined through XRC. There's not much we can tell from that snippet you gave us. Could you attach both the XRC and the Ruby files your using to attempt to load the Window, with the Grid, that shows the problem of it not working, and also please mention what Platform, and Version of Ruby/wxRuby you are attempting to use. Thanks, ~ Mario On Thu, Mar 19, 2009 at 1:09 PM, Trans wrote: > Has anyone any experience with using a XRC file that setsup a Wx::Grid? > > I'm using wxFormBuilder, in which I setup a grid in a boxsizer, with > column names and all. But when I render it via Ruby the grid is just a > small empty gray box, and I can't seem to manipulate it at all. I > tried adding columns, resizing columns, populating it with data, etc. > but still nothing. > > I look at the XRC file and see that this is all it is: > > > > wxALL > 5 > > > > Does XRC not handle Wx::Grid properties? > > ~Trans. > _______________________________________________ > 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 transfire at gmail.com Thu Mar 19 15:51:27 2009 From: transfire at gmail.com (Trans) Date: Thu, 19 Mar 2009 15:51:27 -0400 Subject: [wxruby-users] xrc file and WxGrid In-Reply-To: References: <4b6f054f0903191109q2c5ed3f7p45cfb29d61728da6@mail.gmail.com> Message-ID: <4b6f054f0903191251l15901208ldf9453f59347d1ec@mail.gmail.com> 2009/3/19 Mario Steele : > No, wxWidgets and further more wxRuby can use just about any control defined > through XRC.? There's not much we can tell from that snippet you gave us. > Could you attach both the XRC and the Ruby files your using to attempt to > load the Window, with the Grid, that shows the problem of it not working, > and also please mention what Platform, and Version of Ruby/wxRuby you are > attempting to use. > > Thanks, > > ~ Mario Sure thing. I'm running: Ubuntu 8.04 64-bit (everything is installed via apt-get or rubygems) WxFormBuilder 3.0.57 (unicode) ruby 1.8.6 (2007-09-24 patchlevel 111) [x86_64-linux] wxruby-2.0.0-x86_64-linux Attached are the files. There are some support files missing so it won't run straight away, but remarking out the epony and @client stuff in on_init should do the trick. Also, the fbp file might need the search.gif file in an images/ directory to load. HTH, T. -------------- next part -------------- A non-text attachment was scrubbed... Name: epony.xrc Type: application/octet-stream Size: 11129 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: epony.fbp Type: application/x-wxformbuilder Size: 140140 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: epony.rb Type: application/octet-stream Size: 2463 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: search.gif Type: image/gif Size: 145 bytes Desc: not available URL: From amichelins at gmail.com Thu Mar 19 16:33:01 2009 From: amichelins at gmail.com ((gmail) Alejandro Michelin Salomon) Date: Thu, 19 Mar 2009 17:33:01 -0300 Subject: [wxruby-users] Problem centering a label Message-ID: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> Hi I have frame. Inside i want to put a static text as title, centered. I use two sizers, one vertical an other horizontal. But title is not centered, is put to left. My code is : require 'wx'; class TarefasNova < Wx::Panel def initialize(parent) rect = parent.get_client_rect(); super( parent, 1011, Wx::Point.new( 0, 0 ), rect.get_size(), SIMPLE_BORDER, "NovaTarefa" ); sizer = Wx::BoxSizer.new(Wx::VERTICAL ); box = Wx::BoxSizer.new(Wx::HORIZONTAL); label = Wx::StaticText.new( self, :label => "CADASTRO DE TAREFAS (NOVA)", :size => [250,-1] ); box.add( label, 1, Wx::ALIGN_CENTER_VERTICAL, 5); sizer.add_item(box, 0, Wx::ALIGN_CENTER|Wx::ALL, 5); end end How to make my title centered in the panel? Alejandro Michelin Salomon _____ avast! Antivirus : Outbound message clean. Virus Database (VPS): 090319-0, 19/03/2009 Tested on: 19/03/2009 17:32:59 avast! - copyright (c) 1988-2009 ALWIL Software. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Mar 19 18:49:04 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Thu, 19 Mar 2009 23:49:04 +0100 Subject: [wxruby-users] Problem centering a label In-Reply-To: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> References: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> Message-ID: <19869ef2ac1d9d28a863b36c893504d5@ruby-forum.com> Hi Alejandro, you just need one sizer on your panel. Add one spacer (sizer.add_stretch_spacer) before and one after your text. Like so: sizer = BoxSizer.new HORIZONTAL sizer.add_stretch_spacer sizer.add StaticText.new(self, -1, 'asdf'), 0, 1 sizer.add_stretch_spacer hth, Christian. Alejandro Michelin salomon wrote: > Hi > > > > I have frame. > > Inside i want to put a static text as title, centered. > > I use two sizers, one vertical an other horizontal. > > > > But title is not centered, is put to left. > > > > My code is : > > > > require 'wx'; > > > > class TarefasNova < Wx::Panel > > def initialize(parent) > > rect = parent.get_client_rect(); > > > > super( parent, 1011, Wx::Point.new( 0, 0 ), rect.get_size(), > SIMPLE_BORDER, "NovaTarefa" ); > > > > sizer = Wx::BoxSizer.new(Wx::VERTICAL ); > > box = Wx::BoxSizer.new(Wx::HORIZONTAL); > > > > label = Wx::StaticText.new( self, :label => "CADASTRO DE TAREFAS > (NOVA)", :size => [250,-1] ); > > > > box.add( label, 1, Wx::ALIGN_CENTER_VERTICAL, 5); > > > > sizer.add_item(box, 0, Wx::ALIGN_CENTER|Wx::ALL, 5); > > end > > end > > > > How to make my title centered in the panel? > > > > Alejandro Michelin Salomon > > > > _____ > > avast! Antivirus : Outbound message clean. > > > Virus Database (VPS): 090319-0, 19/03/2009 > Tested on: 19/03/2009 17:32:59 > avast! - copyright (c) 1988-2009 ALWIL Software. -- Posted via http://www.ruby-forum.com/. From amichelins at gmail.com Fri Mar 20 08:05:53 2009 From: amichelins at gmail.com ((gmail) Alejandro Michelin Salomon) Date: Fri, 20 Mar 2009 09:05:53 -0300 Subject: [wxruby-users] RES: Problem centering a label In-Reply-To: <19869ef2ac1d9d28a863b36c893504d5@ruby-forum.com> References: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> <19869ef2ac1d9d28a863b36c893504d5@ruby-forum.com> Message-ID: <003c01c9a954$3a12d6f0$ae3884d0$@com> Christian : I say in the other mail ?I have a frame?, brong i have a panel. The panel is inside the main frame. I change my code to : class TarefasNova < Wx::Panel def initialize(parent) rect = parent.get_client_rect(); super( parent, 1011, Wx::Point.new( 0, 0 ), rect.get_size(), SIMPLE_BORDER, "NovaTarefa" ); #sizer = Wx::BoxSizer.new(Wx::VERTICAL) box = Wx::BoxSizer.new(Wx::HORIZONTAL); box.add_stretch_spacer(); box.add Wx::StaticText.new(self, -1, 'asdf'), 0, 1 #label = Wx::StaticText.new( self, :label => "CADASTRO DE TAREFAS (NOVA)", :size => [250,-1] ); #box.add( label, 1, Wx::ALIGN_CENTER, 5); box.add_stretch_spacer(); #sizer.add_item(box, 0, Wx::ALIGN_CENTER|Wx::ALL, 5); end end But the text is not centered, the text is in the left. Exist some diferences between frame and panel to user sizer? De: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] Em nome de Christian Schmidt Enviada em: quinta-feira, 19 de mar?o de 2009 19:49 Para: wxruby-users at rubyforge.org Assunto: Re: [wxruby-users] Problem centering a label Hi Alejandro, you just need one sizer on your panel. Add one spacer (sizer.add_stretch_spacer) before and one after your text. Like so: sizer = BoxSizer.new HORIZONTAL sizer.add_stretch_spacer sizer.add StaticText.new(self, -1, 'asdf'), 0, 1 sizer.add_stretch_spacer hth, Christian. Alejandro Michelin salomon wrote: > Hi > > > > I have frame. > > Inside i want to put a static text as title, centered. > > I use two sizers, one vertical an other horizontal. > > > > But title is not centered, is put to left. > > > > My code is : > > > > require 'wx'; > > > > class TarefasNova < Wx::Panel > > def initialize(parent) > > rect = parent.get_client_rect(); > > > > super( parent, 1011, Wx::Point.new( 0, 0 ), rect.get_size(), > SIMPLE_BORDER, "NovaTarefa" ); > > > > sizer = Wx::BoxSizer.new(Wx::VERTICAL ); > > box = Wx::BoxSizer.new(Wx::HORIZONTAL); > > > > label = Wx::StaticText.new( self, :label => "CADASTRO DE TAREFAS > (NOVA)", :size => [250,-1] ); > > > > box.add( label, 1, Wx::ALIGN_CENTER_VERTICAL, 5); > > > > sizer.add_item(box, 0, Wx::ALIGN_CENTER|Wx::ALL, 5); > > end > > end > > > > How to make my title centered in the panel? > > > > Alejandro Michelin Salomon > > > > _____ > > avast! Antivirus : Outbound message clean. > > > Virus Database (VPS): 090319-0, 19/03/2009 > Tested on: 19/03/2009 17:32:59 > avast! - copyright (c) 1988-2009 ALWIL Software. -- Posted via http://www.ruby-forum.com/. _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users _____ avast! Antivirus : Inbound message clean. Virus Database (VPS): 090319-0, 19/03/2009 Tested on: 20/03/2009 07:35:25 avast! - copyright (c) 1988-2009 ALWIL Software. _____ avast! Antivirus : Outbound message clean. Virus Database (VPS): 090319-0, 19/03/2009 Tested on: 20/03/2009 09:05:48 avast! - copyright (c) 1988-2009 ALWIL Software. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chauk.mean at gmail.com Fri Mar 20 09:39:04 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Fri, 20 Mar 2009 14:39:04 +0100 Subject: [wxruby-users] RES: Problem centering a label In-Reply-To: <003c01c9a954$3a12d6f0$ae3884d0$@com> References: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> <19869ef2ac1d9d28a863b36c893504d5@ruby-forum.com> <003c01c9a954$3a12d6f0$ae3884d0$@com> Message-ID: Hi Alejandro, I'm not sure to understand why you need 2 sizers but your main problem is that you haven't told the panel to use the sizer ! Here is a sample code where there are 3 texts : - at the top, the text is centered - at the middle, the text is left aligned - at the bottom, the text is right aligned The important line is the one with self.sizer = box. You should also use wx constants to make your code clearer. #!/usr/bin/env ruby # 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' class MyPanel < Wx::Panel def initialize(parent) super(parent) box = Wx::BoxSizer.new (Wx::VERTICAL) box.add_item(Wx::StaticText.new(self, :label => "Centered Title"), :flag => Wx::ALIGN_CENTER) box.add_item(Wx::StaticText.new(self, :label => "Leftside Text"), :flag => Wx::ALIGN_LEFT) box.add_item(Wx::StaticText.new(self, :label => "Rightside Text"), :flag => Wx::ALIGN_RIGHT) self.sizer = box end end # This is the minimum code to start a WxRuby app - create a Frame, and # show it. Wx::App.run do frame = Wx::Frame.new(nil, :title => "Minimal wxRuby App") panel = MyPanel.new(frame) frame.show end Cheers. Chauk-Mean. From lists at ruby-forum.com Fri Mar 20 10:34:34 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Fri, 20 Mar 2009 15:34:34 +0100 Subject: [wxruby-users] RES: Problem centering a label In-Reply-To: <003c01c9a954$3a12d6f0$ae3884d0$@com> References: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> <19869ef2ac1d9d28a863b36c893504d5@ruby-forum.com> <003c01c9a954$3a12d6f0$ae3884d0$@com> Message-ID: <9411f02d2223e85c7f97ae698345d7a1@ruby-forum.com> Hi Alejandro, this one actually works: class TarefasNova < Wx::Panel def initialize(parent) super( parent, 1011, {:style => SIMPLE_BORDER, :name =>"NovaTarefa"} ); box = Wx::BoxSizer.new(Wx::HORIZONTAL); box.add_stretch_spacer(); box.add Wx::StaticText.new(self, -1, 'asdf'), 0, 1 box.add_stretch_spacer(); set_sizer box end end Watch for the parents' constructor - you needn't set size and position. Also never forget to call Panel#set_sizer or your sizer won't have any effect. hth, Christian. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Mar 20 11:02:48 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 20 Mar 2009 15:02:48 +0000 Subject: [wxruby-users] RES: Problem centering a label In-Reply-To: <9411f02d2223e85c7f97ae698345d7a1@ruby-forum.com> References: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> <19869ef2ac1d9d28a863b36c893504d5@ruby-forum.com> <003c01c9a954$3a12d6f0$ae3884d0$@com> <9411f02d2223e85c7f97ae698345d7a1@ruby-forum.com> Message-ID: <49C3B018.7020504@pressure.to> Hi Christian Schmidt wrote: > super( parent, 1011, {:style => SIMPLE_BORDER, :name > =>"NovaTarefa"} ); > > box = Wx::BoxSizer.new(Wx::HORIZONTAL); > box.add_stretch_spacer(); > box.add Wx::StaticText.new(self, -1, 'asdf'), 0, 1 > box.add_stretch_spacer(); > > Simpler, using StaticText ALIGN styles instead of extra spacers box = Wx::VBoxSizer.new st = Wx::StaticText.new(self, :label => 'adsf', :style => Wx::ALIGN_CENTRE) box.add st, 0, Wx::GROW > Watch for the parents' constructor - you needn't set size and position. > This is a good point - use sizers to have children adjust to their parent's size. Also, if a window is the only child of a frame parent (often the case with Panels inside Frames) then it will automatically take up all the avaiable space - no sizer needed. a From amichelins at gmail.com Fri Mar 20 12:56:08 2009 From: amichelins at gmail.com ((gmail) Alejandro Michelin Salomon) Date: Fri, 20 Mar 2009 13:56:08 -0300 Subject: [wxruby-users] RES: RES: Problem centering a label In-Reply-To: References: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> <19869ef2ac1d9d28a863b36c893504d5@ruby-forum.com> <003c01c9a954$3a12d6f0$ae3884d0$@com> Message-ID: <004701c9a97c$c84a4840$58ded8c0$@com> Chauk-Mean. : Your code runs ok in a separate file. If i call MyPanel from my menu to put the panel in my main frame, the code does not work. This code : begin require 'rubygems' rescue LoadError end require 'wx'; class TarefasNova < Wx::Panel def initialize(parent) super(parent) box = Wx::BoxSizer.new (Wx::VERTICAL) box.add_item(Wx::StaticText.new(self, :label => "Centered Title"), :flag => Wx::ALIGN_CENTER) box.add_item(Wx::StaticText.new(self, :label => "Leftside Text"), :flag => Wx::ALIGN_LEFT) box.add_item(Wx::StaticText.new(self, :label => "Rightside Text"), :flag => Wx::ALIGN_RIGHT) self.sizer = box end end The panel only shows ?Righ?. Does not size to fill frame. When i put : rect = parent.get_client_rect(); super( parent, 1011, Wx::Point.new( 0, 0 ), rect.get_size(), SIMPLE_BORDER, "NovaTarefa" ); This makes the panel fill frame. The frame has menu bar and statusbar. De: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] Em nome de Chauk-Mean Proum Enviada em: sexta-feira, 20 de mar?o de 2009 10:39 Para: General discussion of wxRuby Assunto: Re: [wxruby-users] RES: Problem centering a label Hi Alejandro, I'm not sure to understand why you need 2 sizers but your main problem is that you haven't told the panel to use the sizer ! Here is a sample code where there are 3 texts : - at the top, the text is centered - at the middle, the text is left aligned - at the bottom, the text is right aligned The important line is the one with self.sizer = box. You should also use wx constants to make your code clearer. #!/usr/bin/env ruby # 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' class MyPanel < Wx::Panel def initialize(parent) super(parent) box = Wx::BoxSizer.new (Wx::VERTICAL) box.add_item(Wx::StaticText.new(self, :label => "Centered Title"), :flag => Wx::ALIGN_CENTER) box.add_item(Wx::StaticText.new(self, :label => "Leftside Text"), :flag => Wx::ALIGN_LEFT) box.add_item(Wx::StaticText.new(self, :label => "Rightside Text"), :flag => Wx::ALIGN_RIGHT) self.sizer = box end end # This is the minimum code to start a WxRuby app - create a Frame, and # show it. Wx::App.run do frame = Wx::Frame.new(nil, :title => "Minimal wxRuby App") panel = MyPanel.new(frame) frame.show end Cheers. Chauk-Mean. _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users _____ avast! Antivirus : Inbound message clean. Virus Database (VPS): 090319-0, 19/03/2009 Tested on: 20/03/2009 13:13:39 avast! - copyright (c) 1988-2009 ALWIL Software. _____ avast! Antivirus : Outbound message clean. Virus Database (VPS): 090319-0, 19/03/2009 Tested on: 20/03/2009 13:56:02 avast! - copyright (c) 1988-2009 ALWIL Software. -------------- next part -------------- An HTML attachment was scrubbed... URL: From transfire at gmail.com Fri Mar 20 14:05:01 2009 From: transfire at gmail.com (Trans) Date: Fri, 20 Mar 2009 14:05:01 -0400 Subject: [wxruby-users] xrc file and WxGrid In-Reply-To: <4b6f054f0903191251l15901208ldf9453f59347d1ec@mail.gmail.com> References: <4b6f054f0903191109q2c5ed3f7p45cfb29d61728da6@mail.gmail.com> <4b6f054f0903191251l15901208ldf9453f59347d1ec@mail.gmail.com> Message-ID: <4b6f054f0903201105w460c2d84r8188c84224538db7@mail.gmail.com> FYI. I've given up on the XRC file. I went back to doing it all by hand. Using WxFormBuilder in the interm did help me understand the controls better though. So that's a good thing. So, I finally got my UI working like I want it too. I'm going to blog about it and demonstrate the bottom up technique I worked out that makes it much easier to design the interface using wxRuby. Thanks for the help, T. From lists at ruby-forum.com Fri Mar 20 18:52:19 2009 From: lists at ruby-forum.com (Scott thorpe) Date: Fri, 20 Mar 2009 23:52:19 +0100 Subject: [wxruby-users] xrc file and WxGrid In-Reply-To: <4b6f054f0903201105w460c2d84r8188c84224538db7@mail.gmail.com> References: <4b6f054f0903191109q2c5ed3f7p45cfb29d61728da6@mail.gmail.com> <4b6f054f0903191251l15901208ldf9453f59347d1ec@mail.gmail.com> <4b6f054f0903201105w460c2d84r8188c84224538db7@mail.gmail.com> Message-ID: <376bcca91f63d73ac13a598588974de6@ruby-forum.com> Thomas Sawyer wrote: > FYI. I've given up on the XRC file. I went back to doing it all by > hand. Using WxFormBuilder in the interm did help me understand the > controls better though. So that's a good thing. > > So, I finally got my UI working like I want it too. I'm going to blog > about it and demonstrate the bottom up technique I worked out that > makes it much easier to design the interface using wxRuby. > > Thanks for the help, > T. I'm sorry. But its kinda funny after opening the files you attached. I had to giggle. Just curious. Did you run xrcise ? --Scott -- Posted via http://www.ruby-forum.com/. From transfire at gmail.com Fri Mar 20 20:14:28 2009 From: transfire at gmail.com (Trans) Date: Fri, 20 Mar 2009 20:14:28 -0400 Subject: [wxruby-users] xrc file and WxGrid In-Reply-To: <376bcca91f63d73ac13a598588974de6@ruby-forum.com> References: <4b6f054f0903191109q2c5ed3f7p45cfb29d61728da6@mail.gmail.com> <4b6f054f0903191251l15901208ldf9453f59347d1ec@mail.gmail.com> <4b6f054f0903201105w460c2d84r8188c84224538db7@mail.gmail.com> <376bcca91f63d73ac13a598588974de6@ruby-forum.com> Message-ID: <4b6f054f0903201714j143c0663x13cf06a93e0339a7@mail.gmail.com> On Fri, Mar 20, 2009 at 6:52 PM, Scott thorpe wrote: > Thomas Sawyer wrote: >> FYI. I've given up on the XRC file. I went back to doing it all by >> hand. Using WxFormBuilder in the interm did help me understand the >> controls better though. So that's a good thing. >> >> So, I finally got my UI working like I want it too. I'm going to blog >> about it and demonstrate the bottom up technique I worked out that >> makes it much easier to design the interface using wxRuby. >> >> Thanks for the help, >> T. > > I'm sorry. But its kinda funny after opening the files you attached. I > had to giggle. > > Just curious. Did you run xrcise ? I did --once I figured out how to set the subclass of the main frame. But that blew out with an error too. I've attached it. It's not much different then what I tried by hand. T. -------------- next part -------------- A non-text attachment was scrubbed... Name: xepony.rb Type: application/octet-stream Size: 4143 bytes Desc: not available URL: From transfire at gmail.com Fri Mar 20 20:15:44 2009 From: transfire at gmail.com (Trans) Date: Fri, 20 Mar 2009 20:15:44 -0400 Subject: [wxruby-users] xrc file and WxGrid In-Reply-To: <4b6f054f0903201714j143c0663x13cf06a93e0339a7@mail.gmail.com> References: <4b6f054f0903191109q2c5ed3f7p45cfb29d61728da6@mail.gmail.com> <4b6f054f0903191251l15901208ldf9453f59347d1ec@mail.gmail.com> <4b6f054f0903201105w460c2d84r8188c84224538db7@mail.gmail.com> <376bcca91f63d73ac13a598588974de6@ruby-forum.com> <4b6f054f0903201714j143c0663x13cf06a93e0339a7@mail.gmail.com> Message-ID: <4b6f054f0903201715s38742ca5s75955ea857313170@mail.gmail.com> On Fri, Mar 20, 2009 at 8:14 PM, Trans wrote: > On Fri, Mar 20, 2009 at 6:52 PM, Scott thorpe wrote: >> Thomas Sawyer wrote: >>> FYI. I've given up on the XRC file. I went back to doing it all by >>> hand. Using WxFormBuilder in the interm did help me understand the >>> controls better though. So that's a good thing. >>> >>> So, I finally got my UI working like I want it too. I'm going to blog >>> about it and demonstrate the bottom up technique I worked out that >>> makes it much easier to design the interface using wxRuby. >>> >>> Thanks for the help, >>> T. >> >> I'm sorry. But its kinda funny after opening the files you attached. I >> had to giggle. The whole thing would be hysterical if it wasn't such a pain in my butt!!! ;-) T. From lists at ruby-forum.com Sat Mar 21 21:03:55 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Sun, 22 Mar 2009 02:03:55 +0100 Subject: [wxruby-users] Documentation for SplitterWindow is slightly wrong Message-ID: <23c81ee8bee564d4b084d3e81b9aa88b@ruby-forum.com> Hi Alex, the documentation mentions SplitterWindow#get_window_1 but SplitterWindow actually implements this method as "get_window1". Same applies for get_window_2. Cheers, Christian. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Mar 22 16:06:24 2009 From: lists at ruby-forum.com (Michael Satterwhite) Date: Sun, 22 Mar 2009 21:06:24 +0100 Subject: [wxruby-users] ListView Appears Completely Broken Message-ID: <8827bf1ea15fb10449ca4973a7ded351@ruby-forum.com> The documentation says that the ListView control should be used in preference to ListCtrl. I can find the ListView documentation from a link on the ListCtrl page, but the ListView isn't on the list of controls on the class reference. I then call up irb and enter the following: require 'wx' Wx::ListView.methods and get the response: uninitialized constant Wxruby2::ListView Is the class completely broken in wxRuby, or is there a piece of magic that I'm missing? I've got a pretty good record of missing the obvious. Thanks much ---Michael -- Posted via http://www.ruby-forum.com/. From transfire at gmail.com Sun Mar 22 22:03:55 2009 From: transfire at gmail.com (Trans) Date: Sun, 22 Mar 2009 22:03:55 -0400 Subject: [wxruby-users] How to put a background image on a panel Message-ID: <4b6f054f0903221903n251ca0ads235021f8d2eb761f@mail.gmail.com> Well I've made a lot of progress on my app, but I'm stuck on figuring out how to add a bitmap. I have a notebook and a page panel. On this panel I want to put a backdrop image and scale it to the size of the panel. How do I do this? I looked at some of the samples related to bitmaps and I could not see how to apply that to my situation. Thanks, T. From mario at ruby-im.net Mon Mar 23 04:12:24 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 23 Mar 2009 03:12:24 -0500 Subject: [wxruby-users] How to put a background image on a panel In-Reply-To: <4b6f054f0903221903n251ca0ads235021f8d2eb761f@mail.gmail.com> References: <4b6f054f0903221903n251ca0ads235021f8d2eb761f@mail.gmail.com> Message-ID: See: http://rubyforge.org/pipermail/wxruby-users/2009-January/004448.html On Sun, Mar 22, 2009 at 9:03 PM, Trans wrote: > Well I've made a lot of progress on my app, but I'm stuck on figuring > out how to add a bitmap. I have a notebook and a page panel. On this > panel I want to put a backdrop image and scale it to the size of the > panel. How do I do this? I looked at some of the samples related to > bitmaps and I could not see how to apply that to my situation. > > Thanks, > T. > _______________________________________________ > 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 transfire at gmail.com Mon Mar 23 06:19:55 2009 From: transfire at gmail.com (Trans) Date: Mon, 23 Mar 2009 06:19:55 -0400 Subject: [wxruby-users] How to put a background image on a panel In-Reply-To: References: <4b6f054f0903221903n251ca0ads235021f8d2eb761f@mail.gmail.com> Message-ID: <4b6f054f0903230319o29f6314btc19a32a27ae2d784@mail.gmail.com> 2009/3/23 Mario Steele : > See: http://rubyforge.org/pipermail/wxruby-users/2009-January/004448.html Thanks. Though that only got me so far. I added: class Backdrop < Wx::Window def initialize(parent, image) @parent = parent @image = Wx::Image.new(image) super(parent) evt_erase_background :on_erase_background end def on_erase_background(evt) size = @parent.get_client_size set_size(size) @image.scale(size.get_width, size.get_height) evt.dc.draw_bitmap(@image.to_bitmap, 0, 0, false) end end And then added an instance of it to my panel's boxsizer: file = (DIR + '/images/cover.jpg') image = Backdrop.new(cover_panel, file) cover_sizer.add(image) It draws the image initially but it isn't scaled for some reason and then when I resize the window it shrinks to a small square. T. From mario at ruby-im.net Mon Mar 23 09:20:53 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 23 Mar 2009 08:20:53 -0500 Subject: [wxruby-users] How to put a background image on a panel In-Reply-To: <4b6f054f0903230319o29f6314btc19a32a27ae2d784@mail.gmail.com> References: <4b6f054f0903221903n251ca0ads235021f8d2eb761f@mail.gmail.com> <4b6f054f0903230319o29f6314btc19a32a27ae2d784@mail.gmail.com> Message-ID: Remove the set_size from the on_erase_background(), you shouldn't use set_size() in on_erase_background(). On Mon, Mar 23, 2009 at 5:19 AM, Trans wrote: > 2009/3/23 Mario Steele : > > See: > http://rubyforge.org/pipermail/wxruby-users/2009-January/004448.html > > Thanks. Though that only got me so far. I added: > > class Backdrop < Wx::Window > def initialize(parent, image) > @parent = parent > @image = Wx::Image.new(image) > super(parent) > evt_erase_background :on_erase_background > end > > def on_erase_background(evt) > size = @parent.get_client_size > set_size(size) > @image.scale(size.get_width, size.get_height) > evt.dc.draw_bitmap(@image.to_bitmap, 0, 0, false) > end > end > > And then added an instance of it to my panel's boxsizer: > > file = (DIR + '/images/cover.jpg') > image = Backdrop.new(cover_panel, file) > cover_sizer.add(image) > > It draws the image initially but it isn't scaled for some reason and > then when I resize the window it shrinks to a small square. > > T. > _______________________________________________ > 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 Mar 23 13:45:42 2009 From: lists at ruby-forum.com (Michael Satterwhite) Date: Mon, 23 Mar 2009 18:45:42 +0100 Subject: [wxruby-users] Problem with ListCtrl Width Message-ID: <48c92e41c4de91f2956536415434763f@ruby-forum.com> I'm still learning wxWidgets, so this is probably basic. I have some data that I'm trying to display in a wxListCtrl. The ListCtrl is in a Box Sizer that is stacked in a main box sizer. the list control is the only control in the specific box sizer containing it. The problem is that the sizer is squeezing the width of the list control down to the point that only a column and a half are visible without horizontal scrolling. The form is actually wide enough that it should be able to display all the columns. How do I tell the layout to expand the width of the wxListCtrl? Here's my code for the ListCtrl: #Put the item list on the screen @itemSizer = Wx::BoxSizer.new(Wx::HORIZONTAL) @itemList = Wx::ListCtrl.new(self, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, Wx::LC_REPORT | Wx::LC_HRULES | Wx::LC_VRULES) row = 0 @itemList.insert_column(0, "Date") @itemList.insert_column(1, "Start") @itemList.insert_column(2, "End") @itemList.insert_column(3, "Description") @itemList.insert_column(4, "Elapsed") @itemList.insert_column(5, "No Charge") @itemSizer.add(@itemList, 1, Wx::TOP | Wx::LEFT, 15) @mainSizer.add(@itemSizer, 1, Wx::ALIGN_LEFT | Wx::LEFT |Wx::BOTTOM, 15) Thanks in advance ---Michael -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Mar 23 16:19:14 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Mon, 23 Mar 2009 21:19:14 +0100 Subject: [wxruby-users] Problem with ListCtrl Width In-Reply-To: <48c92e41c4de91f2956536415434763f@ruby-forum.com> References: <48c92e41c4de91f2956536415434763f@ruby-forum.com> Message-ID: <4e3a7b90801294e2178941488fa3b2c6@ruby-forum.com> Hi Michael, my advice would be: 1) go to this page: http://wxruby.rubyforge.org/doc/sizer.html#Sizer_add and read it once or twice 2) go and fetch an evaluation copy of DialogBlocks here: http://www.anthemion.co.uk/dialogblocks/download.htm DialogBlocks flattens your learning curve a lot if you're more of the learning by doing type of guy... And pay special attention to the Wx::EXPAND flag and the proportion parameter ;-) Christian. Michael Satterwhite wrote: > I'm still learning wxWidgets, so this is probably basic. > -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Mar 23 16:23:26 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 23 Mar 2009 20:23:26 +0000 Subject: [wxruby-users] Problem with ListCtrl Width In-Reply-To: <48c92e41c4de91f2956536415434763f@ruby-forum.com> References: <48c92e41c4de91f2956536415434763f@ruby-forum.com> Message-ID: <49C7EFBE.30702@pressure.to> Michael Satterwhite wrote: > The problem is that the sizer is squeezing the width of the list control > down to the point that only a column and a half are visible without > horizontal scrolling. The form is actually wide enough that it should be > able to display all the columns. > > How do I tell the layout to expand the width of the wxListCtrl? > Hard to be certain without seeing the whole context, but I'd guess you should be adding a Wx::GROW flag to the sizer#add calls. This tells the Sizer to expand that item to fill all the space in the non-main sizer direction. So, if the sizer's vertical, adding Wx::GROW (or Wx::EXPAND, it's a synonym), the listctrl will fill all the horizontal space available. A few random hints: > Here's my code for the ListCtrl: > > #Put the item list on the screen > @itemSizer = Wx::BoxSizer.new(Wx::HORIZONTAL) > @itemSizer = Wx::HBoxSizer.new And, are you sure you need two sizers? > @itemList = Wx::ListCtrl.new(self, -1, > Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, > Wx::LC_REPORT | Wx::LC_HRULES | Wx::LC_VRULES) > @itemList = Wx::ListCtrl.new(self, :style => Wx::LC_REPORT|Wx::LC_HRULES|Wx::LC_VRULES) alex From lists at ruby-forum.com Mon Mar 23 18:41:40 2009 From: lists at ruby-forum.com (Christian Schmidt) Date: Mon, 23 Mar 2009 23:41:40 +0100 Subject: [wxruby-users] No evt_tree_sel_changed with TR_MULTIPLE Message-ID: Hi, I have a problem with evt_tree_sel_changed not getting fired when I'm selecting a node programatically on a TreeCtrl with the TR_MULTIPLE flag set. Is this intended? I've got some code depending on the evt-handler. Can I work around this? I thought of EvtHandler#add_pending_event but I can't figure out the correct commandType parameter to TreeEvent#new. Here's a sample app, that demonstrates the above: require 'wx' include Wx class MyFrame < Frame def initialize super nil, -1, "no sel event" @tree = TreeCtrl.new(self, -1, :style => TR_MULTIPLE) evt_tree_sel_changed(@tree) do |e| puts "sel changed #{@tree.get_item_text(e.get_item)}" end @root = @tree.add_root 'root', 0 child = @tree.insert_item @root, 0, 'child' @tree.expand @root @tree.select_item child end end class MyApp < App def on_init f = MyFrame.new f.show end end MyApp.new.main_loop Thanks in advance, Christian. Attachments: http://www.ruby-forum.com/attachment/3480/tree_no_selection_evt.rb -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Mar 24 02:59:59 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 24 Mar 2009 06:59:59 +0000 Subject: [wxruby-users] No evt_tree_sel_changed with TR_MULTIPLE In-Reply-To: References: Message-ID: <49C884EF.7050803@pressure.to> Hi Christian Christian Schmidt wrote: > I have a problem with evt_tree_sel_changed not getting fired when I'm > selecting a node programatically on a TreeCtrl with the TR_MULTIPLE flag > set. > I think it's a wxWidgets bug: http://trac.wxwidgets.org/ticket/9570 > I've got some code depending on the evt-handler. > Can I work around this? I thought of EvtHandler#add_pending_event but I > can't figure out the correct commandType parameter to TreeEvent#new. The event type is an integer constant which uniquely identifies that kind of event. In this case, you want Wx::EVT_COMMAND_TREE_SEL_CHANGED. For reference, you can see the mapping of all event types to event classes in lib/wx/classes/evthandler.rb http://wxruby.rubyforge.org/svn/branches/wxruby_2_0_stable/lib/wx/classes/evthandler.rb a From alex at pressure.to Tue Mar 24 03:06:43 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 24 Mar 2009 07:06:43 +0000 Subject: [wxruby-users] ListView Appears Completely Broken In-Reply-To: <8827bf1ea15fb10449ca4973a7ded351@ruby-forum.com> References: <8827bf1ea15fb10449ca4973a7ded351@ruby-forum.com> Message-ID: <49C88683.3020703@pressure.to> Hi Michael Michael Satterwhite wrote: > The documentation says that the ListView control should be used in > preference to ListCtrl. I can find the ListView documentation from a > link on the ListCtrl page, but the ListView isn't on the list of > controls on the class reference. Sorry, there's no ListView in wxRuby; just use ListCtrl. The recommendation was inherited from the C++ docs which we used as the starting point for the ruby docs. But in Ruby, ListCtrl isn't that hard to use, so the 'simpler' class was redundant. I'll update the docs. thanks alex From transfire at gmail.com Tue Mar 24 14:55:03 2009 From: transfire at gmail.com (trans) Date: Tue, 24 Mar 2009 11:55:03 -0700 (PDT) Subject: [wxruby-users] Google Group Message-ID: <66b8ec1d-1e59-4aa6-9743-11bfac4b983d@e38g2000yqa.googlegroups.com> Hi, This is just to let you all know that I setup a Google Group mirror of this mailing list (wxruby-users at rubyforge.org). I prefer to use this interface rather than use my Inbox. All are of course welcome to do the same. Note to new subscribers: If you want to post via the google group you must first join the original list (see http://wxruby.rubyforge.org). T. From penguinroad at gmail.com Tue Mar 24 21:56:51 2009 From: penguinroad at gmail.com (hendra kusuma) Date: Wed, 25 Mar 2009 08:56:51 +0700 Subject: [wxruby-users] a newbie with some question Message-ID: <26dadb3d0903241856x3d540dddh15fcc4c09a413e21@mail.gmail.com> Hi, I'm new here I'm planing to use wxruby to create a database program with sqlite as backend My system is Ubuntu 8.04, ruby 1.8.6 and wxruby-2.0.0 I choose to use xrc file as GUI definition but somehow wxsugar didn't work with my system (xrcise is not a known command) So I write ruby code to load the xrc file manually (thanks google) and it works, with some problem though so here is my question 1. Tab-navigation is not working (I pressed tab and the focus is not moving to next widget). How do I get this working? 2. I cannot get a menu-item widget to work > @menu = @finder.call("menuItem_quit") > does not work Thanks here is my code : ### require 'rubygems' require 'wx' class Frame < Wx::Frame def initialize() super() xml = Wx::XmlResource.get xml.flags = 2 xml.init_all_handlers xml.load("siswa.xrc") xml.load_frame_subclass(self, parent, "Siswa") @finder = lambda do | x | int_id = Wx::xrcid(x) begin Wx::Window.find_window_by_id(int_id, self) || int_idvt_button(button_save) { save() } rescue RuntimeError int_id end end @txtNis = @finder.call("textCtrl_nis") @txtNama = @finder.call("textCtrl_nama") button_quit = @finder.call("button_quit") evt_button(button_quit) { quit() } end def quit() self.close() end end Wx::App.run do a = Frame.new().show end ### and this is the xrc file ### 480,640 Siswa 2 2 10 10 0 wxEXPAND 5 2 2 5 5 1 5 wxEXPAND 5 0 5 wxEXPAND 5 0 5 wxVERTICAL wxEXPAND 5 0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From amichelins at gmail.com Wed Mar 25 10:01:10 2009 From: amichelins at gmail.com ((gmail) Alejandro Michelin Salomon) Date: Wed, 25 Mar 2009 11:01:10 -0300 Subject: [wxruby-users] RES: Problem centering a label SOLVED!!!! In-Reply-To: References: <002701c9a8d1$eaa3bbc0$bfeb3340$@com> <19869ef2ac1d9d28a863b36c893504d5@ruby-forum.com> <003c01c9a954$3a12d6f0$ae3884d0$@com> Message-ID: <000001c9ad52$28442d50$78cc87f0$@com> Hi : The problem is that, after call to create the child panel, i need to call send_size_event(). I find the solution becouse i minize the aplication to see the code in the editor and when i maxsimize the aplicattion the panel is ok filling all the frame space. Alejandro _____ avast! Antivirus : Outbound message clean. Virus Database (VPS): 090324-0, 24/03/2009 Tested on: 25/03/2009 11:01:09 avast! - copyright (c) 1988-2009 ALWIL Software. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Wed Mar 25 13:04:08 2009 From: lists at ruby-forum.com (7stud --) Date: Wed, 25 Mar 2009 18:04:08 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby Message-ID: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> I installed wxruby like this: $ cd ~/Desktop ~/Desktop$ gem install wxruby-2.0.0-universal-darwin-9.gem and I got a message that said wxruby installed successfully. I tested a simple wxruby program, and I got that to work. Then I upgraded from ruby 1.8.2 to ruby 1.8.6. I followed the Hivelogic instructions here: http://hivelogic.com/articles/2007/02/ruby-rails-mongrel-mysql-osx and everything seemed to install correctly. $ ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1] I also upgraded from rubygems 0.9.4 to rubygems 1.3.1. I downloaded rubygems 1.3.1 and installed locally: /usr/local/src$ ls -al total 15968 drwxrwxr-x 7 root admin 238 Mar 25 02:13 . drwxr-xr-x 12 root wheel 408 Mar 24 00:09 .. drwxr-xr-x 113 me admin 3842 Mar 24 01:08 readline-6.0 -rw-r--r-- 1 me admin 2270818 Mar 24 00:21 readline-6.0.tar.gz drwxr-xr-x 154 me admin 5236 Mar 25 02:02 ruby-1.8.6 -rw-r--r-- 1 me admin 4589394 Mar 24 00:52 ruby-1.8.6.tar.gz -rw-r--r-- 1 me me 1310720 Feb 24 11:00 rubygems-1.3.1.tar /usr/local/src$ tar -xvf rubygems-1.3.1.tar /usr/local/src$ cd rubygems-1.3.1 /usr/local/src/rubygems-1.3.1$ sudo /usr/local/bin/ruby setup.rb $ gem -v 1.3.1 But now when I try to require wxruby, I get an error: r1test.rb ------- require 'rubygems' require 'wx' $ ruby r1test.rb /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- wx (LoadError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from r1test.rb:2 I tried all of the following as well: require 'wx' --- require 'rubygems' require 'wxruby' -- require 'wxruby' I got an error for each one. My PATH is a little different than in the Hivelogic instructions. Here are the last few lines in my ~/.bash_profile file: --------- ... ... PATH="/usr/local/bin:$PATH" export PATH PATH="/usr/local/sbin:$PATH" "added for ruby 1.8.6 install export PATH ----------- Because /usr/local/bin was already tacked onto the front of the path in the previous setting, I just added /usr/local/sbin to the front of the path. I didn't think that would cause any adverse affects. My question is: where did wxruby go? What happened when I did this: > ~/Desktop$ gem install wxruby-2.0.0-universal-darwin-9.gem Here is some more information: $ gem environment gemdir /usr/local/lib/ruby/gems/1.8 $ cd /usr/local/lib/ruby/gems/1.8 ... /usr/local/lib/ruby/gems/1.8$ ls -al total 0 drwxrwxr-x 6 root wheel 204 Mar 2 2008 . drwxrwxr-x 3 root wheel 102 Jul 8 2007 .. drwxrwxr-x 10 root wheel 340 Feb 11 2008 cache drwxr-xr-x 11 root wheel 374 Mar 25 02:15 doc drwxrwxr-x 10 root wheel 340 Mar 2 2008 gems drwxrwxr-x 10 root wheel 340 Mar 2 2008 specifications ... /usr/local/lib/ruby/gems/1.8$ cd gems ... /usr/local/lib/ruby/gems/1.8/gems$ ls -al total 0 drwxrwxr-x 10 root wheel 340 Mar 2 2008 . drwxrwxr-x 6 root wheel 204 Mar 2 2008 .. drwxr-xr-x 14 root wheel 476 Jan 27 2008 fastercsv-1.2.3 drwxr-xr-x 9 root wheel 306 Feb 11 2008 hoe-1.5.0 drwxr-xr-x 11 root wheel 374 Jan 27 2008 hpricot-0.6 drwxr-xr-x 11 root wheel 374 Jan 27 2008 libxml-ruby-0.5.2.0 drwxr-xr-x 14 root wheel 476 Feb 11 2008 mechanize-0.7.0 drwxr-xr-x 12 root wheel 408 Feb 11 2008 rake-0.8.1 drwxr-xr-x 9 root wheel 306 Feb 11 2008 rubyforge-0.4.4 drwxr-xr-x 19 root wheel 646 Jan 27 2008 rubygems-update-1.0.1 ... /usr/local/lib/ruby/gems/1.8/gems$ $ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.1 - RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1] - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/local/bin/ruby - EXECUTABLE DIRECTORY: /usr/local/bin - RUBYGEMS PLATFORMS: - ruby - x86-darwin-8 - GEM PATHS: - /usr/local/lib/ruby/gems/1.8 - /Users/autie/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://gems.rubyforge.org/ -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Wed Mar 25 15:19:04 2009 From: mario at ruby-im.net (Mario Steele) Date: Wed, 25 Mar 2009 14:19:04 -0500 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> Message-ID: Hello 7stud, On Wed, Mar 25, 2009 at 12:04 PM, 7stud -- wrote: > I installed wxruby like this: > > $ cd ~/Desktop > ~/Desktop$ gem install wxruby-2.0.0-universal-darwin-9.gem > > and I got a message that said wxruby installed successfully. I tested a > simple wxruby program, and I got that to work. > > Then I upgraded from ruby 1.8.2 to ruby 1.8.6. I followed the Hivelogic > instructions here: > > http://hivelogic.com/articles/2007/02/ruby-rails-mongrel-mysql-osx > > and everything seemed to install correctly. > > $ ruby -v > ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1] > > I also upgraded from rubygems 0.9.4 to rubygems 1.3.1. I downloaded > rubygems 1.3.1 and installed locally: > > /usr/local/src$ ls -al > total 15968 > drwxrwxr-x 7 root admin 238 Mar 25 02:13 . > drwxr-xr-x 12 root wheel 408 Mar 24 00:09 .. > drwxr-xr-x 113 me admin 3842 Mar 24 01:08 readline-6.0 > -rw-r--r-- 1 me admin 2270818 Mar 24 00:21 readline-6.0.tar.gz > drwxr-xr-x 154 me admin 5236 Mar 25 02:02 ruby-1.8.6 > -rw-r--r-- 1 me admin 4589394 Mar 24 00:52 ruby-1.8.6.tar.gz > -rw-r--r-- 1 me me 1310720 Feb 24 11:00 rubygems-1.3.1.tar > > /usr/local/src$ tar -xvf rubygems-1.3.1.tar > /usr/local/src$ cd rubygems-1.3.1 > /usr/local/src/rubygems-1.3.1$ sudo /usr/local/bin/ruby setup.rb > > $ gem -v > 1.3.1 > > > But now when I try to require wxruby, I get an error: > > r1test.rb > ------- > require 'rubygems' > require 'wx' > > > $ ruby r1test.rb > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require': no such file to load -- wx (LoadError) > from > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require' > from r1test.rb:2 > > > I tried all of the following as well: > > require 'wx' > --- > require 'rubygems' > require 'wxruby' > -- > require 'wxruby' > > I got an error for each one. > > > My PATH is a little different than in the Hivelogic instructions. Here > are the last few > lines in my ~/.bash_profile file: > > --------- > ... > ... > > PATH="/usr/local/bin:$PATH" > export PATH > > PATH="/usr/local/sbin:$PATH" "added for ruby 1.8.6 install > export PATH > ----------- > > Because /usr/local/bin was already tacked onto the front of the path in > the > previous setting, I just added /usr/local/sbin to the front of the path. > I didn't think that would cause any adverse affects. > > My question is: where did wxruby go? What happened when I did this: > > > ~/Desktop$ gem install wxruby-2.0.0-universal-darwin-9.gem > > > Here is some more information: > > $ gem environment gemdir > /usr/local/lib/ruby/gems/1.8 > > $ cd /usr/local/lib/ruby/gems/1.8 > > ... /usr/local/lib/ruby/gems/1.8$ ls -al > total 0 > drwxrwxr-x 6 root wheel 204 Mar 2 2008 . > drwxrwxr-x 3 root wheel 102 Jul 8 2007 .. > drwxrwxr-x 10 root wheel 340 Feb 11 2008 cache > drwxr-xr-x 11 root wheel 374 Mar 25 02:15 doc > drwxrwxr-x 10 root wheel 340 Mar 2 2008 gems > drwxrwxr-x 10 root wheel 340 Mar 2 2008 specifications > > ... /usr/local/lib/ruby/gems/1.8$ cd gems > > ... /usr/local/lib/ruby/gems/1.8/gems$ ls -al > total 0 > drwxrwxr-x 10 root wheel 340 Mar 2 2008 . > drwxrwxr-x 6 root wheel 204 Mar 2 2008 .. > drwxr-xr-x 14 root wheel 476 Jan 27 2008 fastercsv-1.2.3 > drwxr-xr-x 9 root wheel 306 Feb 11 2008 hoe-1.5.0 > drwxr-xr-x 11 root wheel 374 Jan 27 2008 hpricot-0.6 > drwxr-xr-x 11 root wheel 374 Jan 27 2008 libxml-ruby-0.5.2.0 > drwxr-xr-x 14 root wheel 476 Feb 11 2008 mechanize-0.7.0 > drwxr-xr-x 12 root wheel 408 Feb 11 2008 rake-0.8.1 > drwxr-xr-x 9 root wheel 306 Feb 11 2008 rubyforge-0.4.4 > drwxr-xr-x 19 root wheel 646 Jan 27 2008 rubygems-update-1.0.1 > ... /usr/local/lib/ruby/gems/1.8/gems$ > > > $ gem env > RubyGems Environment: > - RUBYGEMS VERSION: 1.3.1 > - RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1] > - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8 > - RUBY EXECUTABLE: /usr/local/bin/ruby > - EXECUTABLE DIRECTORY: /usr/local/bin > - RUBYGEMS PLATFORMS: > - ruby > - x86-darwin-8 > - GEM PATHS: > - /usr/local/lib/ruby/gems/1.8 > - /Users/autie/.gem/ruby/1.8 > - GEM CONFIGURATION: > - :update_sources => true > - :verbose => true > - :benchmark => false > - :backtrace => false > - :bulk_threshold => 1000 > - REMOTE SOURCES: > - http://gems.rubyforge.org/ > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > More then likely, wxruby is in the previous gem's directory, where you had 0.9.7 of rubygems installed. If you poped off the /usr/local/bin and /usr/local/sbin path from your PATH variable, and do a gem list --local, you'll find wxruby is installed there, so you need to re-do the gem install wxruby-2.0.0-universal-darwin-9.gem -- 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 Thu Mar 26 02:34:54 2009 From: lists at ruby-forum.com (7stud --) Date: Thu, 26 Mar 2009 07:34:54 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> Message-ID: <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> Mario Steele wrote: > Hello 7stud, > > On Wed, Mar 25, 2009 at 12:04 PM, 7stud -- wrote: > >> >> /usr/local/src$ ls -al >> /usr/local/src$ cd rubygems-1.3.1 >> require 'rubygems' >> >> I got an error for each one. >> PATH="/usr/local/bin:$PATH" >> >> $ cd /usr/local/lib/ruby/gems/1.8 >> ... /usr/local/lib/ruby/gems/1.8$ cd gems >> drwxr-xr-x 12 root wheel 408 Feb 11 2008 rake-0.8.1 >> - RUBY EXECUTABLE: /usr/local/bin/ruby >> - :benchmark => false >> > More then likely, wxruby is in the previous gem's directory, where you > had > 0.9.7 of rubygems installed. If you poped off the /usr/local/bin and > /usr/local/sbin path from your PATH variable, and do a gem list --local, > you'll find wxruby is installed there, > Thanks for the response. I removed the following lines from my ~/.bash_profile file: ------------ ... ... PATH="/usr/local/bin:$PATH" export PATH PATH="/usr/local/sbin:$PATH" export PATH ------------- Then did: $ . ~/.bash_profile Then I closed all my Terminal windows, and opened a new Terminal window and typed: $ gem list --local *** LOCAL GEMS *** fastercsv (1.2.1) FasterCSV is CSV, but faster, smaller, and cleaner. json (1.1.1) A JSON implementation as a Ruby extension rake (0.7.3) Ruby based make-like utility. ruby-json (1.1.2) ruby-json is a library for using JavaScript Object Notation (JSON) under Ruby. rubygems-update (1.0.0) RubyGems Update GEM sources (0.0.1) This package provides download sources for remote gem installation wxruby (2.0.0) Ruby interface to the wxWidgets GUI library There it is. The last one. Those gems are different than the ones listed here: ... /usr/local/lib/ruby/gems/1.8/gems$ ls -al total 0 drwxrwxr-x 10 root wheel 340 Mar 2 2008 . drwxrwxr-x 6 root wheel 204 Mar 2 2008 .. drwxr-xr-x 14 root wheel 476 Jan 27 2008 fastercsv-1.2.3 drwxr-xr-x 9 root wheel 306 Feb 11 2008 hoe-1.5.0 drwxr-xr-x 11 root wheel 374 Jan 27 2008 hpricot-0.6 drwxr-xr-x 11 root wheel 374 Jan 27 2008 libxml-ruby-0.5.2.0 drwxr-xr-x 14 root wheel 476 Feb 11 2008 mechanize-0.7.0 drwxr-xr-x 12 root wheel 408 Feb 11 2008 rake-0.8.1 drwxr-xr-x 9 root wheel 306 Feb 11 2008 rubyforge-0.4.4 drwxr-xr-x 19 root wheel 646 Jan 27 2008 rubygems-update-1.0.1 So I ran a find to figure out where wxruby was located: $ find /usr -name 'wxruby*' /usr/lib/ruby/gems/1.8/cache/wxruby-2.0.0-universal-darwin-9.gem /usr/lib/ruby/gems/1.8/doc/wxruby-2.0.0-universal-darwin-9 /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-universal-darwin-9 /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-universal-darwin-9/lib/wxruby2.bundle /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-universal-darwin-9/samples/drawing/wxruby-logo.png /usr/lib/ruby/gems/1.8/specifications/wxruby-2.0.0-universal-darwin-9.gemspec find: /usr/local/mysql-5.0.41-osx10.4-i686/data: Permission denied And then: $ cd /usr/lib/ruby/gems/1.8/gems .. /usr/lib/ruby/gems/1.8/gems$ ls -al total 0 drwxr-xr-x 10 root wheel 340 Mar 24 01:31 . drwxr-xr-x 7 root wheel 238 Oct 7 2007 .. drwxr-xr-x 14 root wheel 476 Oct 8 2007 fastercsv-1.2.1 drwxr-xr-x 17 root wheel 578 Nov 23 2007 json-1.1.1 drwxr-xr-x 10 root wheel 340 Oct 20 2007 libxml-ruby-0.5.2.0 drwxr-xr-x 12 root wheel 408 Oct 7 2007 rake-0.7.3 drwxr-xr-x 8 root wheel 272 Nov 23 2007 ruby-json-1.1.2 drwxr-xr-x 19 root wheel 646 Jan 25 2008 rubygems-update-1.0.0 drwxr-xr-x 3 root wheel 102 Oct 7 2007 sources-0.0.1 drwxr-xr-x 7 root wheel 238 Mar 24 01:31 wxruby-2.0.0-universal-darwin-9 So why are some gems in /usr/lib while other gems are in /usr/local/lib? Where should they be? -- Posted via http://www.ruby-forum.com/. From fabio.petrucci at gmail.com Thu Mar 26 13:25:23 2009 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Thu, 26 Mar 2009 18:25:23 +0100 Subject: [wxruby-users] XRS files Message-ID: Hi all, do wxruby support loading xrs files (xrc compiled)? tnx. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Thu Mar 26 13:58:26 2009 From: mario at ruby-im.net (Mario Steele) Date: Thu, 26 Mar 2009 12:58:26 -0500 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> Message-ID: Well, the reason why you had to follow the Hive Logic guide to upgrade the versions of Ruby and RubyGems installed, is cause there are some components, I don't know which, of Mac OS X, that utitlize Ruby, and attempting to upgrade Ruby in thoes areas, can mess up your system. What happens, is that the system's copy of Ruby, is installed to /usr. Meaning, Libraries are installed in /usr/lib, Binaries are in /usr/bin, Includes are in /usr/include, etc, etc. Where as the HiveLogic guide has you installing Ruby into /usr/local, meaning Libraries are installed in /usr/local/lib, Binaries are in /usr/local/bin, Includes are in /usr/local/include, etc, etc. So as you can see, you have an instance of two different copies of Ruby being installed onto your hard drive, in two different areas. If you want to take the chance, and install Ruby into the /usr folder and such, follow the guide up to the point where you do the ./configure, and instead add the following switch, ./configure --prefix=/usr With that, it'll install all binaries, libraries, include headers, and such into the /usr folder of your system path. But you will ofcourse need to do this as the Super User Root. Otherwise, you can just continue to do what you have right now, and re-add the /usr/local/bin and /usr/local/sbin back to your .bashrc, and just re-run gem install wxruby-2.0.0-universal-darwin-9.gem hth, Mario On Thu, Mar 26, 2009 at 1:34 AM, 7stud -- wrote: > Mario Steele wrote: > > Hello 7stud, > > > > On Wed, Mar 25, 2009 at 12:04 PM, 7stud -- wrote: > > > >> > >> /usr/local/src$ ls -al > >> /usr/local/src$ cd rubygems-1.3.1 > >> require 'rubygems' > >> > >> I got an error for each one. > >> PATH="/usr/local/bin:$PATH" > >> > >> $ cd /usr/local/lib/ruby/gems/1.8 > >> ... /usr/local/lib/ruby/gems/1.8$ cd gems > >> drwxr-xr-x 12 root wheel 408 Feb 11 2008 rake-0.8.1 > >> - RUBY EXECUTABLE: /usr/local/bin/ruby > >> - :benchmark => false > >> > > More then likely, wxruby is in the previous gem's directory, where you > > had > > 0.9.7 of rubygems installed. If you poped off the /usr/local/bin and > > /usr/local/sbin path from your PATH variable, and do a gem list --local, > > you'll find wxruby is installed there, > > > > Thanks for the response. I removed the following lines from my > ~/.bash_profile file: > ------------ > ... > ... > PATH="/usr/local/bin:$PATH" > export PATH > > PATH="/usr/local/sbin:$PATH" > export PATH > ------------- > > Then did: > > $ . ~/.bash_profile > > Then I closed all my Terminal windows, and opened a new Terminal window > and typed: > > $ gem list --local > > *** LOCAL GEMS *** > > fastercsv (1.2.1) > FasterCSV is CSV, but faster, smaller, and cleaner. > > json (1.1.1) > A JSON implementation as a Ruby extension > > rake (0.7.3) > Ruby based make-like utility. > > ruby-json (1.1.2) > ruby-json is a library for using JavaScript Object Notation (JSON) > under Ruby. > > rubygems-update (1.0.0) > RubyGems Update GEM > > sources (0.0.1) > This package provides download sources for remote gem installation > > wxruby (2.0.0) > Ruby interface to the wxWidgets GUI library > > > There it is. The last one. Those gems are different than the ones > listed here: > > ... /usr/local/lib/ruby/gems/1.8/gems$ ls -al > total 0 > drwxrwxr-x 10 root wheel 340 Mar 2 2008 . > drwxrwxr-x 6 root wheel 204 Mar 2 2008 .. > drwxr-xr-x 14 root wheel 476 Jan 27 2008 fastercsv-1.2.3 > drwxr-xr-x 9 root wheel 306 Feb 11 2008 hoe-1.5.0 > drwxr-xr-x 11 root wheel 374 Jan 27 2008 hpricot-0.6 > drwxr-xr-x 11 root wheel 374 Jan 27 2008 libxml-ruby-0.5.2.0 > drwxr-xr-x 14 root wheel 476 Feb 11 2008 mechanize-0.7.0 > drwxr-xr-x 12 root wheel 408 Feb 11 2008 rake-0.8.1 > drwxr-xr-x 9 root wheel 306 Feb 11 2008 rubyforge-0.4.4 > drwxr-xr-x 19 root wheel 646 Jan 27 2008 rubygems-update-1.0.1 > > So I ran a find to figure out where wxruby was located: > > $ find /usr -name 'wxruby*' > /usr/lib/ruby/gems/1.8/cache/wxruby-2.0.0-universal-darwin-9.gem > /usr/lib/ruby/gems/1.8/doc/wxruby-2.0.0-universal-darwin-9 > /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-universal-darwin-9 > > /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-universal-darwin-9/lib/wxruby2.bundle > > /usr/lib/ruby/gems/1.8/gems/wxruby-2.0.0-universal-darwin-9/samples/drawing/wxruby-logo.png > > /usr/lib/ruby/gems/1.8/specifications/wxruby-2.0.0-universal-darwin-9.gemspec > find: /usr/local/mysql-5.0.41-osx10.4-i686/data: Permission denied > > And then: > > $ cd /usr/lib/ruby/gems/1.8/gems > .. /usr/lib/ruby/gems/1.8/gems$ ls -al > total 0 > drwxr-xr-x 10 root wheel 340 Mar 24 01:31 . > drwxr-xr-x 7 root wheel 238 Oct 7 2007 .. > drwxr-xr-x 14 root wheel 476 Oct 8 2007 fastercsv-1.2.1 > drwxr-xr-x 17 root wheel 578 Nov 23 2007 json-1.1.1 > drwxr-xr-x 10 root wheel 340 Oct 20 2007 libxml-ruby-0.5.2.0 > drwxr-xr-x 12 root wheel 408 Oct 7 2007 rake-0.7.3 > drwxr-xr-x 8 root wheel 272 Nov 23 2007 ruby-json-1.1.2 > drwxr-xr-x 19 root wheel 646 Jan 25 2008 rubygems-update-1.0.0 > drwxr-xr-x 3 root wheel 102 Oct 7 2007 sources-0.0.1 > drwxr-xr-x 7 root wheel 238 Mar 24 01:31 > wxruby-2.0.0-universal-darwin-9 > > So why are some gems in /usr/lib while other gems are in /usr/local/lib? > Where should they be? > > > > > > -- > 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 alex at pressure.to Thu Mar 26 14:04:02 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 26 Mar 2009 18:04:02 +0000 Subject: [wxruby-users] XRS files In-Reply-To: References: Message-ID: <49CBC392.9000808@pressure.to> Fabio Petrucci wrote: > do wxruby support loading xrs files (xrc compiled)? I don't know, have you tried it? I can't see any reason why not - the needed components internally should all be there. alex From lists at ruby-forum.com Thu Mar 26 23:11:26 2009 From: lists at ruby-forum.com (7stud --) Date: Fri, 27 Mar 2009 04:11:26 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> Message-ID: <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> Mario Steele wrote: > Well, the reason why you had to follow the Hive Logic guide to upgrade > the > versions of Ruby and RubyGems installed, is cause there are some > components, > I don't know which, of Mac OS X, that utitlize Ruby, and attempting to > upgrade Ruby in thoes areas, can mess up your system. What happens, is > that > the system's copy of Ruby, is installed to /usr. > > Meaning, Libraries are installed in /usr/lib, Binaries are in /usr/bin, > Includes are in /usr/include, etc, etc. Where as the HiveLogic guide > has > you installing Ruby into /usr/local, meaning Libraries are installed in > /usr/local/lib, Binaries are in /usr/local/bin, Includes are in > /usr/local/include, etc, etc. > > So as you can see, you have an instance of two different copies of Ruby > [on] your hard drive, in two different areas. Ok. But I still don't understand the gems. I just installed ruby 1.8.6 (and rubygems 1.3.1), so it seems to me there shouldn't be a single gem under the path /usr/local/lib. Yet, there is a whole directory of them: .. /usr/local/lib/ruby/gems/1.8/gems$ ls -al total 0 drwxrwxr-x 10 root wheel 340 Mar 2 2008 . drwxrwxr-x 6 root wheel 204 Mar 2 2008 .. drwxr-xr-x 14 root wheel 476 Jan 27 2008 fastercsv-1.2.3 drwxr-xr-x 9 root wheel 306 Feb 11 2008 hoe-1.5.0 drwxr-xr-x 11 root wheel 374 Jan 27 2008 hpricot-0.6 drwxr-xr-x 11 root wheel 374 Jan 27 2008 libxml-ruby-0.5.2.0 drwxr-xr-x 14 root wheel 476 Feb 11 2008 mechanize-0.7.0 drwxr-xr-x 12 root wheel 408 Feb 11 2008 rake-0.8.1 drwxr-xr-x 9 root wheel 306 Feb 11 2008 rubyforge-0.4.4 drwxr-xr-x 19 root wheel 646 Jan 27 2008 rubygems-update-1.0.1 and they aren't the same gems as the gems for the system install of ruby 1.8.2 that are under /usr/lib $ cd /usr/lib/ruby/gems/1.8/gems .. /usr/lib/ruby/gems/1.8/gems$ ls -al total 0 drwxr-xr-x 10 root wheel 340 Mar 24 01:31 . drwxr-xr-x 7 root wheel 238 Oct 7 2007 .. drwxr-xr-x 14 root wheel 476 Oct 8 2007 fastercsv-1.2.1 drwxr-xr-x 17 root wheel 578 Nov 23 2007 json-1.1.1 drwxr-xr-x 10 root wheel 340 Oct 20 2007 libxml-ruby-0.5.2.0 drwxr-xr-x 12 root wheel 408 Oct 7 2007 rake-0.7.3 drwxr-xr-x 8 root wheel 272 Nov 23 2007 ruby-json-1.1.2 drwxr-xr-x 19 root wheel 646 Jan 25 2008 rubygems-update-1.0.0 drwxr-xr-x 3 root wheel 102 Oct 7 2007 sources-0.0.1 drwxr-xr-x 7 root wheel 238 Mar 24 01:31 wxruby-2.0.0-universal-darwin-9 And as a test, I tried installing the BlueCloth gem, which was my first attempt to install a gem with ruby 1.8.6 and rubygems 1.3.1. I set my path back to: > re-add > the /usr/local/bin and /usr/local/sbin back to your .bashrc and this is what happened: $ gem install -r BlueCloth WARNING: Installing to ~/.gem since /usr/local/lib/ruby/gems/1.8 and /usr/local/bin aren't both writable. WARNING: You don't have /Users/me/.gem/ruby/1.8/bin in your PATH, gem executables will not run. Successfully installed BlueCloth-1.0.0 1 gem installed At this point, I am totally fed up with rubygems AND ruby. I don't understand why this is so complicated. NOTHING seems to work the way it should. > If you > want > to take the chance, and install Ruby into the /usr folder and such, No, I don't want to do that. ruby and rubygems have already done enough damage to my psyche. I don't want to give them the chance to mess up my hardware. > Otherwise, you can just continue to do what you have right now, and > re-add > the /usr/local/bin and /usr/local/sbin back to your .bashrc, and just > re-run > gem install wxruby-2.0.0-universal-darwin-9.gem > Since BlueCloth didn't install properly, I'm not sure what to do at this point. Try perl? -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Fri Mar 27 01:13:44 2009 From: mario at ruby-im.net (Mario Steele) Date: Fri, 27 Mar 2009 00:13:44 -0500 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> Message-ID: On Thu, Mar 26, 2009 at 10:11 PM, 7stud -- wrote: > Mario Steele wrote: > > Well, the reason why you had to follow the Hive Logic guide to upgrade > > the > > versions of Ruby and RubyGems installed, is cause there are some > > components, > > I don't know which, of Mac OS X, that utitlize Ruby, and attempting to > > upgrade Ruby in thoes areas, can mess up your system. What happens, is > > that > > the system's copy of Ruby, is installed to /usr. > > > > Meaning, Libraries are installed in /usr/lib, Binaries are in /usr/bin, > > Includes are in /usr/include, etc, etc. Where as the HiveLogic guide > > has > > you installing Ruby into /usr/local, meaning Libraries are installed in > > /usr/local/lib, Binaries are in /usr/local/bin, Includes are in > > /usr/local/include, etc, etc. > > > > So as you can see, you have an instance of two different copies of Ruby > > [on] your hard drive, in two different areas. > > Ok. But I still don't understand the gems. I just installed ruby 1.8.6 > (and rubygems 1.3.1), so it seems to me there shouldn't be a single gem > under the path /usr/local/lib. Yet, there is a whole directory of them: > > .. /usr/local/lib/ruby/gems/1.8/gems$ ls -al > total 0 > drwxrwxr-x 10 root wheel 340 Mar 2 2008 . > drwxrwxr-x 6 root wheel 204 Mar 2 2008 .. > drwxr-xr-x 14 root wheel 476 Jan 27 2008 fastercsv-1.2.3 > drwxr-xr-x 9 root wheel 306 Feb 11 2008 hoe-1.5.0 > drwxr-xr-x 11 root wheel 374 Jan 27 2008 hpricot-0.6 > drwxr-xr-x 11 root wheel 374 Jan 27 2008 libxml-ruby-0.5.2.0 > drwxr-xr-x 14 root wheel 476 Feb 11 2008 mechanize-0.7.0 > drwxr-xr-x 12 root wheel 408 Feb 11 2008 rake-0.8.1 > drwxr-xr-x 9 root wheel 306 Feb 11 2008 rubyforge-0.4.4 > drwxr-xr-x 19 root wheel 646 Jan 27 2008 rubygems-update-1.0.1 > > and they aren't the same gems as the gems for the system install of ruby > 1.8.2 that are under /usr/lib > > $ cd /usr/lib/ruby/gems/1.8/gems > .. /usr/lib/ruby/gems/1.8/gems$ ls -al > total 0 > drwxr-xr-x 10 root wheel 340 Mar 24 01:31 . > drwxr-xr-x 7 root wheel 238 Oct 7 2007 .. > drwxr-xr-x 14 root wheel 476 Oct 8 2007 fastercsv-1.2.1 > drwxr-xr-x 17 root wheel 578 Nov 23 2007 json-1.1.1 > drwxr-xr-x 10 root wheel 340 Oct 20 2007 libxml-ruby-0.5.2.0 > drwxr-xr-x 12 root wheel 408 Oct 7 2007 rake-0.7.3 > drwxr-xr-x 8 root wheel 272 Nov 23 2007 ruby-json-1.1.2 > drwxr-xr-x 19 root wheel 646 Jan 25 2008 rubygems-update-1.0.0 > drwxr-xr-x 3 root wheel 102 Oct 7 2007 sources-0.0.1 > drwxr-xr-x 7 root wheel 238 Mar 24 01:31 > wxruby-2.0.0-universal-darwin-9 > This part, I can't explain. I don't know why there are gems in /usr/local/lib/gems/1.8/gems, if you didn't execute any gem command to install anything. But the point still remains why there are two sets of areas where RubyGems looks for the actual gem stuff. When you have your /usr/local/bin in your Path, especially the way you have it defined, export PATH="/usr/local/bin:$PATH", Bash will look in /usr/local/bin every single time you execute a commmand first, to see if it can find the binary, or shell script there, if not, then it goes to the next entry in the $PATH environment variable. So, for an example as the best way I can explain it to you, is to do this: Without modifying your .bashrc, and keeping the /usr/local/bin in there, type the following: which ruby You should get an output like this: /usr/local/bin/ruby Which means, that Ruby will look in /usr/local/lib/ruby/* for all libraries, even for RubyGems. Now, if you modify your .bashrc, and remove the /usr/local/bin from there, then type the following: which ruby You should get an output like this: /usr/bin/ruby Which means that Ruby will look in /usr/lib/ruby/* for all libraries, even for RubyGems. Hence why, if you have the /usr/local/bin in your $PATH environment variable, it will ignore looking in /usr/lib/ruby/*, cause as far as it is concerned, all the stuff it needs, is in /usr/local/lib/ruby/*. This is simple Operating System stuff. > And as a test, I tried installing the BlueCloth gem, which was my first > attempt to install a gem with ruby 1.8.6 and rubygems 1.3.1. I set my > path back to: > > > re-add > > the /usr/local/bin and /usr/local/sbin back to your .bashrc > > and this is what happened: > > $ gem install -r BlueCloth > WARNING: Installing to ~/.gem since /usr/local/lib/ruby/gems/1.8 and > /usr/local/bin aren't both writable. > WARNING: You don't have /Users/me/.gem/ruby/1.8/bin in your PATH, > gem executables will not run. > Successfully installed BlueCloth-1.0.0 > 1 gem installed > > > At this point, I am totally fed up with rubygems AND ruby. I don't > understand why this is so complicated. NOTHING seems to work the way it > should. At this point, RubyGems can't write to the path /usr/local/lib/ruby/gems/1.8/*, so as a fall back, it installs the gems into your Home path, EG: /Users/me/.gem/ruby/1.8/* The reason for this, is cause there is a Super User that can only write to folders outside your home directory, and that is Root. No one else is allowed to write files in that folder, except for Root. There are other details involved, but I won't go into that. Sufficent to say, that unless your the Root user, you can't write to thoes folders. There is a way to install them into the /usr/local/lib folder, but to correctly do this, I'm going to have you issue 2 commands. The first is to uninstall the BlueCloth gem you just installed. $ gem uninstall -r BlueCloth Once that is done, then you need to do what we call a Set User and Do, or what we commonly refer to it as, is sudo. What this does, is allows you for the duration of the command your executing, to set yourself as another user on your computer, to execute the specified command. So, in this command, we're going to do the same exact thing that you just did to install BlueCloth, only slightly differently: $ sudo gem install -r BlueCloth [sudo] password for me: That is what you SHOULD get. At this point, you type in your password, to allow the system to execute the command as the ROOT user. If you notice, when you do a ls of the /usr/local/lib/ruby/gems/1.8/gems/, you see a bunch of letters at the begining, a number, then the next two entries are root and wheel. Well, root is the user, and wheel is the group. Sufficent to say, root is the only one that can write to this directory, and hence why you need to do the sudo, in order to install to this path. > > > If you > > want > > to take the chance, and install Ruby into the /usr folder and such, > > No, I don't want to do that. ruby and rubygems have already done enough > damage to my psyche. I don't want to give them the chance to mess up > my hardware. > You mis understand by what I meant. It doesn't mess up your hardware, at the worst possible case, 2 or 3 applications that use Ruby on your system, would stop working, if they aren't able to work with Ruby 1.8.6, instead of the version you actually have installed by default. It never actually messes up your actual computer hardware. > > Otherwise, you can just continue to do what you have right now, and > > re-add > > the /usr/local/bin and /usr/local/sbin back to your .bashrc, and just > > re-run > > gem install wxruby-2.0.0-universal-darwin-9.gem > > > > Since BlueCloth didn't install properly, I'm not sure what to do at this > point. Try perl? Try my instructions above, about doing sudo, you'll find that it will work this way, and if BlueCloth installs, then do the same process to install wxRuby, EG: $ sudo gem install wxruby-2.0.0-universal-darwin-9.gem Don't use any gem command that installs, or removes files, without using the sudo, cause otherwise, gem will not be able to access the files. 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 mario at ruby-im.net Fri Mar 27 01:20:24 2009 From: mario at ruby-im.net (Mario Steele) Date: Fri, 27 Mar 2009 00:20:24 -0500 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> Message-ID: > Since BlueCloth didn't install properly, I'm not sure what to do at this > point. Try perl? Just to point out, if your having these troubles with Ruby, you'll have the same problems with Perl, cause Perl does the same exact thing as Ruby, only more involved, with a bunch of more prompts then RubyGems, with CPAN. I did a system upgrade of all the Perl libraries on my laptop, and I sat there for about an hour, answering Yes to a bunch of prompts that asked if I wanted to upgrade this package, cause it has these dependencies, and if I wanted to add it to the queue. And kept doing this, over and over, and over again. Kinda annoying if you ask me, since I specifically requested from CPAN to upgrade all the packages on my laptop. Just try what I stated in my previous email, and you shouldn't have any problems. -- 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 Fri Mar 27 01:37:24 2009 From: lists at ruby-forum.com (7stud --) Date: Fri, 27 Mar 2009 06:37:24 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> Message-ID: 7stud -- wrote: > And as a test, I tried installing the BlueCloth gem, which was my first > attempt to install a gem with ruby 1.8.6 and rubygems 1.3.1. I set my > path back to: > >> re-add >> the /usr/local/bin and /usr/local/sbin ...in the file ~/.bash_login > > and this is what happened: > > $ gem install -r BlueCloth > WARNING: Installing to ~/.gem since /usr/local/lib/ruby/gems/1.8 and > /usr/local/bin aren't both writable. > WARNING: You don't have /Users/me/.gem/ruby/1.8/bin in your PATH, > gem executables will not run. > Successfully installed BlueCloth-1.0.0 > 1 gem installed > Here are the permissions for the various directories mentioned in the error message: /usr/local/lib/ruby/gems$ ls -al total 0 drwxrwxr-x 3 root wheel 102 Jul 8 2007 . drwxr-xr-x 5 root wheel 170 Mar 25 02:02 .. drwxrwxr-x 6 root wheel 204 Mar 2 2008 1.8 <----**** /usr/local$ ls -al total 16 drwxr-xr-x 12 root wheel 408 Mar 24 00:09 . drwxr-xr-x 11 root wheel 374 Mar 17 23:50 .. drwxr-xr-x 62 root wheel 2108 Mar 25 02:15 bin <-----**** ... ~$ ls -al ... drwxr-xr-x 4 me me 136 Mar 25 02:23 .gem <-----**** It looks like the directories: /usr/local/lib/ruby/gems/1.8 /usr/local/bin have the same or more liberal permissions than the directory: ~/.gem yet gem said it couldn't install in those directories?? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 27 02:18:57 2009 From: lists at ruby-forum.com (7stud --) Date: Fri, 27 Mar 2009 07:18:57 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> Message-ID: <4cc4fa421b9885768260139700b06af8@ruby-forum.com> Mario Steele wrote: > On Thu, Mar 26, 2009 at 10:11 PM, 7stud -- wrote: > >> > Meaning, Libraries are installed in /usr/lib, Binaries are in /usr/bin, >> (and rubygems 1.3.1), so it seems to me there shouldn't be a single gem >> drwxr-xr-x 14 root wheel 476 Feb 11 2008 mechanize-0.7.0 >> drwxr-xr-x 10 root wheel 340 Mar 24 01:31 . >> > This part, I can't explain. I don't know why there are gems in > /usr/local/lib/gems/1.8/gems, if you didn't execute any gem command to > install anything. But the point still remains why there are two sets of > areas where RubyGems looks for the actual gem stuff. Yes, I understand what you are saying. > When you have your > /usr/local/bin in your Path, especially the way you have it defined, > export > PATH="/usr/local/bin:$PATH", Bash will look in /usr/local/bin every > single > time you execute a commmand first, to see if it can find the binary, or > shell script there, if not, then it goes to the next entry in the $PATH > environment variable. Yes. I understand that. > So, for an example as the best way I can explain > it > to you, is to do this: > > Without modifying your .bashrc, and keeping the /usr/local/bin in there, > type the following: > > which ruby > > You should get an output like this: > > /usr/local/bin/ruby > Yes, this is what I get: $ which ruby /usr/local/bin/ruby $ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.1 - RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1] - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/local/bin/ruby - EXECUTABLE DIRECTORY: /usr/local/bin - RUBYGEMS PLATFORMS: - ruby - x86-darwin-8 - GEM PATHS: - /usr/local/lib/ruby/gems/1.8 - /Users/me/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://gems.rubyforge.org/ > Which means, that Ruby will look in /usr/local/lib/ruby/* for all > libraries, > even for RubyGems. > Ok. > Now, if you modify your .bashrc, I have my PATH stuff in ~/.bash_profile, which as far as I know affects bash shells--instead of all shells. I only use bash shells. > and remove the /usr/local/bin from > there, > then type the following: > > which ruby > > You should get an output like this: > > /usr/bin/ruby > $ which ruby /usr/bin/ruby $ gem env RubyGems Environment: - VERSION: 0.9.4 (0.9.4) - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 - GEM PATH: - /usr/lib/ruby/gems/1.8 - REMOTE SOURCES: - http://gems.rubyforge.org > Which means that Ruby will look in /usr/lib/ruby/* for all libraries, > even > for RubyGems. > Yes, I understand. The two different gem directories are specified as: with /usr/local/bin on the front of my PATH: ----------- - GEM PATHS: - /usr/local/lib/ruby/gems/1.8 - /Users/me/.gem/ruby/1.8 without /usr/local/bin on the front of my PATH ----------- - GEM PATH: - /usr/lib/ruby/gems/1.8 > Hence why, if you have the /usr/local/bin in your $PATH environment > variable, it will ignore looking in /usr/lib/ruby/*, cause as far as it > is > concerned, all the stuff it needs, is in /usr/local/lib/ruby/*. This is > simple Operating System stuff. > Yes, I understand. > >> WARNING: Installing to ~/.gem since /usr/local/lib/ruby/gems/1.8 and >> /usr/local/bin aren't both writable. >> WARNING: You don't have /Users/me/.gem/ruby/1.8/bin in your PATH, >> gem executables will not run. >> Successfully installed BlueCloth-1.0.0 >> 1 gem installed >> >> >> At this point, I am totally fed up with rubygems AND ruby. I don't >> understand why this is so complicated. NOTHING seems to work the way it >> should. > > > At this point, RubyGems can't write to the path > /usr/local/lib/ruby/gems/1.8/*, so as a fall back, it installs the gems > into > your Home path, EG: /Users/me/.gem/ruby/1.8/* The reason for this, is > cause > there is a Super User that can only write to folders outside your home > directory, and that is Root. No one else is allowed to write files in > that > folder, except for Root. > Ahh, yes. I even have a note in the gem section of pickaxe2 to remember to use sudo when installing gems. I didn't remember to do that. > There are other details involved, but I won't > go > into that. Sufficent to say, that unless your the Root user, you can't > write to thoes folders. There is a way to install them into the > /usr/local/lib folder, but to correctly do this, I'm going to have you > issue > 2 commands. The first is to uninstall the BlueCloth gem you just > installed. > > $ gem uninstall -r BlueCloth > That's not working: $ gem uninstall -r BlueCloth ERROR: While executing gem ... (OptionParser::InvalidOption) invalid option: -r $ gem uninstall BlueCloth ERROR: While executing gem ... (Gem::InstallError) Unknown gem BlueCloth >= 0 $ gem query --local *** LOCAL GEMS *** BlueCloth (1.0.0) fastercsv (1.2.3) hoe (1.5.0) hpricot (0.6) libxml-ruby (0.5.2.0) mechanize (0.7.0) rake (0.8.1) rubyforge (0.4.4) rubygems-update (1.0.1) $ which ruby /usr/local/bin/ruby $ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.1 - RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1] - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/local/bin/ruby - EXECUTABLE DIRECTORY: /usr/local/bin - RUBYGEMS PLATFORMS: - ruby - x86-darwin-8 - GEM PATHS: - /usr/local/lib/ruby/gems/1.8 - /Users/me/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://gems.rubyforge.org/ -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 27 02:26:27 2009 From: lists at ruby-forum.com (7stud --) Date: Fri, 27 Mar 2009 07:26:27 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: <4cc4fa421b9885768260139700b06af8@ruby-forum.com> References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> <4cc4fa421b9885768260139700b06af8@ruby-forum.com> Message-ID: <3b664757764cce7095128fc2bd732f78@ruby-forum.com> 7stud -- wrote: > That's not working: > > $ gem uninstall -r BlueCloth > ERROR: While executing gem ... (OptionParser::InvalidOption) > invalid option: -r > > $ gem uninstall BlueCloth > ERROR: While executing gem ... (Gem::InstallError) > Unknown gem BlueCloth >= 0 > I bet it has something to do with the warning I got when I installed BlueCloth: > WARNING: You don't have /Users/me/.gem/ruby/1.8/bin in your PATH, > gem executables will not run. But I don't have any such directory: ~/.gem/ruby/1.8$ ls -al total 0 drwxr-xr-x 6 me me 204 Mar 25 02:23 . drwxr-xr-x 3 me me 102 Mar 25 02:23 .. drwxr-xr-x 3 me me 102 Mar 26 07:30 cache drwxr-xr-x 3 me me 102 Mar 26 07:30 doc drwxr-xr-x 3 me me 102 Mar 26 07:30 gems drwxr-xr-x 3 me me 102 Mar 26 07:30 specifications -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 27 04:05:56 2009 From: lists at ruby-forum.com (7stud --) Date: Fri, 27 Mar 2009 09:05:56 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: <3b664757764cce7095128fc2bd732f78@ruby-forum.com> References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> <4cc4fa421b9885768260139700b06af8@ruby-forum.com> <3b664757764cce7095128fc2bd732f78@ruby-forum.com> Message-ID: <16858efcdccbfc698db4f83737748141@ruby-forum.com> What's the difference between uninstalling a gem and cd'ing to the directory it resides in and removing it? -- Posted via http://www.ruby-forum.com/. From fabio.petrucci at gmail.com Fri Mar 27 06:16:10 2009 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 27 Mar 2009 11:16:10 +0100 Subject: [wxruby-users] XRS files In-Reply-To: <49CBC392.9000808@pressure.to> References: <49CBC392.9000808@pressure.to> Message-ID: I'll try as soon as i find wxrc.exe. Can you point me to the right direction?? Thank you. bio On Thu, Mar 26, 2009 at 7:04 PM, Alex Fenton wrote: > Fabio Petrucci wrote: > >> do wxruby support loading xrs files (xrc compiled)? >> > > I don't know, have you tried it? I can't see any reason why not - the > needed components internally should all be there. > > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Fri Mar 27 10:22:24 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 27 Mar 2009 14:22:24 +0000 Subject: [wxruby-users] XRS files In-Reply-To: References: <49CBC392.9000808@pressure.to> Message-ID: <49CCE120.4000207@pressure.to> Fabio Petrucci wrote: > I'll try as soon as i find wxrc.exe. > > Can you point me to the right direction?? It gets built as part of wxWidgets compile from source. I'm not sure where one can find a pre-built Windows binary - maybe someone who builds wxWidgets on windows has one handy? If not I will try and find one next time I'm on a Windows machine. alex From mario at ruby-im.net Fri Mar 27 13:00:31 2009 From: mario at ruby-im.net (Mario Steele) Date: Fri, 27 Mar 2009 12:00:31 -0500 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: <16858efcdccbfc698db4f83737748141@ruby-forum.com> References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> <4cc4fa421b9885768260139700b06af8@ruby-forum.com> <3b664757764cce7095128fc2bd732f78@ruby-forum.com> <16858efcdccbfc698db4f83737748141@ruby-forum.com> Message-ID: Actually, at this point, you could probably just go ahead, and do a rm -rf ~/.gem to get rid of it, and then do the sudo gem install for the blue cloth. On Fri, Mar 27, 2009 at 3:05 AM, 7stud -- wrote: > What's the difference between uninstalling a gem and cd'ing to the > directory it resides in and removing it? > -- > 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 Fri Mar 27 13:19:31 2009 From: lists at ruby-forum.com (7stud --) Date: Fri, 27 Mar 2009 18:19:31 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> <4cc4fa421b9885768260139700b06af8@ruby-forum.com> <3b664757764cce7095128fc2bd732f78@ruby-forum.com> <16858efcdccbfc698db4f83737748141@ruby-forum.com> Message-ID: <8f889cd919a9a8182df756ddbf8a0ecc@ruby-forum.com> Mario Steele wrote: > Actually, at this point, you could probably just go ahead, and do a rm > -rf > ~/.gem to get rid of it, and then do the sudo gem install for the blue > cloth. I just cross posted this problem to the main ruby forum: http://www.ruby-forum.com/topic/182708#new -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 27 14:39:01 2009 From: lists at ruby-forum.com (Larry H.) Date: Fri, 27 Mar 2009 19:39:01 +0100 Subject: [wxruby-users] xrciser problem Message-ID: <28e23648a69d42f53b32c49ead486ec2@ruby-forum.com> I built a Windows GUI using DialogBlocks v4.29, saved the resulting XRC for processing with wxRuby's xrciser tool. Following Ruby products installed: wxRuby is v 2.0.0 wxSugar is v0.1.22 Ruby is v1.9.1 Rubygems is v1.3.1 Running xrciser on the file gives the following: C:\ruby>xrcise -o toolgui.rb tool.xrc c:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/outputter.rb:4 6:in `clean_id_attr_readers': undefined method `each' for # (No MethodError) from (erb):16:in `output' from c:/ruby/lib/ruby/1.9.1/erb.rb:753:in `eval' from c:/ruby/lib/ruby/1.9.1/erb.rb:753:in `result' from c:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/lib/wx_sugar/xrc/o utputter.rb:19:in `output' from c:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:126:in `block (2 levels) in ' from c:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:125:in `each' from c:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:125:in `block in ' from c:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:124:in `open' from c:/ruby/lib/ruby/gems/1.9.1/gems/wx_sugar-0.1.22/bin/xrcise:124:in `' from c:/ruby/bin/xrcise:19:in `load' from c:/ruby/bin/xrcise:19:in `
' Checked the outputter source; can't understand why "each" is not a method for "str" here so tried debugging -- got an error saying ruby-debug not working with Ruby 1.9.1 yet. Any clues as to what is going on? Here is the xrc: #b1bdd1 590,612 Tool 1 wxVERTICAL wxGROW 5 wxHORIZONTAL wxALIGN_TOP 5 0,1 0,1 0 0 10,20 wxGROW|wxGROW 5 0,0 1,2 wxVERTICAL wxGROW|wxALL 5 Instructions wxGROW|wxGROW 5 1,0 1,3 wxVERTICAL wxGROW|wxALL 5 Choose Spreadsheet C:\\ruby\\tool.xrc Select a file *.* wxALIGN_LEFT|wxALIGN_TOP 5 0,2 1,1 wxVERTICAL wxALIGN_LEFT|wxALL 5 Select 1 0 A B C D wxGROW|wxGROW|wxALL 5 0,2 1,1 1 wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM 5 wxHORIZONTAL wxALIGN_TOP|wxALL 5 Select 1 0 1 2 wxALIGN_CENTER_VERTICAL|wxALL 5 wxALIGN_CENTER_VERTICAL|wxALL 5 wxGROW|wxALL 5 Progress 0 100 wxGROW|wxALL 5 -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 27 18:19:33 2009 From: lists at ruby-forum.com (7stud --) Date: Fri, 27 Mar 2009 23:19:33 +0100 Subject: [wxruby-users] I updated ruby and rubygems and now no more wxruby In-Reply-To: References: <8efc54e2be1230b6fecf0d47d141cf60@ruby-forum.com> <3ec81add061343e5ed0a16ebc32b8f45@ruby-forum.com> <9a3cb22eb9d23633f845c826dd644cd6@ruby-forum.com> <4cc4fa421b9885768260139700b06af8@ruby-forum.com> <3b664757764cce7095128fc2bd732f78@ruby-forum.com> <16858efcdccbfc698db4f83737748141@ruby-forum.com> Message-ID: Mario Steele wrote: > Actually, at this point, you could probably just go ahead, and do a rm > -rf > ~/.gem to get rid of it, and then do the sudo gem install for the blue > cloth. I'm not sure deleting ~/.gem and BlueCloth did anything helpful, but now I've got wxruby working again. The details are in the other thread. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Mar 28 12:21:21 2009 From: lists at ruby-forum.com (7stud --) Date: Sat, 28 Mar 2009 17:21:21 +0100 Subject: [wxruby-users] RadioBox--majorDimension backwards Message-ID: <63d15db2a99f992e7f82dcefff90e230@ruby-forum.com> The layout of the RadioBox in this code works as the docs describe: radios = Wx::RadioBox.new( panel, #parent -1, #-1 => wxruby picks id "Drinks", #label for box surrounding radio buttons Wx::Point.new(20, 5), Wx::DEFAULT_SIZE, drink_choices, #the labels for the radio buttons 1, #max number of columns Wx::RA_SPECIFY_COLS #previous number applies to columns ) When I run a program with that code in it, the RadioBox is a vertical column with one radio button per line. But when I switch to keyword arguments: radios = Wx::RadioBox.new( panel, #parent :id => -1, #-1 => wxruby picks id :label => "Drinks", #label for box surrounding radios :pos => Wx::Point.new(20, 5), :size => Wx::DEFAULT_SIZE, :choices => drink_choices, #the labels for the radio buttons :majorDimension => 1, #max number of columns :style => Wx::RA_SPECIFY_COLS #number applies to columns ) ...the RadioBox lays out as one row with all the radio buttons on one line. If I change Wx::RA_SPECIFY_COLS to Wx::RA_SPECIFY_ROWS then the RadioBox lays out like the first example--in one vertical column with a radio button on each line. Is that a bug? wxruby 2.0 ruby 1.8.6 mac osx 10.4.11 Here's the full program: require "rubygems" require "wx" class MyFrame < Wx::Frame def initialize super(nil, #parent :id => -1, #-1 => wxruby picks id :title => "RadioBox Example", #displays on top of window :pos => Wx::Point.new(150, 25), #or Wx::DEFAULT_POSITION :size => Wx::Size.new(300, 200) #or Wx::DEFAULT_SIZE ) panel = Wx::Panel.new( self, #parent, self refers to this frame :id => -1 #-1 => wxruby picks the id ) drink_choices = ["coffee", "tea", "juice", "milk"] radios = Wx::RadioBox.new( panel, #parent :id => -1, #-1 => wxruby picks id :label => "Drinks", #label for box surrounding radio buttons :pos => Wx::Point.new(20, 5), :size => Wx::DEFAULT_SIZE, :choices => drink_choices, #the labels for the radio buttons :majorDimension => 1, #max number of columns :style => Wx::RA_SPECIFY_COLS #number applies to columns ) show #equivalent to self.show, makes the frame visible end end class MyApp < Wx::App def on_init MyFrame.new end end MyApp.new.main_loop -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Mar 28 12:32:05 2009 From: lists at ruby-forum.com (7stud --) Date: Sat, 28 Mar 2009 17:32:05 +0100 Subject: [wxruby-users] wxruby docs -- nice going! Message-ID: I only just started with wxruby, but the docs are terrific. What a breath of fresh air! C-o-n-g-r-a-t-u-l-a-t-i-o-n-s to whoever put them together. Well done. Clap, clap, clap. (I can't believe the forum software won't let me post the C word.) -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Mar 29 09:38:06 2009 From: lists at ruby-forum.com (7stud --) Date: Sun, 29 Mar 2009 15:38:06 +0200 Subject: [wxruby-users] RadioBox--majorDimension backwards In-Reply-To: <63d15db2a99f992e7f82dcefff90e230@ruby-forum.com> References: <63d15db2a99f992e7f82dcefff90e230@ruby-forum.com> Message-ID: <3fead575ce9db6dbf9dd6536a133f0bb@ruby-forum.com> Submitted as bug #24992 here: http://rubyforge.org/tracker/index.php?group_id=35&atid=218 If you run the following program, it will show two RadioBoxes side by side. One RadioBox will be laid out in one column, with one radio button per line. The other RadioBox will be laid out in one row, with all the radio buttons on one line. However, the only difference between the code for the two RadioBox's is that one uses positional args and the other uses keyword args. require "rubygems" require "wx" class MyFramePosArgs < Wx::Frame def initialize super(nil, #parent :id => -1, #-1 => wxruby picks id :title => "RadioBox Example", #displays on top of window :pos => Wx::Point.new(150, 25), #or Wx::DEFAULT_POSITION :size => Wx::Size.new(300, 200) #or Wx::DEFAULT_SIZE ) panel = Wx::Panel.new( self, #parent, self refers to this frame :id => -1 #-1 => wxruby picks the id ) drink_choices = ["coffee", "tea", "juice", "milk"] radios = Wx::RadioBox.new( panel, #parent -1, #-1 => wxruby picks id "Drinks", #label for box surrounding radios Wx::Point.new(20, 5), Wx::DEFAULT_SIZE, drink_choices, #the labels for the radio buttons 1, #max number of columns Wx::RA_SPECIFY_COLS #preceding number applies to columns ) show #equivalent to self.show, makes the frame visible end end class MyFrameKeyWordArgs < Wx::Frame def initialize super(nil, #parent :id => -1, #-1 => wxruby picks id :title => "RadioBox Example", #displays on top of window :pos => Wx::Point.new(500, 25), #or Wx::DEFAULT_POSITION :size => Wx::Size.new(300, 200) #or Wx::DEFAULT_SIZE ) panel = Wx::Panel.new( self, #parent, self refers to this frame :id => -1 #-1 => wxruby picks the id ) drink_choices = ["coffee", "tea", "juice", "milk"] radios = Wx::RadioBox.new( panel, #parent :id => -1, #-1 => wxruby picks id :label => "Drinks", #label for box surrounding radios :pos => Wx::Point.new(20, 5), :size => Wx::DEFAULT_SIZE, :choices => drink_choices, #the labels for the radio buttons :majorDimension => 1, #max number of columns :style => Wx::RA_SPECIFY_COLS #number applies to columns ) show #equivalent to self.show, makes the frame visible end end class MyApp < Wx::App def on_init MyFramePosArgs.new MyFrameKeyWordArgs.new end end MyApp.new.main_loop -- Posted via http://www.ruby-forum.com/. From rakaur at malkier.net Mon Mar 30 07:45:21 2009 From: rakaur at malkier.net (Eric Will) Date: Mon, 30 Mar 2009 07:45:21 -0400 Subject: [wxruby-users] Distributing Windows WxRuby apps In-Reply-To: <49C269B1.40507@pressure.to> References: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> <49C269B1.40507@pressure.to> Message-ID: <1ce38ef40903300445l1e4146d9o2ce865a45b72a041@mail.gmail.com> How long before you figure there will be a bytecode compiler deal (a la kava for perl) for 1.9? I would imagine this is one of the big giant reasons to use 1.9. -- Eric Will From alex at pressure.to Mon Mar 30 09:06:20 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 30 Mar 2009 14:06:20 +0100 Subject: [wxruby-users] Distributing Windows WxRuby apps In-Reply-To: <1ce38ef40903300445l1e4146d9o2ce865a45b72a041@mail.gmail.com> References: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> <49C269B1.40507@pressure.to> <1ce38ef40903300445l1e4146d9o2ce865a45b72a041@mail.gmail.com> Message-ID: <49D0C3CC.3030404@pressure.to> Eric Will wrote: > How long before you figure there will be a bytecode compiler deal (a > la kava for perl) for 1.9? I would imagine this is one of the big > giant reasons to use 1.9. You can already save and load compiled instructions for the Ruby 1.9 virtual machine, using the VM::InstructionSequence class in Ruby core. However in the ruby distribution the method VM::InstructionSequence.load is disabled, but if you uncomment the relevant line (in iseq.c, near the end) and compile ruby, you can run ruby from saved VM instructions. I've tried it (to a limited extent) and it works. The reason it's disabled is 'there is no verifier' - which I believe in part reflects concern about cross-version compatibility of VM instructions - but if you're distributing your own Ruby with your GUI app, this may not matter. a From rakaur at malkier.net Mon Mar 30 10:06:10 2009 From: rakaur at malkier.net (Eric Will) Date: Mon, 30 Mar 2009 10:06:10 -0400 Subject: [wxruby-users] Distributing Windows WxRuby apps In-Reply-To: <49D0C3CC.3030404@pressure.to> References: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> <49C269B1.40507@pressure.to> <1ce38ef40903300445l1e4146d9o2ce865a45b72a041@mail.gmail.com> <49D0C3CC.3030404@pressure.to> Message-ID: <1ce38ef40903300706u735dfc93x8c63955d36e31e@mail.gmail.com> On Mon, Mar 30, 2009 at 9:06 AM, Alex Fenton wrote: > You can already save and load compiled instructions for the Ruby 1.9 virtual > machine, using the VM::InstructionSequence class in Ruby core. However in > the ruby distribution the method VM::InstructionSequence.load is disabled, > but if you uncomment the relevant line (in iseq.c, near the end) and compile > ruby, you can run ruby from saved VM instructions. I've tried it (to a > limited extent) and it works. That's very interesting, but not totally what I'm looking for. Kava for Perl is a total packager into an exe. Perhaps it compiles the bytecode and compresses the interpreter into an exe, I'm not sure. RubyScript2Exe is unacceptably slow, so if "extract exe and all libraries every time" is still the way to go, I can't use that. The users of my GUI apps have no admin rights on their computers so I can't install Ruby (or anything else). They only thing they can write to is a home directory on a network share. Right now I just have a version of Ruby shared on the network and we use that to run things, but it sucks. -- Eric Will From rakaur at malkier.net Mon Mar 30 10:13:55 2009 From: rakaur at malkier.net (Eric Will) Date: Mon, 30 Mar 2009 10:13:55 -0400 Subject: [wxruby-users] MethodMissing calc_min Message-ID: <1ce38ef40903300713l23e122f7td5b11a90ebd215ce@mail.gmail.com> This is kind of hard to explain, but I'll do my best. I have a window that has a complex ListCtrl using LC_VIRTUAL, and my own implementation of ListView. I use this tons of places and it works fine, except for here. In Ruby 1.8 there's no warning, just a segfault out of nowhere. In Ruby 1.9, when trying to do set_size() on the Wx::Frame or show(), it crashes every time by raising a NoMethodError on "calc_min" for various objects. The object changes every time, but has been String, Array, Hash, and various of my own objects. I don't do anything with calc_min() in my ListView, and this doesn't happen ANYWHERE else. Sometimes it works fine on 1.8, and sometimes it segfaults. I can make the code available on a limited basis (it is private, for the US government), preferably only to Alex, if you think you can help. I know that's not a ton of information, but I'm not sure what else I can include. I've tried very hard to make sure it's not something I'm doing, and I can't reproduce it with anything but the exact code I use now. In order for you to reproduce it you'd probably need the whole program (which is huge, and complicated), but I can provide you with traces or anything you need. Thanks for any help you can provide. -- Eric Will /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `calc_min': undefined method `calc_min' for # (NoMethodError) from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `calc_min' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `calc_min' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `calc_min' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `calc_min' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `layout' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `process_event' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `process_event' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `show' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera/ui/equipmentfinder.rb:34:in `initialize' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera.rb:173:in `new' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Palaeoptera.rb:173:in `block in on_init' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Hymenoptera/ui/main.rb:106:in `call' from /home/rakaur/Dropbox/Sources/work/Palaeoptera/lib/Hymenoptera/ui/main.rb:106:in `block (2 levels) in initialize_events' from bin/Palaeoptera.rb:20:in `call' from bin/Palaeoptera.rb:20:in `process_event' from bin/Palaeoptera.rb:20:in `process_event' from bin/Palaeoptera.rb:20:in `process_event' from bin/Palaeoptera.rb:20:in `on_run' from bin/Palaeoptera.rb:20:in `main_loop' from bin/Palaeoptera.rb:20:in `
' rakaur at callandor ~/Dropbox/Sources/work/Palaeoptera $ Line 34 is a show() call for a Wx::Frame. From alex at pressure.to Mon Mar 30 14:49:21 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 30 Mar 2009 19:49:21 +0100 Subject: [wxruby-users] Distributing Windows WxRuby apps In-Reply-To: <1ce38ef40903300706u735dfc93x8c63955d36e31e@mail.gmail.com> References: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> <49C269B1.40507@pressure.to> <1ce38ef40903300445l1e4146d9o2ce865a45b72a041@mail.gmail.com> <49D0C3CC.3030404@pressure.to> <1ce38ef40903300706u735dfc93x8c63955d36e31e@mail.gmail.com> Message-ID: <49D11431.1080904@pressure.to> Eric Will wrote: > That's very interesting, but not totally what I'm looking for. Kava > for Perl is a total packager into an exe. Perhaps it compiles the > bytecode and compresses the interpreter into an exe, I'm not sure. > RubyScript2Exe is unacceptably slow, so if "extract exe and all > libraries every time" is still the way to go, I can't use that. The > users of my GUI apps have no admin rights on their computers so I > can't install Ruby (or anything else). They only thing they can write > to is a home directory on a network share. To get round this - esp the time taken to unzip the ruby interpreter plus the (not small) wxruby libs plus everything else, I create a Windows installer using NSIS which installs a custom ruby, the ruby .dll and all the ruby library files needed. There's some more details and links to the implementation code here: http://rubyforge.org/pipermail/wxruby-users/2008-October/004258.html a From alex at pressure.to Mon Mar 30 15:05:31 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 30 Mar 2009 20:05:31 +0100 Subject: [wxruby-users] MethodMissing calc_min In-Reply-To: <1ce38ef40903300713l23e122f7td5b11a90ebd215ce@mail.gmail.com> References: <1ce38ef40903300713l23e122f7td5b11a90ebd215ce@mail.gmail.com> Message-ID: <49D117FB.8090902@pressure.to> Eric Will wrote: > This is kind of hard to explain, but I'll do my best. > > I have a window that has a complex ListCtrl using LC_VIRTUAL, and my > own implementation of ListView. I use this tons of places and it works > fine, except for here. In Ruby 1.8 there's no warning, just a segfault > out of nowhere. In Ruby 1.9, when trying to do set_size() on the > Wx::Frame or show(), it crashes every time by raising a NoMethodError > on "calc_min" for various objects. The object changes every time, but > has been String, Array, Hash, and various of my own objects. I don't > do anything with calc_min() in my ListView, and this doesn't happen > ANYWHERE else. Sometimes it works fine on 1.8, and sometimes it > segfaults. I can make the code available on a limited basis (it is > private, for the US government), preferably only to Alex, if you think > you can help. > From the sound of it it's some kind of memory / object-tracking bug. I haven't come across one for a while but they are quite hard to diagnose and reproduce. calc_min is an overridable method of Wx::Sizer; like other similar methods, it's sometimes called by the C++ core. Probably wxRuby is trying to call this on an Ruby object it thinks is a Wx::Sizer, but is something else. If you want to contact me off-list I can take a look at your code on a confidential basis. I'm a bit short of time but can try to reproduce it, although the bugs are often dependent on each platform's memory allocation order. It might be useful to know also: - if the Frame concerned is explicitly sized, rather than using Sizers (as perhaps the other non-problematic ones) - if the bug only occurs after some Frame has been opened and destroyed a From alex at pressure.to Mon Mar 30 15:09:49 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 30 Mar 2009 20:09:49 +0100 Subject: [wxruby-users] wxruby docs -- nice going! In-Reply-To: References: Message-ID: <49D118FD.3040507@pressure.to> 7stud -- wrote: > I only just started with wxruby, but the docs are terrific. What a > breath of fresh air! C-o-n-g-r-a-t-u-l-a-t-i-o-n-s to whoever put them > together. > > Well done. Clap, clap, clap. Thanks. I think our docs are far from perfect, but hopefully they at least cover the basics for every class. Credit should go to the wxWidgets developers - I simply made a script to 'translate' their docs into Ruby to seed to docs. And credit also to Chauk-Mean, who has done a lot of work correcting the docs and improving the samples. As ever, suggestions for how they could be better are always welcome. cheers a From alex at pressure.to Mon Mar 30 15:22:08 2009 From: alex at pressure.to (Alex Fenton) Date: Mon, 30 Mar 2009 20:22:08 +0100 Subject: [wxruby-users] RadioBox--majorDimension backwards In-Reply-To: <63d15db2a99f992e7f82dcefff90e230@ruby-forum.com> References: <63d15db2a99f992e7f82dcefff90e230@ruby-forum.com> Message-ID: <49D11BE0.5080502@pressure.to> 7stud -- wrote: > The layout of the RadioBox in this code works as the docs describe: > > radios = Wx::RadioBox.new( > panel, #parent > -1, #-1 => wxruby picks id > "Drinks", #label for box surrounding radio buttons > Wx::Point.new(20, 5), > Wx::DEFAULT_SIZE, > drink_choices, #the labels for the radio buttons > 1, #max number of columns > Wx::RA_SPECIFY_COLS #previous number applies to columns > ) > > When I run a program with that code in it, the RadioBox is a vertical > column with one radio button per line. But when I switch to keyword > arguments: > > > radios = Wx::RadioBox.new( > panel, #parent > :id => -1, #-1 => wxruby picks id > :label => "Drinks", #label for box surrounding radios > :pos => Wx::Point.new(20, 5), > :size => Wx::DEFAULT_SIZE, > :choices => drink_choices, #the labels for the radio buttons > :majorDimension => 1, #max number of columns > :style => Wx::RA_SPECIFY_COLS #number applies to columns > ) > > ...the RadioBox lays out as one row with all the radio buttons on one > line. If I change > After your kind words about the docs, it's a documentation bug. The "majorDimension" argument should be specified with ":major_dimension" - train_case not CamelCase. I think it works as expected if the parameter name is given correctly. Fixed in the documentation with SVN:2062 thanks for the report and sample alex From bureaux.sebastien at neuf.fr Mon Mar 30 16:34:42 2009 From: bureaux.sebastien at neuf.fr (sebastien) Date: Mon, 30 Mar 2009 22:34:42 +0200 Subject: [wxruby-users] Grid Message-ID: <20E76E7A3375460E992201958EE3FF64@sebastien> Bonjour. Je voudrais savoir comment d?s?lectionn? le rectangle noir ce trouvant dans la premi?re colonne(rows 0, col 0) de l'exemple Grid? Y ? t'il une option comme "TE_READONLY" qui emp?che d'?crire dans les cases? Merci S?bastien http://beusse.liveror.com/ -------------- section suivante -------------- Une pi?ce jointe HTML a ?t? nettoy?e... URL: From rakaur at malkier.net Mon Mar 30 18:01:01 2009 From: rakaur at malkier.net (Eric Will) Date: Mon, 30 Mar 2009 18:01:01 -0400 Subject: [wxruby-users] MethodMissing calc_min In-Reply-To: <49D117FB.8090902@pressure.to> References: <1ce38ef40903300713l23e122f7td5b11a90ebd215ce@mail.gmail.com> <49D117FB.8090902@pressure.to> Message-ID: <5EC14E00-CCC8-4015-9470-3D12C07BD808@malkier.net> On Mar 30, 2009, at 3:05 PM, Alex Fenton wrote: >> > From the sound of it it's some kind of memory / object-tracking bug. > I haven't come across one for a while but they are quite hard to > diagnose and reproduce. > > calc_min is an overridable method of Wx::Sizer; like other similar > methods, it's sometimes called by the C++ core. Probably wxRuby is > trying to call this on an Ruby object it thinks is a Wx::Sizer, but > is something else. > > If you want to contact me off-list I can take a look at your code on > a confidential basis. I'm a bit short of time but can try to > reproduce it, although the bugs are often dependent on each > platform's memory allocation order. It might be useful to know also: > > - if the Frame concerned is explicitly sized, rather than using > Sizers (as perhaps the other non-problematic ones) > - if the bug only occurs after some Frame has been opened and > destroyed It happens in OS X, WinXP, and Linux. It crashes while trying to show() the Frame the ListView is in. It often tries calc_min() on members of my ListView. All my windows use Sizers. I'll get back to you tomorrow. Off work for now. I'm going to do some poking in my ListView which I have no problem making available before I burden anyone. -- Eric Will From rakaur at malkier.net Mon Mar 30 18:02:03 2009 From: rakaur at malkier.net (Eric Will) Date: Mon, 30 Mar 2009 18:02:03 -0400 Subject: [wxruby-users] Distributing Windows WxRuby apps In-Reply-To: <49D11431.1080904@pressure.to> References: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> <49C269B1.40507@pressure.to> <1ce38ef40903300445l1e4146d9o2ce865a45b72a041@mail.gmail.com> <49D0C3CC.3030404@pressure.to> <1ce38ef40903300706u735dfc93x8c63955d36e31e@mail.gmail.com> <49D11431.1080904@pressure.to> Message-ID: <6752BA5A-42F5-4B66-A125-354DE642EA5F@malkier.net> I saw, but I can't install anything on these machines. -- Eric Will / rakaur @ malkier On Mar 30, 2009, at 2:49 PM, Alex Fenton wrote: > Eric Will wrote: >> That's very interesting, but not totally what I'm looking for. Kava >> for Perl is a total packager into an exe. Perhaps it compiles the >> bytecode and compresses the interpreter into an exe, I'm not sure. >> RubyScript2Exe is unacceptably slow, so if "extract exe and all >> libraries every time" is still the way to go, I can't use that. The >> users of my GUI apps have no admin rights on their computers so I >> can't install Ruby (or anything else). They only thing they can write >> to is a home directory on a network share. > > To get round this - esp the time taken to unzip the ruby interpreter > plus the (not small) wxruby libs plus everything else, I create a > Windows installer using NSIS which installs a custom ruby, the > ruby .dll and all the ruby library files needed. There's some more > details and links to the implementation code here: > > http://rubyforge.org/pipermail/wxruby-users/2008-October/004258.html > > a > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From lists at ruby-forum.com Mon Mar 30 18:47:49 2009 From: lists at ruby-forum.com (Michael Satterwhite) Date: Tue, 31 Mar 2009 00:47:49 +0200 Subject: [wxruby-users] Problem with ListBox height Message-ID: <8e6b163cb7426354c8eca3e6f439a072@ruby-forum.com> I have a Wx::ListBox control in a BoxSizer in a dialog. I'm using the Wx::GROW option for the box. The ListBox is properly sizing to the [b]WIDTH[/b] of the sizer, but it isn't sizing vertically at all. Initially, the ListBox has no items in it (the contents of the box is under control of the user). Even with no items, I want to see it sized vertically to the allocated size. The fact that it is empty (or only has 2 or three items) shouldn't inhibit its vertical size. Can anyone offer any help? ---Michael -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Mon Mar 30 23:24:50 2009 From: mario at ruby-im.net (Mario Steele) Date: Mon, 30 Mar 2009 22:24:50 -0500 Subject: [wxruby-users] Distributing Windows WxRuby apps In-Reply-To: <6752BA5A-42F5-4B66-A125-354DE642EA5F@malkier.net> References: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> <49C269B1.40507@pressure.to> <1ce38ef40903300445l1e4146d9o2ce865a45b72a041@mail.gmail.com> <49D0C3CC.3030404@pressure.to> <1ce38ef40903300706u735dfc93x8c63955d36e31e@mail.gmail.com> <49D11431.1080904@pressure.to> <6752BA5A-42F5-4B66-A125-354DE642EA5F@malkier.net> Message-ID: I wish to point out another option, that I've come across dealing with something of other sorts. PortableApps. http://www.portableapps.com, They use a NSIS Script, that doesn't actually install anything, but creates an Environment to execute a program, to keep it portable. If you look at the contents of one of their programs, you'll see that the actual application is stored into a folder named apps, while the actual executable used to launch the application, is just an NullSoft Installer executable. Specifically look at this page, at Step 4: http://portableapps.com/development On Mon, Mar 30, 2009 at 5:02 PM, Eric Will wrote: > I saw, but I can't install anything on these machines. > > -- > Eric Will / rakaur @ malkier > > > On Mar 30, 2009, at 2:49 PM, Alex Fenton wrote: > > Eric Will wrote: >> >>> That's very interesting, but not totally what I'm looking for. Kava >>> for Perl is a total packager into an exe. Perhaps it compiles the >>> bytecode and compresses the interpreter into an exe, I'm not sure. >>> RubyScript2Exe is unacceptably slow, so if "extract exe and all >>> libraries every time" is still the way to go, I can't use that. The >>> users of my GUI apps have no admin rights on their computers so I >>> can't install Ruby (or anything else). They only thing they can write >>> to is a home directory on a network share. >>> >> >> To get round this - esp the time taken to unzip the ruby interpreter plus >> the (not small) wxruby libs plus everything else, I create a Windows >> installer using NSIS which installs a custom ruby, the ruby .dll and all the >> ruby library files needed. There's some more details and links to the >> implementation code here: >> >> http://rubyforge.org/pipermail/wxruby-users/2008-October/004258.html >> >> a >> _______________________________________________ >> 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 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 penguinroad at gmail.com Tue Mar 31 00:28:06 2009 From: penguinroad at gmail.com (hendra kusuma) Date: Tue, 31 Mar 2009 11:28:06 +0700 Subject: [wxruby-users] Grid In-Reply-To: <20E76E7A3375460E992201958EE3FF64@sebastien> References: <20E76E7A3375460E992201958EE3FF64@sebastien> Message-ID: <26dadb3d0903302128s3bd5f822ldc52ad508ce6d3e4@mail.gmail.com> ??? in english please 2009/3/31 sebastien > Bonjour. > Je voudrais savoir comment d?s?lectionn? le rectangle noir ce trouvant dans > la premi?re colonne(rows 0, col 0) de l'exemple Grid? > Y ? t'il une option comme "TE_READONLY" qui emp?che d'?crire dans les > cases? > Merci > S?bastien > http://beusse.liveror.com/ > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Mar 31 00:28:14 2009 From: lists at ruby-forum.com (7stud --) Date: Tue, 31 Mar 2009 06:28:14 +0200 Subject: [wxruby-users] RadioBox--majorDimension backwards In-Reply-To: <49D11BE0.5080502@pressure.to> References: <63d15db2a99f992e7f82dcefff90e230@ruby-forum.com> <49D11BE0.5080502@pressure.to> Message-ID: Alex Fenton wrote: > > After your kind words about the docs, it's a documentation bug. The > "majorDimension" argument should be specified with ":major_dimension" - > train_case not CamelCase. I think it works as expected if the parameter > name is given correctly. > Yep, that works for me. Thanks for the response. -- Posted via http://www.ruby-forum.com/. From penguinroad at gmail.com Tue Mar 31 00:32:04 2009 From: penguinroad at gmail.com (hendra kusuma) Date: Tue, 31 Mar 2009 11:32:04 +0700 Subject: [wxruby-users] mouse click event at grid Message-ID: <26dadb3d0903302132g3e2e5844sa39468c845cbb8b8@mail.gmail.com> Dear all, how do we create an mouse click event binding for a grid? I look over the docs and cannot find any clue about it. google did not help either. Thank you Regards Hendra -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Mar 31 01:02:52 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Tue, 31 Mar 2009 07:02:52 +0200 Subject: [wxruby-users] Error: undefined method 'calc_min' for # Message-ID: Hi, I occasionally had the following error when application in idle state. Error: undefined method 'calc_min' for # OS: WXMSW Ruby Version: 1.8.6 wxRuby 2.0.0 Backtrace: (eval):154:in `calc_min' (eval):154:in `layout' (eval):154:in `process_event' (eval):154:in `on_run' (eval):154:in `main_loop' Zhimin -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Mar 31 01:42:33 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 31 Mar 2009 06:42:33 +0100 Subject: [wxruby-users] Distributing Windows WxRuby apps In-Reply-To: <6752BA5A-42F5-4B66-A125-354DE642EA5F@malkier.net> References: <00F75AFD629445C6BCAC74B6A8244593@valcom.com> <49C269B1.40507@pressure.to> <1ce38ef40903300445l1e4146d9o2ce865a45b72a041@mail.gmail.com> <49D0C3CC.3030404@pressure.to> <1ce38ef40903300706u735dfc93x8c63955d36e31e@mail.gmail.com> <49D11431.1080904@pressure.to> <6752BA5A-42F5-4B66-A125-354DE642EA5F@malkier.net> Message-ID: <49D1AD49.5090309@pressure.to> Eric Will wrote: > I saw, but I can't install anything on these machines. > >> Eric Will wrote: >>> They only thing they can write >>> to is a home directory on a network share. Write permission to somewhere is enough to install with this approach. It uses a self-contained Ruby, so nothing needs to go in any system directory, and no changes to PATH are needed. I don't have admin rights on my work machine but this don't prevent me installing this way. Try using the Weft QDA 1.9 installer and setting the target directory to X:/MyStuff/Weft (or whatever your networked home dir is called): http://rubyforge.org/frs/download.php/35715/weft-qda-install-1.9.0.exe it's only an alpha release but it should allow you to assess the viability of this approach. a From alex at pressure.to Tue Mar 31 02:09:02 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 31 Mar 2009 07:09:02 +0100 Subject: [wxruby-users] Grid In-Reply-To: <26dadb3d0903302128s3bd5f822ldc52ad508ce6d3e4@mail.gmail.com> References: <20E76E7A3375460E992201958EE3FF64@sebastien> <26dadb3d0903302128s3bd5f822ldc52ad508ce6d3e4@mail.gmail.com> Message-ID: <49D1B37E.80307@pressure.to> hendra kusuma wrote: > ??? > in english please Hendra: numerous people involved with wxRuby speak French. We accept French questions on this list on the understanding that if responding, some attempt to summarise in English is made. You are free to ignore this. > 2009/3/31 sebastien > > > Je voudrais savoir comment d?s?lectionn? le rectangle noir ce > trouvant dans la premi?re colonne(rows 0, col 0) de l'exemple Grid? > Y ? t'il une option comme "TE_READONLY" qui emp?che d'?crire dans > les cases? > a From alex at pressure.to Tue Mar 31 02:20:38 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 31 Mar 2009 07:20:38 +0100 Subject: [wxruby-users] Grid In-Reply-To: <20E76E7A3375460E992201958EE3FF64@sebastien> References: <20E76E7A3375460E992201958EE3FF64@sebastien> Message-ID: <49D1B636.90005@pressure.to> Bonjour sebastien wrote: > Je voudrais savoir comment d?s?lectionn? le rectangle noir ce trouvant > dans la premi?re colonne(rows 0, col 0) de l'exemple Grid? > Y ? t'il une option comme "TE_READONLY" qui emp?che d'?crire dans les > cases? [Sebastien wrote: I'd like to know how to deselect the black rectangle in the first cell (row 0, column 0) of the grid example. Is there an option similar to TE_READONLY which prevents editing?] On peut utiliser 'Grid#enable_editing(false)' pour emp?cher d'?crire, mais ?a ne cache pas le rectangle noir. Ici: http://lists.wxwidgets.org/pipermail/wxpython-users/2003-March/017516.html on parle d'une m?thode de wxPython, 'Grid#SetCellPenHiglightWidth' qui, je crois, fait exactement ce que tu veux. Malheureusement, cette m?thode n'?tait pas document? par wxWidgets, et donc, n'est pas disponible en wxRuby 2.0. [You can use Grid.enable_editing(false) to prevent editing, but that doesn't hide the black rectangle. Here: http://lists.wxwidgets.org/pipermail/wxpython-users/2003-March/017516.html there is a reference to a wxPython method 'Grid#SetCellPenHighlightWidth', which I think does exactly what you want. Unfortunately, this method wasn't documented by wxWidgets and so isn't available in wxRuby 2.0]. alex From alex at pressure.to Tue Mar 31 02:25:57 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 31 Mar 2009 07:25:57 +0100 Subject: [wxruby-users] mouse click event at grid In-Reply-To: <26dadb3d0903302132g3e2e5844sa39468c845cbb8b8@mail.gmail.com> References: <26dadb3d0903302132g3e2e5844sa39468c845cbb8b8@mail.gmail.com> Message-ID: <49D1B775.6010204@pressure.to> hendra kusuma wrote: > how do we create an mouse click event binding for a grid? > I look over the docs and cannot find any clue about it. > google did not help either. evt_grid_cell_left_click Documented here: http://docs.wxwidgets.org/stable/wx_wxgrid.html#wxgrid Sorry, this appears to be missing from wxRuby docs. If in doubt, it can be worth searching the wxWidgets docs as a backup. Just prepend 'wx' to the class name for searching (eg wxGrid). With any widget, you can also use the lower-level mouse event handlers, eg grid.evt_left_up alex From alex at pressure.to Tue Mar 31 02:28:38 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 31 Mar 2009 07:28:38 +0100 Subject: [wxruby-users] Problem with ListBox height In-Reply-To: <8e6b163cb7426354c8eca3e6f439a072@ruby-forum.com> References: <8e6b163cb7426354c8eca3e6f439a072@ruby-forum.com> Message-ID: <49D1B816.6050206@pressure.to> Michael Satterwhite wrote: > I have a Wx::ListBox control in a BoxSizer in a dialog. I'm using the > Wx::GROW option for the box. The ListBox is properly sizing to the > [b]WIDTH[/b] of the sizer, but it isn't sizing vertically at all. > Initially, the ListBox has no items in it (the contents of the box is > under control of the user). Even with no items, I want to see it sized > vertically to the allocated size. The fact that it is empty (or only has > 2 or three items) shouldn't inhibit its vertical size. Give a non-zero proportion argument to Sizer#add - this tells the Sizer how much of the main dimension (eg vertical) to allocate to that widget. hth a From mario at ruby-im.net Tue Mar 31 02:29:35 2009 From: mario at ruby-im.net (Mario Steele) Date: Tue, 31 Mar 2009 01:29:35 -0500 Subject: [wxruby-users] mouse click event at grid In-Reply-To: <26dadb3d0903302132g3e2e5844sa39468c845cbb8b8@mail.gmail.com> References: <26dadb3d0903302132g3e2e5844sa39468c845cbb8b8@mail.gmail.com> Message-ID: Hello Hendra, You should be able to monitor evt_left_down, and evt_left_up for a click event. The actual detecting of a Click, would require that in evt_left_down, you store the mouse position, and the time at which the event was generated, then on evt_left_up, take the current time, and subtract the time at which your program received evt_left_down, to see if it's within a normal time frame to qualify it as a click, and you would want to make sure that the mouse position matched the first one, then fire off your method you want to execute when a click occurs on the grid. Take a look at the Event sample folder, for a way to do this, through a custom event handling system. hth, Mario 2009/3/30 hendra kusuma > Dear all, > > how do we create an mouse click event binding for a grid? > I look over the docs and cannot find any clue about it. > google did not help either. > > Thank you > Regards > Hendra > > > > _______________________________________________ > 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 Tue Mar 31 02:30:12 2009 From: mario at ruby-im.net (Mario Steele) Date: Tue, 31 Mar 2009 01:30:12 -0500 Subject: [wxruby-users] Grid In-Reply-To: <26dadb3d0903302128s3bd5f822ldc52ad508ce6d3e4@mail.gmail.com> References: <20E76E7A3375460E992201958EE3FF64@sebastien> <26dadb3d0903302128s3bd5f822ldc52ad508ce6d3e4@mail.gmail.com> Message-ID: Not all users are english users Hendra, usually either me, or Alex will translate the message, and post a reply. 2009/3/30 hendra kusuma > ??? > in english please > > 2009/3/31 sebastien > >> Bonjour. >> Je voudrais savoir comment d?s?lectionn? le rectangle noir ce trouvant >> dans la premi?re colonne(rows 0, col 0) de l'exemple Grid? >> Y ? t'il une option comme "TE_READONLY" qui emp?che d'?crire dans les >> cases? >> Merci >> S?bastien >> http://beusse.liveror.com/ >> >> _______________________________________________ >> 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 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 rakaur at malkier.net Tue Mar 31 08:13:12 2009 From: rakaur at malkier.net (Eric Will) Date: Tue, 31 Mar 2009 08:13:12 -0400 Subject: [wxruby-users] Error: undefined method 'calc_min' for # In-Reply-To: References: Message-ID: <1ce38ef40903310513i3003a81dr452c8ad723789734@mail.gmail.com> On Tue, Mar 31, 2009 at 1:02 AM, Zhimin Zhan wrote: > Hi, > > I occasionally had the following error when application in idle state. > > Error: undefined method 'calc_min' for # I've been having a related problem, and I've sent Alex some code to reproduce. Mine happens when show()'ing a certain Frame, and I can't track it down. Only happens on 1.9 for me, though. -- Eric Will From michael at weblore.com Tue Mar 31 12:16:17 2009 From: michael at weblore.com (Michael Satterwhite) Date: Tue, 31 Mar 2009 11:16:17 -0500 Subject: [wxruby-users] Problem with ListBox height - Thank You! In-Reply-To: <49D1B816.6050206@pressure.to> References: <8e6b163cb7426354c8eca3e6f439a072@ruby-forum.com> <49D1B816.6050206@pressure.to> Message-ID: <200903311116.17387.michael@weblore.com> On Tuesday 31 March 2009 01:28:38 am Alex Fenton wrote: > > Give a non-zero proportion argument to Sizer#add - this tells the Sizer > how much of the main dimension (eg vertical) to allocate to that widget. Thank you very much. I'm still learning wxruby / wxwidgets. I appreciate the help! ----Michael From rakaur at malkier.net Tue Mar 31 14:57:45 2009 From: rakaur at malkier.net (Eric Will) Date: Tue, 31 Mar 2009 14:57:45 -0400 Subject: [wxruby-users] Error: undefined method 'calc_min' for # In-Reply-To: References: Message-ID: <1ce38ef40903311157i64634dd3mad0618645464908d@mail.gmail.com> Are you using DataMapper? I've tracked this as my issue. I don't know what's wrong exactly, but after using DM to pull out a large amount of data I get this. I think it's destroying the heap or something, somehow. It only happens in 1.9 for me. It's so odd. I'm going to have to fall back to just using the mysql module to pull the data itself, then use DM to objectify them when I need them. It's definitely DM, but I couldn't find a rhyme or reason to any of the problems. It changes every time, and sometimes works fine. It has something to do with GC as well, because when I fiddle with the GC settings it works a lot better, but ultimately crashes anyway. From rakaur at malkier.net Tue Mar 31 16:07:10 2009 From: rakaur at malkier.net (Eric Will) Date: Tue, 31 Mar 2009 16:07:10 -0400 Subject: [wxruby-users] Error: undefined method 'calc_min' for # In-Reply-To: <1ce38ef40903311157i64634dd3mad0618645464908d@mail.gmail.com> References: <1ce38ef40903311157i64634dd3mad0618645464908d@mail.gmail.com> Message-ID: On Mar 31, 2009, at 2:57 PM, Eric Will wrote: > Are you using DataMapper? Seems mysql causes the same problem. I'm at a total loss. From alex at pressure.to Tue Mar 31 16:14:12 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 31 Mar 2009 21:14:12 +0100 Subject: [wxruby-users] Error: undefined method 'calc_min' for # In-Reply-To: <1ce38ef40903311157i64634dd3mad0618645464908d@mail.gmail.com> References: <1ce38ef40903311157i64634dd3mad0618645464908d@mail.gmail.com> Message-ID: <49D27994.3010806@pressure.to> Hi Eric Eric Will wrote: > Are you using DataMapper? > > I've tracked this as my issue. I don't know what's wrong exactly, but > after using DM to pull out a large amount of data I get this. I think > it's destroying the heap or something, somehow. It only happens in 1.9 > for me. It's so odd. I'm going to have to fall back to just using the > mysql module to pull the data itself, then use DM to objectify them > when I need them. > > It's definitely DM, but I couldn't find a rhyme or reason to any of > the problems. It changes every time, and sometimes works fine. It has > something to do with GC as well, because when I fiddle with the GC > settings it works a lot better, but ultimately crashes anyway. Thanks for the follow-up. It could indeed be a bug in another extension or in the ruby interpreter itself. Or it could be a bad interaction between wxRuby and something else. The reason I say the latter is that wxRuby shouldn't be calling a Sizer method (calc_min) on an object without being sure that that object is indeed a Wx::Sizer. alex From lists at ruby-forum.com Tue Mar 31 18:02:17 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Wed, 1 Apr 2009 00:02:17 +0200 Subject: [wxruby-users] Error: undefined method 'calc_min' for # In-Reply-To: <1ce38ef40903311157i64634dd3mad0618645464908d@mail.gmail.com> References: <1ce38ef40903311157i64634dd3mad0618645464908d@mail.gmail.com> Message-ID: <17330e3825a5f8a87ec23f57ec522f1b@ruby-forum.com> > Are you using DataMapper? My app uses Sqlite3. The error happened several times, usually when trying to go back the app after leaving app idle for while. Ruby 1.8.6 p114 wxRuby 2.0.0 on Windows XP Zhimin -- Posted via http://www.ruby-forum.com/.