From alex at pressure.to Fri Sep 4 14:19:39 2009 From: alex at pressure.to (Alex Fenton) Date: Fri, 04 Sep 2009 19:19:39 +0100 Subject: [wxruby-users] logo problem and speed up startup time In-Reply-To: <1ffc56810908170914p3996f41ei5b50228fd2ab208e@mail.gmail.com> References: <1ffc56810908170914p3996f41ei5b50228fd2ab208e@mail.gmail.com> Message-ID: <4AA15A3B.3080507@pressure.to> Alex Dev wrote: > I am using ocra to convert my wxruby script to exe file. But the exe > file needs a long periods of time to startup, is there any way to > speed up or make a logo avoid a long time waitting? I haven't tried ocra myself, but my guess is that it archives the ruby files plus all the libraries, then unpacks them when the executable runs. Since the wxruby library is pretty large, this takes some time - I had the same problem with rubyscript2exe. Try building the executable with the --no-lzma option. The resulting file will be bigger but it may well start faster. LZMA is a very efficient compression algorithm but quite slow. Let us know how it goes alex From max-braeu at gmx.de Sat Sep 5 10:57:50 2009 From: max-braeu at gmx.de (Maximilian =?ISO-8859-1?Q?Br=E4utigam?=) Date: Sat, 05 Sep 2009 14:57:50 +0000 Subject: [wxruby-users] Filling Wx::ListCtrl with contents Message-ID: <1252162670.25583.0.camel@localhost.localdomain> Hi all, I've got a question concerning ListCtrl_virtual of wxRuby since I see no way filling the list with dynamic contents. I'm new to Ruby so I maybe have to apologise for my request. The problem is, that I have to define the on_get_item_text(item, col) function. There I would like to use the item and col variables to read data from a two-dimensional array. My very problem is, that I do not know how to transfer the array from another function to on_get_item_text(item, col) or better on_get_item_text(item, col, array). I attached a rubyscript showing what I mean. I would be very grateful, if you could give me a solution of this problem ? maybe modify my testscript. And/Or please show me how to use the approach via ListItems because the samplefile http://wxruby.rubyforge.org/doc/samplelistctrl.html at the website http://wxruby.rubyforge.org/doc/listctrl.html is not accessible. I tinkered with it but it doesn't really work. Thank you very much in advance for your kind help. Kind regards, der Max -- Maximilian Br?utigam max-braeu at gmx.de http://www.jcf.uni-jena.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: testframe.rb Type: application/x-ruby Size: 2579 bytes Desc: not available URL: From alex at pressure.to Sat Sep 5 09:26:40 2009 From: alex at pressure.to (Alex Fenton) Date: Sat, 05 Sep 2009 14:26:40 +0100 Subject: [wxruby-users] Filling Wx::ListCtrl with contents In-Reply-To: <1252162670.25583.0.camel@localhost.localdomain> References: <1252162670.25583.0.camel@localhost.localdomain> Message-ID: <4AA26710.5070900@pressure.to> Hi Maximilian Br?utigam wrote: > The problem is, that I have to define the on_get_item_text(item, col) > function. There I would like to use the item and col variables to read > data from a two-dimensional array. My very problem is, that I do not > know how to transfer the array from another function to > on_get_item_text(item, col) or better on_get_item_text(item, col, > array). I attached a rubyscript showing what I mean. I'm not 100% sure this is what you want, but if you want the ListCtrl to access the data from the frame, you could just write (in your on_get_item_text method) parent.get_contents.at(item).at(col) "parent" is a method available on all Windows which returns the containing frame/panel/etc. Or you could also split out your listctrl into a separate subclass. Also, there is much simpler syntax than you're using for event handlers, where you have @listctrl.evt_list_item_selected(@listctrl.get_id()) {|event| on_item_selected(event)} you could just writen evt_list_item_selected(@listctrl, :on_item_selected) hth alex From lists at ruby-forum.com Sat Sep 5 14:22:47 2009 From: lists at ruby-forum.com (7stud --) Date: Sat, 5 Sep 2009 20:22:47 +0200 Subject: [wxruby-users] Filling Wx::ListCtrl with contents In-Reply-To: <4AA26710.5070900@pressure.to> References: <1252162670.25583.0.camel@localhost.localdomain> <4AA26710.5070900@pressure.to> Message-ID: Alex Fenton wrote: > Hi Alex, Is there any sample code for a Wx::ListCtrl? On this page: http://wxruby.rubyforge.org/doc/listctrl.html the link to the sample code located here: http://wxruby.rubyforge.org/doc/samplelistctrl.html produces a 404 Not Found error. On my own, I could not figure out how to add items to the different columns of a "report view" styled Wx::ListCtrl, require 'rubygems' require 'wx' class MyFrame < Wx::Frame def initialize super(nil, :title => "Test", :size => [600, 400]) panel = Wx::Panel.new(self) my_list = Wx::ListCtrl.new(panel, :name => "Drinks", :size => [400, 100], :style => Wx::LC_REPORT) my_list.insert_column(0, "Drinks") my_list.insert_column(1, "Extras") =begin my_list.set_item(0, 0, "coffee") my_list.set_item(1, 0, "tea") my_list.set_item(2, 0, "water") =end my_list.insert_item(0, "coffee") my_list.insert_item(1, "tea") my_list.insert_item(2, "water") show end end class MyApp < Wx::App def on_init MyFrame.new end end MyApp.new.main_loop How would I add items to the second column? -- Posted via http://www.ruby-forum.com/. From max-braeu at gmx.de Sat Sep 5 17:14:39 2009 From: max-braeu at gmx.de (Maximilian =?ISO-8859-1?Q?Br=E4utigam?=) Date: Sat, 05 Sep 2009 21:14:39 +0000 Subject: [wxruby-users] Filling Wx::ListCtrl with contents In-Reply-To: References: <1252162670.25583.0.camel@localhost.localdomain> <4AA26710.5070900@pressure.to> Message-ID: <1252185279.27893.3.camel@localhost.localdomain> Am Samstag, den 05.09.2009, 20:22 +0200 schrieb 7stud --: > Alex Fenton wrote: > > > > Hi Alex, > > Is there any sample code for a Wx::ListCtrl? On this page: > > http://wxruby.rubyforge.org/doc/listctrl.html > > the link to the sample code located here: > > http://wxruby.rubyforge.org/doc/samplelistctrl.html > > produces a 404 Not Found error. > > On my own, I could not figure out how to add items to the different > columns of a "report view" styled Wx::ListCtrl, > > > require 'rubygems' > require 'wx' > > class MyFrame < Wx::Frame > > def initialize > super(nil, > :title => "Test", > :size => [600, 400]) > > panel = Wx::Panel.new(self) > > my_list = Wx::ListCtrl.new(panel, > :name => "Drinks", > :size => [400, 100], > :style => Wx::LC_REPORT) > > my_list.insert_column(0, "Drinks") > my_list.insert_column(1, "Extras") > > =begin > my_list.set_item(0, 0, "coffee") > my_list.set_item(1, 0, "tea") > my_list.set_item(2, 0, "water") > =end > > my_list.insert_item(0, "coffee") > my_list.insert_item(1, "tea") > my_list.insert_item(2, "water") > > show > end > > end > > class MyApp < Wx::App > def on_init > MyFrame.new > end > end > > MyApp.new.main_loop > > > How would I add items to the second column? Hi 7stud, with the help of Alex I was able to modify my testscript so it's working. Honestly, I'm not using ListItems but ListCtrl_virtual. Try it out. Kind regards, der Max -- Maximilian Br?utigam max-braeu at gmx.de http://www.jcf.uni-jena.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: testframe.rb Type: application/x-ruby Size: 2009 bytes Desc: not available URL: From alex at pressure.to Sun Sep 6 14:30:06 2009 From: alex at pressure.to (Alex Fenton) Date: Sun, 06 Sep 2009 19:30:06 +0100 Subject: [wxruby-users] Filling Wx::ListCtrl with contents In-Reply-To: References: <1252162670.25583.0.camel@localhost.localdomain> <4AA26710.5070900@pressure.to> Message-ID: <4AA3FFAE.7010504@pressure.to> hi 7stud -- wrote: > On my own, I could not figure out how to add items to the different > columns of a "report view" styled Wx::ListCtrl, > > ... > How would I add items to the second column? > Call insert_item first to create the row, then use set_item to set the text in the secondary columns. In your sample, something like: my_list.insert_item(0, "coffee") my_list.set_item(0, 1, "milk") my_list.insert_item(1, "tea") my_list.set_item(1, 1, "sugar") my_list.insert_item(2, "water") my_list.set_item(2, 1, "bubbles") alex From lists at ruby-forum.com Sun Sep 6 19:29:19 2009 From: lists at ruby-forum.com (7stud --) Date: Mon, 7 Sep 2009 01:29:19 +0200 Subject: [wxruby-users] Filling Wx::ListCtrl with contents In-Reply-To: <4AA3FFAE.7010504@pressure.to> References: <1252162670.25583.0.camel@localhost.localdomain> <4AA26710.5070900@pressure.to> <4AA3FFAE.7010504@pressure.to> Message-ID: <6e5956ad9f677b902327205f9a7254d6@ruby-forum.com> Alex Fenton wrote: > > Call insert_item first to create the row, then use set_item to set the > text in the secondary columns. In your sample, something like: > > my_list.insert_item(0, "coffee") > my_list.set_item(0, 1, "milk") > my_list.insert_item(1, "tea") > my_list.set_item(1, 1, "sugar") > my_list.insert_item(2, "water") > my_list.set_item(2, 1, "bubbles") > > alex Thanks Alex. Can you fix that broken link as well? -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Sep 6 19:38:12 2009 From: lists at ruby-forum.com (7stud --) Date: Mon, 7 Sep 2009 01:38:12 +0200 Subject: [wxruby-users] wxRuby install problem In-Reply-To: <6a1c584af0d21778430d896f57e49933@ruby-forum.com> References: <6a1c584af0d21778430d896f57e49933@ruby-forum.com> Message-ID: <932f85941d66703fb1e188ec909c5b3a@ruby-forum.com> Pito Salas wrote: > ~$ gem which wxruby > Can't find ruby library file or shared library wxruby > Hopefully, you found a solution already. If not, I get the same message on mac os 10.4.11, but my wxruby works fine. You left out one important detail... >'gem which' still fails, as >does running the app. "running the app" doesn't give much insight into what you are doing to execute your program or what is actually in your program. By the way, a program to test your wxruby install does not need to be more than 2 lines long, so don't post anything longer than that. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Sep 9 05:33:44 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 09 Sep 2009 10:33:44 +0100 Subject: [wxruby-users] GridTableBase In-Reply-To: <26dadb3d0909090216j5f0f6350jbf8e934cc891e986@mail.gmail.com> References: <26dadb3d0909090216j5f0f6350jbf8e934cc891e986@mail.gmail.com> Message-ID: <4AA77678.8030406@pressure.to> Hi hendra kusuma wrote: > can anyone post here (or point a link) > code sample or tutorial > about GridTableBase? > cannot find on google There's a complete example in the samples in the wxruby distribution: http://wxruby.rubyforge.org/svn/branches/wxruby_2_0_stable/samples/grid/gridtablebase.rb > btw, I read that I should only use GridTableBase > with a lot of data > how many is a lot? > My data is above 1000 rows below 10000. Is it a lot? Not necessarily. One reason to use GridTableBase is if loading all the data at once and creating all the grid cells is too slow, or takes up too much memory. What's "slow" or "too much" is your judgement. I've come to also like using GridTableBase as a nicer way to connect to a data model to a GUI view, even where the efficiency is not a problem. alex From alex at pressure.to Wed Sep 9 08:48:11 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 09 Sep 2009 13:48:11 +0100 Subject: [wxruby-users] wxRuby 2.0.1 Message-ID: <4AA7A40B.30602@pressure.to> Hi I'm pleased to let you know that wxRuby 2.0.1 is now on Rubyforge: http://rubyforge.org/frs/?group_id=35&release_id=38847 Binary gems for Ruby 1.8 and Ruby 1.9 on all the major platforms are available; an update to the Ruby 1.9.1 all-in-one installer for Windows will follow shortly. This is a maintenance release which fixes some bugs and adds some methods that were documented but missing, as well as various improvements to the docs, samples and build process. There's a summary of the changes below, and a complete ChangeLog attached to the release on Rubyforge. Thanks to all who contributed. Chauk-Mean did most of the work pushing this release forward, and it's benefitted from numerous user-submitted patches and bug reports from Pascal Hurni and others. cheers alex __ API - Fix HtmlWindow#set_fonts - Considerable work on GLCanvas for future compatibility with wx - Add important missing methods in BookCtrl classes - Fix superclass of Listbook to be BookCtrlBase, not Control - Add missing FocusEvent#get/set_window - Improve checking and error reporting when using named arguments - Clear up confusing overloaded methods set/get_alpha/rgb_data in Image class - evt_timer now accepts a Timer object, consistent with other evt_xxx methods - Several fixes to DateTime handling - Fixes for CalendarCtrl#get_range and ALLOW_NONE - CheckListBox#append now returns index of new item - Add missing named arguments for FileDialog constructor - Add missing FD_DEFAULT_STYLE constant for FileDialog - Avoid double-sprintf of Log messages which is a potential security risk - Fix GC-related crash when using DropTarget with Tree or ListCtrl Compilation - Remove deprecated call to Gem#manage_gems in build process - Compile fix for casting of wxDataFormatId - Add support for building with Ruby 1.9.2 - Work around wx compilation errors with recently updated OS X 10.5 - Restore test for SWIG_MAXIMUM_VERSION as > 1.3.38 won't work - Avoid error with compilers that enforce literal string argument to sprintf Documentation and Samples - Use new wxRuby logo in more places - Numerous additions and corrections to docs and examples From chauk.mean at gmail.com Wed Sep 9 13:58:36 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Wed, 9 Sep 2009 19:58:36 +0200 Subject: [wxruby-users] wxRuby 2.0.1 In-Reply-To: <4AA7A40B.30602@pressure.to> References: <4AA7A40B.30602@pressure.to> Message-ID: Hi, 2009/9/9 Alex Fenton : > Hi > > I'm pleased to let you know that wxRuby 2.0.1 is now on Rubyforge: > > http://rubyforge.org/frs/?group_id=35&release_id=38847 > > Binary gems for Ruby 1.8 and Ruby 1.9 on all the major platforms are > available; an update to the Ruby 1.9.1 all-in-one installer for Windows will > follow shortly. > I've just uploaded the new installer for Windows. >From the release notes : "A wxRuby distribution for Windows bundling : - ruby-1.9.1-p243 with its minimal dependency (zlib, iconv) built with MinGW - wxRuby-2.0.1 - built with wxWidgets-2.8.10 - associated documentation and samples - ruby-opengl-0.60.1 - RMagick-2.11.0 built with ImageMagick-6.5.5-6 with PNG/JPEG/TIFF support " In addition to an updated version of Ruby and wxRuby, you can now enjoy the OpenGL and RMagick samples provided with wxRuby. Cheers. Chauk-Mean. From lists at ruby-forum.com Wed Sep 9 18:48:52 2009 From: lists at ruby-forum.com (Simon Vdm) Date: Thu, 10 Sep 2009 00:48:52 +0200 Subject: [wxruby-users] How to make my application executable in Mac OS X? Message-ID: Hi all, I am trying to make my new wxRuby app look as professional as possible on Mac OS X and I've encountered two annoying problems I could use some help with. 1) How do I make my app into an executable? So far I've tried these 2 options: a) Make an executable shell script that calls the app Simple but opens a terminal window as well as my app => unnacceptable. b) Use platypus to create an apple app. Very nice but there are still 2 icons in the dock: the platypus application and my wxRuby icon. How can I reduce that to one icon? Crate allows you to static link your whole app + gems + ruby in one executable. This might solve my problem but is really not a route I want to go unless there is no other option. 2) How do I rename the first menu column? The default is "ruby", should be my application's name. Thank you in advance for your help. Regards, Simon -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 9 19:36:01 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Thu, 10 Sep 2009 01:36:01 +0200 Subject: [wxruby-users] wxRuby 2.0.1 In-Reply-To: <4AA7A40B.30602@pressure.to> References: <4AA7A40B.30602@pressure.to> Message-ID: > I'm pleased to let you know that wxRuby 2.0.1 is now on Rubyforge: Thanks all for your great work! Regards, Zhimin -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 9 19:41:27 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Thu, 10 Sep 2009 01:41:27 +0200 Subject: [wxruby-users] "msvcrt-ruby.ruby1818.dll not found" on wxruby-2.0.1 mingw32 Message-ID: <85693b4362480bb47072508c327fbfe2@ruby-forum.com> Hi all, Just upgraded to wxruby-2.0.1-x86-mingw32 (from 2.0.0), got an error when starting my app. "The application has failed to start because msvcrt-ruby1818.dll was not found. Re-installing the application may fix this problem." Uninstalled v2.0.1, the application started OK. My env: ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32] on Windows XP (from http://rubyforge.org/frs/?group_id=167&release_id=38052) Cheers, Zhimin -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Thu Sep 10 03:01:09 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Thu, 10 Sep 2009 09:01:09 +0200 Subject: [wxruby-users] "msvcrt-ruby.ruby1818.dll not found" on wxruby-2.0.1 mingw32 In-Reply-To: <85693b4362480bb47072508c327fbfe2@ruby-forum.com> References: <85693b4362480bb47072508c327fbfe2@ruby-forum.com> Message-ID: Hi, 2009/9/10 Zhimin Zhan : > Just upgraded to wxruby-2.0.1-x86-mingw32 (from 2.0.0), got an error > when starting my app. > > ?"The application has failed to start because msvcrt-ruby1818.dll was > not found. Re-installing the application may fix this problem." Strange. The dll should be in the ruby-1.8 installation (in the bin folder). I'll take a look at the ruby distribution you indicated. The (Windows) environment used to build wxRuby MinGW gems is the following : - MSYS-1.0.11 - Latest stable MinGW headers, libs, ... with gcc-3.4.5 and g++-3.4.5 - ruby-1.8 and ruby-1.9 builds with only the --prefix option. (e.g. ./configure --prefix=C:/opt/ruby-1.8) You can also take a look at the wxruby all in one ruby-1.9 installer. Cheers. Chauk-Mean. From alex at pressure.to Thu Sep 10 05:13:26 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 10 Sep 2009 10:13:26 +0100 Subject: [wxruby-users] How to make my application executable in Mac OS X? In-Reply-To: References: Message-ID: <4AA8C336.8070101@pressure.to> Hi Simon Vdm wrote: > I am trying to make my new wxRuby app look as professional as possible > on Mac OS X and I've encountered two annoying problems I could use some > help with. > Given the questions you're asking, the following should make sense: http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/rake_osx.rb It tackles both the issues and also packaging in a .dmg. > b) Use platypus to create an apple app. > > Very nice but there are still 2 icons in the dock: the platypus > application and my wxRuby icon. How can I reduce that to one icon? > The created App bundle has a file Contents/Info.plist, the XML description. There's an element "LSUIElement" - change the value of this from 0 to 1. Then it will only show a single icon in the dock, which as you probably know you can change with Wx::TaskBarIcon. I think Platypus 4 has an argument for this, but the first release was buggy so I carried on using 3. > Crate allows you to static link your whole app + gems + ruby in one > executable. This might solve my problem but is really not a route I want > to go unless there is no other option. > > 2) How do I rename the first menu column? > > The default is "ruby", should be my application's name. I haven't figured any way of doing this apart from bundling my own ruby and renaming the executable that's bundled by Platypus. wxWidgets development has a method wxApp::SetAppDisplayName which sounds like it should do the right thing. But wxRuby 2.0 is based on the stable 2.8 release. alex From lists at ruby-forum.com Thu Sep 10 06:28:39 2009 From: lists at ruby-forum.com (Rooby Nooby) Date: Thu, 10 Sep 2009 12:28:39 +0200 Subject: [wxruby-users] wxRuby 2.0.1 In-Reply-To: <4AA7A40B.30602@pressure.to> References: <4AA7A40B.30602@pressure.to> Message-ID: <990adb3d0d40e402097cc0775b27c227@ruby-forum.com> It's been a while since 2.0.0. and it's great to see that things are still very much alive and active on the wxRuby scene! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Sep 10 07:15:28 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Thu, 10 Sep 2009 13:15:28 +0200 Subject: [wxruby-users] App freezes on wxruby-19-2.0.1 on Windows, fine on Mac Message-ID: With wxRuby-ruby19- v2.0.1, my app works well on Mac. But on Windows, it freezes after typing up to a dozen of characters in a StyledTextControl, mouse operations are fine. Once freezing, Ctrl+C couldn't end the process. My env: Windows XP ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32] It might be specific to my application (no issues on Ruby 1.8 with wxRuby 2.0.0 though), but hope get some advice on it. Thanks, Zhimin -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Thu Sep 10 13:03:47 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Thu, 10 Sep 2009 19:03:47 +0200 Subject: [wxruby-users] App freezes on wxruby-19-2.0.1 on Windows, fine on Mac In-Reply-To: References: Message-ID: Hi Zhimin, 2009/9/10 Zhimin Zhan : > > With wxRuby-ruby19- v2.0.1, my app works well on Mac. ?But on Windows, > it freezes after typing up to a dozen of characters in a > StyledTextControl, mouse operations are fine. Once freezing, Ctrl+C > couldn't end the process. > > My env: > ? Windows XP > ? ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32] Do you use the installer from wxRuby ? The StyledTextCtrl sample (samples/text/scintilla.rb) works fine for me. Can you try it ? > It might be specific to my application (no issues on Ruby 1.8 with > wxRuby 2.0.0 though), but hope get some advice on it. If the StyledTextCtrl sample works also fine for you, then the problem may be somewhere in your application. Then you should post a minimal part of your application that shows the problem. Cheers. Chauk-Mean. From chauk.mean at gmail.com Thu Sep 10 14:11:54 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Thu, 10 Sep 2009 20:11:54 +0200 Subject: [wxruby-users] "msvcrt-ruby.ruby1818.dll not found" on wxruby-2.0.1 mingw32 In-Reply-To: <85693b4362480bb47072508c327fbfe2@ruby-forum.com> References: <85693b4362480bb47072508c327fbfe2@ruby-forum.com> Message-ID: Hi (again) Zhimian, 2009/9/10 Zhimin Zhan : > Just upgraded to wxruby-2.0.1-x86-mingw32 (from 2.0.0), got an error > when starting my app. > > ?"The application has failed to start because msvcrt-ruby1818.dll was > not found. Re-installing the application may fix this problem." I've found the problem. For ruby-1.8, I've used the program-suffix option (./configure --prefix=C:/opt/ruby-1.8 --program-suffix=18) in order to have ruby-1.9 and ruby-1.8 usable at the same time respectively through ruby and ruby18 executables. The consequence is that the 18 suffix is also applied to the ruby-1.8 dll. I'm rebuilding right now the wxRuby-2.0.1 gem for ruby-1.8 and I will upload it. Sorry for the inconvenience. Cheers. Chauk-Mean. From chauk.mean at gmail.com Thu Sep 10 15:02:57 2009 From: chauk.mean at gmail.com (Chauk-Mean Proum) Date: Thu, 10 Sep 2009 21:02:57 +0200 Subject: [wxruby-users] "msvcrt-ruby.ruby1818.dll not found" on wxruby-2.0.1 mingw32 In-Reply-To: References: <85693b4362480bb47072508c327fbfe2@ruby-forum.com> Message-ID: 2009/9/10 Chauk-Mean Proum : > > I'm rebuilding right now the wxRuby-2.0.1 gem for ruby-1.8 and I will upload it. Done. Chauk-Mean. From lists at ruby-forum.com Thu Sep 10 18:41:50 2009 From: lists at ruby-forum.com (Zhimin Zhan) Date: Fri, 11 Sep 2009 00:41:50 +0200 Subject: [wxruby-users] "msvcrt-ruby.ruby1818.dll not found" on wxruby-2.0.1 mingw32 In-Reply-To: References: <85693b4362480bb47072508c327fbfe2@ruby-forum.com> Message-ID: Chauk-Mean, It works now, thanks! Regards, Zhimin Chauk-Mean Proum wrote: > 2009/9/10 Chauk-Mean Proum : >> >> I'm rebuilding right now the wxRuby-2.0.1 gem for ruby-1.8 and I will upload it. > > Done. > > Chauk-Mean. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Sep 11 05:20:47 2009 From: lists at ruby-forum.com (Simon Vdm) Date: Fri, 11 Sep 2009 11:20:47 +0200 Subject: [wxruby-users] How to make my application executable in Mac OS X? In-Reply-To: <4AA8C336.8070101@pressure.to> References: <4AA8C336.8070101@pressure.to> Message-ID: <0cb9855741302e2feea131157b1dcf46@ruby-forum.com> Dear Alex, your answer was quick and to the point. Problem solved. The rake file is a nice bonus indeed. Thank you, Simon -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Sep 20 00:38:25 2009 From: lists at ruby-forum.com (Michael Daly) Date: Sun, 20 Sep 2009 06:38:25 +0200 Subject: [wxruby-users] wxRuby on Snow Leopard 10.6 Message-ID: <58e0a1adfb1f891d12cde0bb83dc202f@ruby-forum.com> I upgraded from Leopard to Snow Leopard and noticed my wxRuby project would no longer run. I put more information here, but was told my post "seems" to contain spam. More information if requested. /Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError) /Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle: no matching architecture in universal wrapper - /Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle I've seen a fix on some blog posts about calling: sudo env ARCHFLAGS="-arch x86_64" before doing a gem install, but this doesn't seem to help. Any insight would be greatly appreciated. Thanks! Mike -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Sep 20 22:04:44 2009 From: lists at ruby-forum.com (Michael Daly) Date: Mon, 21 Sep 2009 04:04:44 +0200 Subject: [wxruby-users] wxRuby on Snow Leopard 10.6 In-Reply-To: References: <58e0a1adfb1f891d12cde0bb83dc202f@ruby-forum.com> Message-ID: Mario Steele wrote: > First of all, it looks like the version your trying to run, is wxRuby > 1.9.3, > which is way out dated, have you tried updating to the latest version, > 2.0.1? When I do a 'gem install wxruby' that's the version that comes down. I did a self-update to rubygems, so I'm at 1.3.5 (from the base Snow Leopard comes with 1.3.1) > Second, are you running on a 64 bit processor? That's the only reason > why > you would need to define the -arch x86_64 bit flag, as that is the > designation for 64 bit processors. If your on a 32 bit processor, then > this > should not be needed at all. I'm using a MacBook Pro with the Core 2 Duo with Snow Leopard. From what I've read, 10.5 and up is 64-bit based and this is a 64-bit processor. > And finally, be sure, that if you do update to 2.0.1, that Mac Ports has > a > suitable wxMac version of 2.8.10, which it should, since the gem is > compiled > against that. So you may need to update to 2.8.10 of wxMac if it's not > installed at that version. This may be the source of my problem. I do not have wxMac installed (at least as far as I know). I pulled it down, but I'm getting compile errors on libwxtiff-2.8.a, file is not of required architecture libwxpng-2.8.a, file is not of required architecture So, another problem to look at. > If these things don't help, please feel free to let us know, we prefer > to > use the latest version of wxRuby, as more features, and more bugs have > been > fixed in these versions, then in the older version, especially from the > 1.9.x series of the core library. It was very experimental builds of > the > core library, with many changes. Also make sure you are running on Ruby > itself at version 1.8.7, or 1.9.2 (Pre-Alpha I believe), as these are > the > latest Ruby runtime libraries we link to as well. It's basically a > similar > situation to the wxMac above. > It looks likes the version of ruby packaged with Snow Leopard is ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0] I'll keep working on getting wxMac installed, but if there's anything wrong with my setup or approach so far, any pointers would be great. Thanks! Mik -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Sep 21 00:21:07 2009 From: lists at ruby-forum.com (Michael Daly) Date: Mon, 21 Sep 2009 06:21:07 +0200 Subject: [wxruby-users] wxRuby on Snow Leopard 10.6 In-Reply-To: References: <58e0a1adfb1f891d12cde0bb83dc202f@ruby-forum.com> Message-ID: <808be257239e520a84c50d31037438f7@ruby-forum.com> Also, after installing the 2.0.1 gem (through rubygems), I receive the same error: /Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError) /Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /Library/Ruby/Gems/1.8/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Sep 22 04:37:52 2009 From: alex at pressure.to (Alex Fenton) Date: Tue, 22 Sep 2009 09:37:52 +0100 Subject: [wxruby-users] wxRuby on Snow Leopard 10.6 In-Reply-To: <58e0a1adfb1f891d12cde0bb83dc202f@ruby-forum.com> References: <58e0a1adfb1f891d12cde0bb83dc202f@ruby-forum.com> Message-ID: <4AB88CE0.9010708@pressure.to> Michael Daly wrote: > I upgraded from Leopard to Snow Leopard and noticed my wxRuby project > would no longer run. I put more information here, but was told my post > "seems" to contain spam. More information if requested. > > /Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle: > dlopen(/Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle, > 9): no suitable image found. Did find: (LoadError) > /Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle: > no matching architecture in universal wrapper - > /Library/Ruby/Gems/1.8/gems/wxruby-1.9.3-universal-darwin/lib/wxruby2.bundle As you've probably realised, the binary gem for Ruby 1.8 and Ruby 1.9 on OS Xis built on 10.5 with 10.4 compatibility forced. With the change of architectures between 10.5 and 10.6 the links to 32-bit libraries like libtiff (where we use the OS X system versions) aren't valid any more. I'll be upgrading to 10.6 myself soon so the next releases should fix this compatibility. Until then you could probably just compile your own from source - if you have the Developers' Tools installed for OS X, you'll already have g++, swig (check the version though) and wxWidgets, so it shouldn't need anything more than unpacking the tarball and rake [optional:] strip -x lib/wxruby2.bundle rake gem WXRUBY_VERSION=2.0.1 sudo gem install wxruby... cheers alex From ben at countersubject.org Wed Sep 23 23:23:37 2009 From: ben at countersubject.org (Ben Van Hof) Date: Wed, 23 Sep 2009 23:23:37 -0400 (Eastern Daylight Time) Subject: [wxruby-users] Running code after a modal dialog is shown Message-ID: Hi all, I'm looking for a way to get a block of code to execute once a modal dialog has been displayed (via a call to show_modal.) I was hoping to find some event that would fire when the window was shown, but the only one that seemed vaguely promising (evt_window_create) seems to do nothing at all, at least in my environment (Ruby 1.9.1 on Win32, wxruby 2.0.1.) Here's a very simple (non-modal) example, which fails to print 'Created!' as I'd (perhaps naively) expect it to: -------------------------- require "wx" class TestFrame < Wx::Frame def initialize(*args) super(*args) puts 'In Initialize!' evt_window_create { puts 'Created!' } end end class TestApp < Wx::App def on_init TestFrame.new(nil, -1, 'Test!').show() end end TestApp.new.main_loop -------------------------- (incidentally, the RubyForge doc page here: http://wxruby.rubyforge.org/doc/windowcreateevent.html still refers to this event as 'evt_create', which might be worth fixing, but that's a different issue.) I don't know if I'm misusing this event, or if there's a bug here somewhere, but at any rate I'm open to other approaches if this isn't the right way to go. My current solution is an icky hack involving timers which I'd love to be able to replace with something more sensible. I'm pretty new to both Ruby and wxRuby, so I apologize in advance if I'm missing something obvious here. Ben From alex at pressure.to Thu Sep 24 05:02:42 2009 From: alex at pressure.to (Alex Fenton) Date: Thu, 24 Sep 2009 10:02:42 +0100 Subject: [wxruby-users] Running code after a modal dialog is shown In-Reply-To: References: Message-ID: <4ABB35B2.1000401@pressure.to> Ben Van Hof wrote: > I'm looking for a way to get a block of code to execute once a modal > dialog has been displayed (via a call to show_modal.) I would probably do it by subclassing the modal dialog, providing your own show_modal method and executing the code there after super has been called. If you want it to run variable code provided by the caller, pass and capture in the constructor. eg (untested) class MyDialogWithShowHook < Wx::Dialog def initialize([args], &block) super(*args) @hook = block end def show_modal super @hook.call end end > I was hoping to find some event that would fire when the window was > shown, but the only one that seemed vaguely promising > (evt_window_create) seems to do nothing at all, at least in my > environment (Ruby 1.9.1 on Win32, wxruby 2.0.1.) There is Wx::ShowEvent which can be requested for processing with evt_show. However in wxWidgets it isn't provided on OS X, at least in some versions, so you might want to avoid that. It's not a CommandEvent so you need to call it on the instance you're capturing. Again, untested dlg = Wx::Dialog.new(...) dlg.evt_show { puts "i'm here" } dlg.show_modal evt_window_create is low level and only generally meant for debugging rather than GUI logic control. evt_window_create I think fires in a parent frame when its child windows are created, and for app when any window is created. But the exact meaning and timing of "created" may vary with the underlying toolkit - on OS X, for example, I think it fires for all the child widgets in the frame as the frame's constructor returns. > (incidentally, the RubyForge doc page here: > http://wxruby.rubyforge.org/doc/windowcreateevent.html > still refers to this event as 'evt_create', which might be worth > fixing, but that's a different issue.) Thanks, I've fixed that in SVN. > I don't know if I'm misusing this event, or if there's a bug here > somewhere, but at any rate I'm open to other approaches if this isn't > the right way to go. My current solution is an icky hack involving > timers which I'd love to be able to replace with something more sensible. Hopefully the above will help, but if you want to say more about what you're trying to achieve I'm sure people will be happy to offer some advice. alex From ben at countersubject.org Thu Sep 24 12:24:53 2009 From: ben at countersubject.org (Ben Van Hof) Date: Thu, 24 Sep 2009 12:24:53 -0400 (Eastern Daylight Time) Subject: [wxruby-users] Running code after a modal dialog is shown In-Reply-To: <4ABB35B2.1000401@pressure.to> References: <4ABB35B2.1000401@pressure.to> Message-ID: On Thu, 24 Sep 2009, Alex Fenton wrote: > I would probably do it by subclassing the modal dialog, providing your > own show_modal method and executing the code there after super has been > called. If you want it to run variable code provided by the caller, pass > and capture in the constructor. eg (untested) Thanks, Alex, for your quick and thoughtful response. I tried your first approach out; the problem is that when you call super, control doesn't return until the modal dialog has been closed: > def show_modal > super > @hook.call # we don't get here until the dialog is closed > end > There is Wx::ShowEvent which can be requested for processing with > evt_show. However in wxWidgets it isn't provided on OS X, at least in > some versions, so you might want to avoid that. It's not a CommandEvent > so you need to call it on the instance you're capturing. Again, untested > > dlg = Wx::Dialog.new(...) > dlg.evt_show { puts "i'm here" } > dlg.show_modal I gave this a try, too, but evt_show fires before the window is actually visible on the screen (at least on win32), and so still doesn't get me what I want. > Hopefully the above will help, but if you want to say more about what > you're trying to achieve I'm sure people will be happy to offer some > advice. Makes sense. I've got a long-running external process that I want to be able to report progress for, using a small modal dialog that just contains a progress bar and cancel button (it needs to be modal, since I've got a main window underneath it that I don't want the user interacting with while the process runs.) My initial approach was to spawn a worker thread and communicate progress back to the UI periodically, but ran into some ugly problems having a popen'ed process on one thread and wxRuby on another. I wasted way too much time trying to get that to work, and am basically considering that avenue of investigation closed (if you're really interested in the gory details I can provide them, but I think it boils down to a problem with having non-Ruby code in both threads interacting badly with the GIL.) My current approach, then, is to keep it all in one thread: open the dialog, start the process, and keep the UI responsive by periodically calling Wx::get_app().yield. This all works great, except that I'm currently having to use a timer event to get my code started once the modal dialog is displayed, and it seems like there should be a less-hacky solution. Anyway, I hope that's enough background on what I'm trying to accomplish here. If it spurs any additional ideas, I'd love to hear them. Ben From lists at ruby-forum.com Sun Sep 27 09:21:29 2009 From: lists at ruby-forum.com (Anton Maminov) Date: Sun, 27 Sep 2009 15:21:29 +0200 Subject: [wxruby-users] wxRuby 2.0.1 on Ubuntu 9.10 In-Reply-To: References: <61c507640909102017s3a23f278oc24a20af6f668d4d@mail.gmail.com> Message-ID: <41ce0aaadd809d434d29f44300972fc3@ruby-forum.com> On Ubuntu 9.10 with ruby 1.8.6 and 1.9.1 /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so: symbol _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference - /var/lib/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so (LoadError) /opt/ruby191/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-linux/lib/wx.rb:12:in `require': /opt/ruby191/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-linux/lib/wxruby2.so: symbol _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference - /opt/ruby191/lib/ruby/gems/1.9.1/gems/wxruby-ruby19-2.0.1-x86-linux/lib/wxruby2.so (LoadError) -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Sep 29 15:18:14 2009 From: lists at ruby-forum.com (Alexander Ljungstrom) Date: Tue, 29 Sep 2009 21:18:14 +0200 Subject: [wxruby-users] Get_value problems and more, beginner. Message-ID: <6bbafbd750bf7254130f2ec037c652ff@ruby-forum.com> Hello! I have just got in to WxRuby and i already enjoy it alot. But i have some problem. I am doing a very simple port-scanner, very basic socket. "TCPSocket.open(ipaddress.chop, port)" - Like that. But now i want to do it graphical. So, my thought is the following. I have three fields, structured like this. http://i36.tinypic.com/107tf0w.png Then a 4th field to the right, where the output should be. But.. How can i take the values from my three fields. > Where i enter IP > Start-port-range > End-port-range Save them in variables, then do the portscan with them? I know that "get_value" exists. But i don't really know how to apply it. So. Short and consist. I have 3 fields where i ask for user input, i want to save the values in these fields in variables, then i will scan the target, and the output from the scan shall happen in the "large" field. Is that possible? :/ /Alexander -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Sep 29 16:24:59 2009 From: lists at ruby-forum.com (El Gato) Date: Tue, 29 Sep 2009 22:24:59 +0200 Subject: [wxruby-users] Button Event problem within Wizard Message-ID: <3f8b57ae6abbb8f52454c0ba6452acf3@ruby-forum.com> In the code below my panel1_impt button and panel1_dnld buttons don't trigger the button event. I'm banging my head against the table wondering what's going on. Can anyone advise? wizard = Wx::Wizard.new(self, :title => "Wizard") wizard.icon = Wx::Icon.new('wizard.ico') splash.destroy ########################################################## # Panel1, Masthead selection panel1 = Wx::WizardPageSimple.new(wizard) panel1_txt = Wx::StaticText.new(panel1, :label => "Select Site") panel1_lst = Wx::CheckListBox.new(panel1, :choices => files) panel1_btns = Wx::Panel.new(panel1) panel1_impt = Wx::Button.new(panel1_btns, :label => "Import") panel1_dnld = Wx::Button.new(panel1_btns, :label => "Download") panel1_btns.sizer = Wx::HBoxSizer.new panel1_btns.sizer.add(panel1_impt, 0, Wx::ALL, 5) panel1_btns.sizer.add(panel1_dnld, 0, Wx::ALL, 5) panel1.sizer = Wx::VBoxSizer.new panel1.sizer.add(panel1_txt, 0, Wx::ALL, 5) panel1.sizer.add(panel1_lst, 1, Wx::ALL|Wx::GROW, 5) panel1.sizer.add(panel1_btns, 0, Wx::ALL, 5) files.each_index {|i| panel1_lst.check(i, true)} # Panel1 Events evt_button(panel1_impt) {p "IMPORT!"} evt_button(panel1_dnld) {p "DOWNLOAD!"} -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Sep 29 17:48:33 2009 From: lists at ruby-forum.com (Peter Lane) Date: Tue, 29 Sep 2009 23:48:33 +0200 Subject: [wxruby-users] Get_value problems and more, beginner. In-Reply-To: <6bbafbd750bf7254130f2ec037c652ff@ruby-forum.com> References: <6bbafbd750bf7254130f2ec037c652ff@ruby-forum.com> Message-ID: Hi Alexander, Alexander Ljungstrom wrote: > So. Short and consist. > I have 3 fields where i ask for user input, i want to save the values in > these fields in variables, then i will scan the target, and the output > from the scan shall happen in the "large" field. > > Is that possible? :/ So long as you store a reference to the created TextCtrl field in a variable, you can get the value using 'get_value' The code below will display a text field and a button. When clicked, the button uses the 'get_value' method to retrieve the contents of the text field. ----- require 'wx' class MyFrame < Wx::Frame def initialize super(nil, :title => "Controls") text_field = Wx::TextCtrl.new(self) button = Wx::Button.new(self, :label => "Show Value") evt_button(button) {p "Value: #{text_field.get_value}"} main_sizer = Wx::BoxSizer.new Wx::VERTICAL main_sizer.add text_field main_sizer.add button set_sizer main_sizer end end Wx::App.run do MyFrame.new.show end ----- Does that help you move forward? regards, Peter. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Sep 30 06:54:12 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 30 Sep 2009 11:54:12 +0100 Subject: [wxruby-users] Print problem with Mac OS X cutting pages In-Reply-To: <1d8d4a860909291057hc02c23ckc420da8e0253f6ab@mail.gmail.com> References: <1d8d4a860909291057hc02c23ckc420da8e0253f6ab@mail.gmail.com> Message-ID: <4AC338D4.1020404@pressure.to> Hi Arno Dirlam wrote: > I am using the wxruby printing framework to print cash receipts with a > small thermo-printer, which can naturally produce very long pages if a > lot of articles are printed on them. > > Under Windows XP there are no problems, but under Mac OS X text is not > printed if it's below a certain line on the printed page (i.e. the > "top" parameter is too large). > > I have found out, however, that when I calculate the size of it, it is > exactly where a A4 page would end (just with different scaling), i.e. > after about 150% of the width of the page. I'm not very familiar with the printing framework, so it would help to see a short excerpt of the most relevant pieces of code just to know what classes you're using. More generally if there is a way to solve this (I expect there is) it will be general to wxWidgets and wxPython. So you might want to try searching for help but using the classnames with wx prefix (eg wxPrintout). I've often found answers to obscure questions via wxPython, simply because that framework has been around a lot longer. Also if it's a bug, it will have to be fixed in wxWidgets and won't be fixable in wxRuby alone. alex From alex at pressure.to Wed Sep 30 07:04:25 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 30 Sep 2009 12:04:25 +0100 Subject: [wxruby-users] Button Event problem within Wizard In-Reply-To: <3f8b57ae6abbb8f52454c0ba6452acf3@ruby-forum.com> References: <3f8b57ae6abbb8f52454c0ba6452acf3@ruby-forum.com> Message-ID: <4AC33B39.50100@pressure.to> El Gato wrote: > In the code below my panel1_impt button and panel1_dnld buttons don't > trigger the button event. I'm banging my head against the table > wondering what's going on. Can anyone advise? > panel1_impt = Wx::Button.new(panel1_btns, :label => "Import") > panel1_dnld = Wx::Button.new(panel1_btns, :label => "Download") > > > # Panel1 Events > evt_button(panel1_impt) {p "IMPORT!"} > evt_button(panel1_dnld) {p "DOWNLOAD!"} > Please, if you're going to post code, reduce it to the bare minimum that shows the problem, and make it runnable. There is nothing wrong with your event handling code itself. Things to consider: - are you calling Wizard#run_wizard to show the panel? - is output buffering on in the terminal in which you're running the application - in which case the output might not show straight away? alex From lists at ruby-forum.com Wed Sep 30 09:20:57 2009 From: lists at ruby-forum.com (El Gato) Date: Wed, 30 Sep 2009 15:20:57 +0200 Subject: [wxruby-users] Button Event problem within Wizard In-Reply-To: <4AC33B39.50100@pressure.to> References: <3f8b57ae6abbb8f52454c0ba6452acf3@ruby-forum.com> <4AC33B39.50100@pressure.to> Message-ID: <9c4d12a84ae14c36730f09bee7269bf1@ruby-forum.com> I guess the problem with reducing the code is that I have no idea what the problem is, so I'm not really sure what not to show -- it's possible that some non-button item is the culprit. I didn't really think that my event code was bad. Here's a full program that shows the issue. #!/usr/bin/env rubyw require 'wx' $stdout.sync = true class AppWizard < Wx::Frame def initialize(*args) super wizard = Wx::Wizard.new(self, :title => "App Wizard") panel1 = Wx::WizardPageSimple.new(wizard) panel1_txt = Wx::StaticText.new(panel1, :label => "Panel 1:") panel1_lst = Wx::CheckListBox.new(panel1, :choices => ["one", "two", "three"]) # This event never triggers when the button is clicked panel1_impt = Wx::Button.new(panel1, :label => "Import") evt_button(panel1_impt) {puts "You clicked the import button"} panel1.sizer = Wx::VBoxSizer.new panel1.sizer.add(panel1_txt, 0, Wx::ALL, 5) panel1.sizer.add(panel1_lst, 1, Wx::ALL|Wx::GROW, 5) panel1.sizer.add(panel1_impt, 0, Wx::ALL, 5) wizard.set_page_size(Wx::Size.new(500,300)) wizard.run_wizard(panel1) end end class App < Wx::App def on_init frame = AppWizard.new frame.show(false) end end app = App.new app.main_loop() -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 30 09:50:45 2009 From: lists at ruby-forum.com (Peter Lane) Date: Wed, 30 Sep 2009 15:50:45 +0200 Subject: [wxruby-users] Button Event problem within Wizard In-Reply-To: <9c4d12a84ae14c36730f09bee7269bf1@ruby-forum.com> References: <3f8b57ae6abbb8f52454c0ba6452acf3@ruby-forum.com> <4AC33B39.50100@pressure.to> <9c4d12a84ae14c36730f09bee7269bf1@ruby-forum.com> Message-ID: <3fa65d9b4707d83af32bba1a7b31eb2a@ruby-forum.com> El Gato wrote: > I guess the problem with reducing the code is that I have no idea what > the problem is, so I'm not really sure what not to show -- it's possible > that some non-button item is the culprit. I didn't really think that my > event code was bad. Here's a full program that shows the issue. > # This event never triggers when the button is clicked > panel1_impt = Wx::Button.new(panel1, :label => "Import") > evt_button(panel1_impt) {puts "You clicked the import button"} wizard.evt_button(panel1_impt) {puts "You clicked the import button"} Does the trick for me. best, Peter. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Sep 30 10:30:14 2009 From: alex at pressure.to (Alex Fenton) Date: Wed, 30 Sep 2009 15:30:14 +0100 Subject: [wxruby-users] Button Event problem within Wizard In-Reply-To: <3fa65d9b4707d83af32bba1a7b31eb2a@ruby-forum.com> References: <3f8b57ae6abbb8f52454c0ba6452acf3@ruby-forum.com> <4AC33B39.50100@pressure.to> <9c4d12a84ae14c36730f09bee7269bf1@ruby-forum.com> <3fa65d9b4707d83af32bba1a7b31eb2a@ruby-forum.com> Message-ID: <4AC36B76.6030800@pressure.to> Peter Lane wrote: > El Gato wrote: > >> # This event never triggers when the button is clicked >> panel1_impt = Wx::Button.new(panel1, :label => "Import") >> evt_button(panel1_impt) {puts "You clicked the import button"} >> > > wizard.evt_button(panel1_impt) {puts "You clicked the import button"} > Thanks Peter. By way of explanation, this is because CommandEvents - those associated with standard controls like Button, CheckBox, ToggleButton etc - bubble upwards through the window hierarchy UNTIL they reach a top-level window. Each window has a chance to process it. So in the example, the Button event gets offered to the Button (then) the Panel (then) the Wizard (a top-level window) But in the original evt_button was called on "self", the Frame. The button event never reaches that Frame it so the event handler isn't ever triggered. Calling wizard.evt_button sets it on the Wizard instead. Encapsulating GUI classes by inheritance tends to help avoid this mix-up (class DownloadWizard < Wx::Wizard ...) hth alex From lists at ruby-forum.com Wed Sep 30 10:30:48 2009 From: lists at ruby-forum.com (El Gato) Date: Wed, 30 Sep 2009 16:30:48 +0200 Subject: [wxruby-users] Button Event problem within Wizard In-Reply-To: <3fa65d9b4707d83af32bba1a7b31eb2a@ruby-forum.com> References: <3f8b57ae6abbb8f52454c0ba6452acf3@ruby-forum.com> <4AC33B39.50100@pressure.to> <9c4d12a84ae14c36730f09bee7269bf1@ruby-forum.com> <3fa65d9b4707d83af32bba1a7b31eb2a@ruby-forum.com> Message-ID: <24e88598909246ffaa1fa77b59b1e460@ruby-forum.com> Peter Lane wrote: > > wizard.evt_button(panel1_impt) {puts "You clicked the import button"} > > Does the trick for me. > > best, > > Peter. It does indeed! Thanks very much! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Sep 30 20:50:19 2009 From: lists at ruby-forum.com (nick ger) Date: Thu, 1 Oct 2009 02:50:19 +0200 Subject: [wxruby-users] rupyscript2exe for Mac / Linux and good tutorial Message-ID: <5ce82b3b350d79abc00597f8a7e149a6@ruby-forum.com> Hi, all I was wondering if somebody can recommend 2 things: 1) An alternative for rubyscript2exe for Mac / Linux. It would be really nice if there was a unified way to "compile" quote on quote a wxruby app into an executable/installer for Mac and Linux. ( I know Mac comes with Ruby pre-installed, but what if I need to use specific gems, that are not in the standard distribution of ruby? Or s specific version? Also most Linux flavors don't have Ruby preinstalled) 2) Can somebody recommend good tutorials for creating executables / installers for each platform. I found some stuff for Windows and rubyscript2exe doc is pretty thorough, but I can't find anything for other platforms. I may be asking a lot - if so tell me :-) I'm a newbie to GUI development - I was doing cli scripting and web development for the past 10 years ( and some Java GUI long time ago in school). But recently I came across RealBasic ( which is a commercial language and has a paid-for IDE), but it's very easy to compile ready apps for all three platforms. I love Ruby - and it's my language of choice for web development and I was hoping it could stay so for desktop app development :-) Thanks -- Posted via http://www.ruby-forum.com/.