From paul.allton at uk.bnpparibas.com Mon Apr 2 07:04:12 2007 From: paul.allton at uk.bnpparibas.com (paul.allton at uk.bnpparibas.com) Date: Mon, 2 Apr 2007 12:04:12 +0100 Subject: [Wxruby-users] Test driving WxRuby2 apps Message-ID: Apologies, I think the gem attachment may have been stripped from my original mail, so I've uploaded it to rubyforge under a new 'wxextra's project: http://rubyforge.org/projects/wxextras/ (direct link: http://rubyforge.org/frs/download.php/19183/nobbie-wx-preview-0.0.1.gem) p. ============================================================ Before I forget, thanks for the new 0.0.39 and wx_sugar releases, excellent work guys - its great to see the back of GC.disable ;) I've been a bit tied up recently, so apologies that this topic has gone quiet ... but I just wanted to let you know that this isn't dead, in fact I've packaged up what I have so far into the attached gem. Please note: - wxruby2-preview 0.0.39 and wx_sugar 0.1.14 are required - this is very much a preview, it basically works - except for the problems listed in 'KNOWN ISSUES'. - component support is a bit thin right now, I've only added support for what I've needed to test an application that I'm currently building - it works on Windows and OS X only, as I've no means to test on other platforms. - its based on an generic GUI driving api called 'Nobbie', which is a very silly name, I won't bore you with the history of how it came about For usage info, please look at the README page of the gems rdoc ... but here is a quick example: require 'rubygems' require_gem 'nobbie-wx-preview' require 'your_application' #important - tell nobbie which application you want to test APPLICATION_UNDER_TEST = YourApp.new class YourAppTest < Test::Unit::TestCase def test_something_really_important assert !enabled?(:save) type 'fred', :first_name choosable(:male).choose selection(:title).choose 'Mr' assert enabled?(:save) click :save end end For more examples look at the 'test' directory under the gem install. Note that if you run all_tests.rb, some of the tests will currently fail (depending on platform), these tests expose some of the problems highlighted in 'KNOWN ISSUES'. p. This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. ********************************************************************************************** BNP Paribas Private Bank London Branch is authorised by CECEI & AMF and is regulated by the Financial Services Authority for the conduct of its investment business in the United Kingdom. BNP Paribas Securities Services London Branch is authorised by CECEI & AMF and is regulated by the Financial Services Authority for the conduct of its investment business in the United Kingdom. BNP Paribas Fund Services UK Limited is authorised and regulated by the Financial Services Authority -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070402/28359ff8/attachment-0001.html From alex at pressure.to Mon Apr 2 07:38:19 2007 From: alex at pressure.to (Alex Fenton) Date: Mon, 02 Apr 2007 12:38:19 +0100 Subject: [Wxruby-users] Test driving WxRuby2 apps In-Reply-To: References: Message-ID: <4610EB2B.3020500@pressure.to> Hi Paul paul.allton at uk.bnpparibas.com wrote: > I've been a bit tied up recently, so apologies that this topic has > gone quiet ... but I just wanted to let you know that this isn't dead, > in fact I've packaged up what I have so far into the attached gem. Thanks very much for posting this - haven't had a decent spell of free time, but I'm looking forward to trying it out. On one of your known issues - how to test if a ComboBox is readonly: ( cb.get_window_style & Wx::CB_READONLY ).nonzero? This is pretty ugly, so I'm going to add a has_style? method to WxSugar cheers alex From paul.allton at uk.bnpparibas.com Tue Apr 3 13:13:12 2007 From: paul.allton at uk.bnpparibas.com (paul.allton at uk.bnpparibas.com) Date: Tue, 3 Apr 2007 18:13:12 +0100 Subject: [Wxruby-users] Test driving WxRuby2 apps In-Reply-To: <4610EB2B.3020500@pressure.to> Message-ID: >Thanks very much for posting this - haven't had a decent spell of free >time, but I'm looking forward to trying it out. No probs, I've used it on a couple of apps and I'm finding it stable/useful. Please let me know how you get on with it (good and bad!) >On one of your known issues - how to test if a ComboBox is readonly: >( cb.get_window_style & Wx::CB_READONLY ).nonzero? > This is pretty ugly, so I'm going to add a has_style? method to WxSugar Thanks for that for the style tip, that fixes one of the broken tests. I'll upload an updated gem when I get round to it. The sugar would be nice, is there a argument for adding ComboBox.is_read_only? Given that the docs state ComboBox.set_value() should ignore values not present in the choices, should I raise a bug for it (or are the docs incorrect?). p. This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. ********************************************************************************************** BNP Paribas Private Bank London Branch is authorised by CECEI & AMF and is regulated by the Financial Services Authority for the conduct of its investment business in the United Kingdom. BNP Paribas Securities Services London Branch is authorised by CECEI & AMF and is regulated by the Financial Services Authority for the conduct of its investment business in the United Kingdom. BNP Paribas Fund Services UK Limited is authorised and regulated by the Financial Services Authority -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070403/26aee1c0/attachment.html From ac251404 at ohio.edu Tue Apr 3 16:13:49 2007 From: ac251404 at ohio.edu (Alex Ciarlillo) Date: Tue, 03 Apr 2007 16:13:49 -0400 Subject: [Wxruby-users] CalendarCtrl.date not working? Message-ID: <4612B57D.7030209@ohio.edu> I finally got my CheckListBoxes under control (thanks Alex& Phil) and have moved on to tackling the CalendatCtrl. This one seemed pretty easy when I was reading through the documentation but I cannot retrieve the selected date. I have the following code: def initialize... ... @calendar = panel.add(Wx::CalendarCtrl[]) panel.add(Wx::Button[:label => 'test']) do |@button| listen(:button, @button, :on_b) end end def on_b date = @calendar.date puts date end And I am getting the following error(s): c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accessors.rb:53:in ` initialize': wrong number of arguments (6 for 0) (ArgumentError) from c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accesso rs.rb:53:in `new' from c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accesso rs.rb:53:in `get_date' from c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accesso rs.rb:53:in `send' from c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accesso rs.rb:53:in `method_missing' from C:/ruby/work/wxtest/test.rb:73:in `on_b' .... .... I went looking in accessors.rb to see if I could figure anything out but I got nothing. meth seems to be fine (get_date), but *args is [0 1 2 3 4 5]. That part looked odd to me, that it had 6 args (which is the error), but I'm not sure where they are coming from. Any ideas? thanks, -alex c. From alex at pressure.to Tue Apr 3 17:23:28 2007 From: alex at pressure.to (Alex Fenton) Date: Tue, 03 Apr 2007 22:23:28 +0100 Subject: [Wxruby-users] CalendarCtrl.date not working? In-Reply-To: <4612B57D.7030209@ohio.edu> References: <4612B57D.7030209@ohio.edu> Message-ID: <4612C5D0.3070606@pressure.to> Alex Ciarlillo wrote: > I finally got my CheckListBoxes under control (thanks Alex& Phil) and > have moved on to tackling the CalendatCtrl. This one seemed pretty easy > when I was reading through the documentation but I cannot retrieve the > selected date. > I haven't looked at this before, but does it help if you add require 'date' at the top of your script? > def initialize... > ... > @calendar = panel.add(Wx::CalendarCtrl[]) > [ You can just say panel.add(Wx::CalendarCtrl) ] > I went looking in accessors.rb to see if I could figure anything out but > I got nothing. meth seems to be fine (get_date), but *args is [0 1 2 3 4 > 5]. That part looked odd to me, that it had 6 args (which is the error), > but I'm not sure where they are coming from. > I think it's coming from one of SWIG's internal typemaps between WxWidgets and Ruby classes. In this case it should be converting wxDateTime to a ruby DateTime object. But I'm not sure if it's quite right - let us know how it goes. alex From pnomolos at gmail.com Tue Apr 3 17:29:32 2007 From: pnomolos at gmail.com (Philip Schalm) Date: Tue, 3 Apr 2007 14:29:32 -0700 Subject: [Wxruby-users] CalendarCtrl.date not working? In-Reply-To: <4612B57D.7030209@ohio.edu> References: <4612B57D.7030209@ohio.edu> Message-ID: <39e69c8e0704031429l2b9b56qeba9c239e5e44b5b@mail.gmail.com> Hi Alex, Could you possibly post your entire file? I've pulled out what you have and am unable to reproduce your error (what platform are you on, btw?) Thanks, Phil On 4/3/07, Alex Ciarlillo wrote: > I finally got my CheckListBoxes under control (thanks Alex& Phil) and > have moved on to tackling the CalendatCtrl. This one seemed pretty easy > when I was reading through the documentation but I cannot retrieve the > selected date. I have the following code: > > def initialize... > ... > @calendar = panel.add(Wx::CalendarCtrl[]) > panel.add(Wx::Button[:label => 'test']) do |@button| > listen(:button, @button, :on_b) > end > end > > def on_b > date = @calendar.date > puts date > end > > > And I am getting the following error(s): > > c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accessors.rb:53:in > ` > initialize': wrong number of arguments (6 for 0) (ArgumentError) > from > c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accesso > rs.rb:53:in `new' > from > c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accesso > rs.rb:53:in `get_date' > from > c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accesso > rs.rb:53:in `send' > from > c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/accesso > rs.rb:53:in `method_missing' > from C:/ruby/work/wxtest/test.rb:73:in `on_b' > .... > .... > > > I went looking in accessors.rb to see if I could figure anything out but > I got nothing. meth seems to be fine (get_date), but *args is [0 1 2 3 4 > 5]. That part looked odd to me, that it had 6 args (which is the error), > but I'm not sure where they are coming from. > > Any ideas? > > thanks, > -alex c. > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- -Phil <>< From alex at pressure.to Tue Apr 3 17:43:10 2007 From: alex at pressure.to (Alex Fenton) Date: Tue, 03 Apr 2007 22:43:10 +0100 Subject: [Wxruby-users] wxSugar 0.1.15 released Message-ID: <4612CA6E.5060308@pressure.to> Hi WxSugar 0.1.15 is now available via gems and download from rubyforge. This is a minor feature release which adds a couple of new facilities: * enumerable_controls: treats ListCtrl and ControlWithItems classes, such as ComboBox, ListBox, CheckListBox as Ruby enumerables * adds Window#has_style? The former is meant to give much more rubyish access to the contents of GUI controls which present the user with a list of item to choose from: # basic iteration listbox.each { | i | puts listbox.string(i) } # iterate with string labels listbox.each | i, string, data | puts "Item #{string} is at position #{i}, and has client data #{data}" end # access strings and item data as arrays puts listbox.strings[1] # Retrieve the label at position 1 # add a string listbox << 'foo' # search list contents idx = listbox.index('foo') # finds the position of the item labelled 'foo' idx = listbox.index(foo) # find the position of the item with data foo # enumerable methods listbox.select { | i | listbox.checked?(i) } These are meant as experimental methods - feedback welcome. a From pnomolos at gmail.com Tue Apr 3 17:47:23 2007 From: pnomolos at gmail.com (Philip Schalm) Date: Tue, 3 Apr 2007 14:47:23 -0700 Subject: [Wxruby-users] wxSugar 0.1.15 released In-Reply-To: <4612CA6E.5060308@pressure.to> References: <4612CA6E.5060308@pressure.to> Message-ID: <39e69c8e0704031447m5041e044x6f975abf40502149@mail.gmail.com> Woot on enumerable_controls, that's going to make my life way easier :) On 4/3/07, Alex Fenton wrote: > Hi > > WxSugar 0.1.15 is now available via gems and download from rubyforge. > > This is a minor feature release which adds a couple of new facilities: > > * enumerable_controls: treats ListCtrl and ControlWithItems classes, > such as ComboBox, ListBox, CheckListBox as Ruby enumerables > * adds Window#has_style? > > The former is meant to give much more rubyish access to the contents of > GUI controls which present the user with a list of item to choose from: > > # basic iteration > listbox.each { | i | puts listbox.string(i) } > > # iterate with string labels > listbox.each | i, string, data | > puts "Item #{string} is at position #{i}, and has client data #{data}" > end > > # access strings and item data as arrays > puts listbox.strings[1] # Retrieve the label at position 1 > > # add a string > listbox << 'foo' > > # search list contents > idx = listbox.index('foo') # finds the position of the item labelled 'foo' > idx = listbox.index(foo) # find the position of the item with data foo > > # enumerable methods > listbox.select { | i | listbox.checked?(i) } > > These are meant as experimental methods - feedback welcome. > > a > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- -Phil <>< From paul.allton at uk.bnpparibas.com Wed Apr 4 07:45:41 2007 From: paul.allton at uk.bnpparibas.com (paul.allton at uk.bnpparibas.com) Date: Wed, 4 Apr 2007 12:45:41 +0100 Subject: [Wxruby-users] wx layout with sugar Message-ID: I'm sure this will be user error on my part, but I can't seem to get the following to layout properly. Basically, I want the p1 to fill the available space and p2 to be as small as possible (with the root panel filling all the available space). With the following code, the buttons in the p2 end up being truncated, (i.e. the bottom line is missing). Where am I going wrong? add(Panel, :proportion => 1) {|p| p.arrange_vertically(:padding => 5) p.add(Panel, :proportion => 1) {|p1| p1.arrange_vertically(:padding => 5) @history = p1.add(Choice, :minsize => true) @input = p1.add(TextCtrl[:style => TE_MULTILINE], :proportion => 1) } p.add(Panel, :proportion => 0) {|p2| p2.arrange_horizontally(:padding => 5) @eval = p2.add(Button[:label => 'eval']) @clear_context = p2.add(Button[:label => 'clear context']) } } Incidently, it would be cool if sugar allowed applications to register default styles (:padding etc) for component types p. This message and any attachments (the "message") is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. ********************************************************************************************** BNP Paribas Private Bank London Branch is authorised by CECEI & AMF and is regulated by the Financial Services Authority for the conduct of its investment business in the United Kingdom. BNP Paribas Securities Services London Branch is authorised by CECEI & AMF and is regulated by the Financial Services Authority for the conduct of its investment business in the United Kingdom. BNP Paribas Fund Services UK Limited is authorised and regulated by the Financial Services Authority -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070404/e681c57f/attachment-0001.html From caoyangruby at gmail.com Wed Apr 4 23:05:40 2007 From: caoyangruby at gmail.com (yang cao) Date: Thu, 5 Apr 2007 11:05:40 +0800 Subject: [Wxruby-users] how to use Chinese Characters in wxRuby? In-Reply-To: References: <460E6C24.8040900@gmail.com> Message-ID: yes,I'm using wxruby2 When I change "samples/text/unicode.rb" 's content: require 'wx' into begin require 'wx' rescue LoadError => no_wx_err begin require 'rubygems' require 'wx' rescue LoadError raise no_wx_err end end and run unicode.rb in this way: ruby -Ku unicode.rb I got the error message like this: unicode.rb:119: syntax error, unexpected tCONSTANT, expecting ')' fd = Wx::FileDialog.new( nil, 'Import file', "", "", ^ unicode.rb:128: warning: parenthesize argument(s) for future version unicode.rb:128: syntax error, unexpected tCONSTANT, expecting kEND Wx::MessageDialog.new(self, message, 'Wrong encoding', ^ and more ... all the string cause error. how can I do? Thanks 2007/4/2, Alex Fenton : > yang cao wrote: > > I want to use Chinese characters in wxRuby,like this: > > Wx::Button.new(@panel,-1,'Chinese characters wanted to be placed') > > also in Chinese is: > > Wx::Button.new(@panel,-1,'??') > > Assuming you're using wxruby2, which you should be, ensure that your script is in UTF8 encoding, and that you have $KCODE = 'u' at the top of it. > > Have a look at the demo samples/text/unicode.rb which demonstrates the use of controls with labels and content in numerous different scripts including Chinese. > > The wxruby-users mailing list is a good place for any questions about the toolkit: > http://rubyforge.org/mail/?group_id=35 > > alex > > From caoyangruby at gmail.com Wed Apr 4 23:07:56 2007 From: caoyangruby at gmail.com (yang cao) Date: Thu, 5 Apr 2007 11:07:56 +0800 Subject: [Wxruby-users] how to use Chinese Characters in wxRuby? In-Reply-To: References: <460E6C24.8040900@gmail.com> Message-ID: this is my ruby version: ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] thanks 2007/4/5, yang cao : > yes,I'm using wxruby2 > When I change > "samples/text/unicode.rb" 's content: > > require 'wx' > > into > > begin > require 'wx' > rescue LoadError => no_wx_err > begin > require 'rubygems' > require 'wx' > rescue LoadError > raise no_wx_err > end > end > > and run unicode.rb in this way: > ruby -Ku unicode.rb > I got the error message like this: > > unicode.rb:119: syntax error, unexpected tCONSTANT, expecting ')' > fd = Wx::FileDialog.new( nil, 'Import file', "", "", > ^ > unicode.rb:128: warning: parenthesize argument(s) for future version > unicode.rb:128: syntax error, unexpected tCONSTANT, expecting kEND > Wx::MessageDialog.new(self, message, 'Wrong encoding', > ^ > and more ... > > all the string cause error. > how can I do? Thanks > > 2007/4/2, Alex Fenton : > > yang cao wrote: > > > I want to use Chinese characters in wxRuby,like this: > > > Wx::Button.new(@panel,-1,'Chinese characters wanted to be placed') > > > also in Chinese is: > > > Wx::Button.new(@panel,-1,'??') > > > > Assuming you're using wxruby2, which you should be, ensure that your script is in UTF8 encoding, and that you have $KCODE = 'u' at the top of it. > > > > Have a look at the demo samples/text/unicode.rb which demonstrates the use of controls with labels and content in numerous different scripts including Chinese. > > > > The wxruby-users mailing list is a good place for any questions about the toolkit: > > http://rubyforge.org/mail/?group_id=35 > > > > alex > > > > > From roys at mindspring.com Thu Apr 5 15:35:16 2007 From: roys at mindspring.com (Roy Sutton) Date: Thu, 05 Apr 2007 15:35:16 -0400 Subject: [Wxruby-users] How does WxRuby work ?? In-Reply-To: <20070405094910.11697194.wim.vanderschelden@gmail.com> References: <3f0a1b9f3dcbb23927fcd37e1ea49cdc@ruby-forum.com> <20070405094910.11697194.wim.vanderschelden@gmail.com> Message-ID: <46154F74.2050902@mindspring.com> Wim Vander Schelden wrote: > The way ruby interfaces with native libraries (such as wxWidgets) is very similar to a compiled program. You have to You already need to have wxWidgets installed, if I'm not mistaken, preferably in you C:\Windows\system32 directory. > On Windows, at least, wxWidgets does not need to be installed. It is compiled into the gem. On Linux, you need GTK+ installed. Others will have to comment on Mac. We do have a mailing list for wxRuby questions. You'll get good answers here: http://rubyforge.org/mail/?group_id=35 Roy From alex at pressure.to Fri Apr 6 06:01:22 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 06 Apr 2007 11:01:22 +0100 Subject: [Wxruby-users] wx layout with sugar In-Reply-To: References: Message-ID: <46161A72.3010109@pressure.to> paul.allton at uk.bnpparibas.com wrote: > Basically, I want the p1 to fill the available space and p2 to be as > small as possible (with the root panel filling all the available > space). With the following code, the buttons in the p2 end up being > truncated, (i.e. the bottom line is missing). The problem I think is that the second panel has no implicit minimum size, so the superior sizer doesn't apportion it any space. You can fix it two ways. One is to dispense with the second subsidiary panel, and attach the buttons directly to the main panel, but within a arrange_horizontally block. It'll then nest the horizontal sizer within the main one. Alternatively, you can tell the second panel to have a minimum size to fit the buttons. This emulates the set_sizer_and_fit call in plain wxRuby. p.add(Panel) do |p2| p2.arrange_horizontally(:padding => 5) do | siz | @eval = p2.add(Button[:label => 'eval']) @clear_context = p2.add(Button[:label => 'clear context']) p2.min_size = siz.min_size end end Honestly, this surprised me a bit too. > Incidently, it would be cool if sugar allowed applications to register > default styles (:padding etc) for component types Yes, I think it would help make applications look consistent, but I'm not really sure yet what the interface should look like. a From alex at pressure.to Fri Apr 6 06:32:35 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 06 Apr 2007 11:32:35 +0100 Subject: [Wxruby-users] how to use Chinese Characters in wxRuby? In-Reply-To: References: <460E6C24.8040900@gmail.com> Message-ID: <461621C3.20703@pressure.to> Hi yang cao wrote: > yes,I'm using wxruby2 > When I change > "samples/text/unicode.rb" 's content: > > Does the sample work if you don't edit it? Try running the original sample with ruby -rubygems samples/text/unicode.rb > and run unicode.rb in this way: > ruby -Ku unicode.rb > You don't need to run it with -Ku - the sample should be setting $KCODE = 'u' itself. > I got the error message like this: > > unicode.rb:119: syntax error, unexpected tCONSTANT, expecting ')' > fd = Wx::FileDialog.new( nil, 'Import file', "", "", > ^ > unicode.rb:128: warning: parenthesize argument(s) for future version > unicode.rb:128: syntax error, unexpected tCONSTANT, expecting kEND > Wx::MessageDialog.new(self, message, 'Wrong encoding', > ^ > and more ... > > all the string cause error. I wonder if perhaps the encoding of the script got changed when you edited it? wxRuby requires non-ASCII characters in scripts to be in UTF8. You could check whether the edited version is still valid UTF8 by doing: ruby -riconv -e 'Iconv.iconv("UTF-8", "UTF-8", File.read(ARGV[0]))' samples/text/unicode.rb If this raises an IllegalSequenceError, then the script isn't valid utf8. hth alex From alex at pressure.to Sun Apr 8 08:59:14 2007 From: alex at pressure.to (Alex Fenton) Date: Sun, 08 Apr 2007 13:59:14 +0100 Subject: [Wxruby-users] =?utf-8?q?=5Bnews-wxruby2---preview-0=2E0=2E39-rel?= =?utf-8?q?eased-=5D=5B20330=5D_probl=C3=A8me_de_police_dans_Traducteur-wx?= =?utf-8?q?ruby?= In-Reply-To: <20070406091123.230A252408FF@rubyforge.org> References: <20070406091123.230A252408FF@rubyforge.org> Message-ID: <4618E722.4020407@pressure.to> Bonjour sebastien bureaux wrote: > Bonjour, en fait quand j'ouvre un fichier texte, > par exemple, avec Traducteur-wxruby, la taille de > la police est normale jusqu'? un certain nombre de ligne, ensuite elle devient > toute petite. pourquoi? Je ne sais pas comment r?soudre le probl?me. > Il faut ? peu pr?s d?passer les 1000 lignes pour que la taille change. > Merci pour votre r?ponse > Je n'ai pas vue cette erreur moi-meme. Pouvez-vous nous donner quelques d?tails svp? - Est-ce que vous travaillez sur Windows, Linux ou OS X? - Vous vous servez de Wx::TextCtrl avec le style Wx::TE_MULTILINE pour montrer le fichier sur l'?cran? - Comment ouvrez-vous le fichier? Peut-?tre un ?chantillon court nous aiderait. Alex From ac251404 at ohio.edu Mon Apr 9 16:52:28 2007 From: ac251404 at ohio.edu (Alex Ciarlillo) Date: Mon, 09 Apr 2007 16:52:28 -0400 Subject: [Wxruby-users] GridTableBase problem Message-ID: <461AA78C.8050805@ohio.edu> Trying to setup a GridTableBase to hold some floating point numbers for a Grid. Getting an error with the following: table = Wx::GridTableBase.new Error: C:/ruby/work/wxtest/test.rb:151:in `on_find': uninitialized constant Wxruby2::Gr idTableBase (NameError) from c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/event_c onnector.rb:123:in `call' from c:/ruby/lib/ruby/gems/1.8/gems/wx_sugar-0.1.14/lib/wx_sugar/event_c onnector.rb:123:in `listen' Any ideas? Thanks, -Alex C. From alex at pressure.to Mon Apr 9 17:02:39 2007 From: alex at pressure.to (Alex Fenton) Date: Mon, 09 Apr 2007 22:02:39 +0100 Subject: [Wxruby-users] GridTableBase problem In-Reply-To: <461AA78C.8050805@ohio.edu> References: <461AA78C.8050805@ohio.edu> Message-ID: <461AA9EF.6000806@pressure.to> Alex Ciarlillo wrote: > Trying to setup a GridTableBase to hold some floating point numbers for > a Grid. Getting an error with the following: > > table = Wx::GridTableBase.new > I don't know of a class GridTableBase. there may be such an internal class in WxWidgets. In ruby you perhaps want to inherit from Wx::Grid? a From sean.m.long at gmail.com Mon Apr 9 18:22:43 2007 From: sean.m.long at gmail.com (Sean Long) Date: Mon, 9 Apr 2007 15:22:43 -0700 Subject: [Wxruby-users] GridTableBase problem In-Reply-To: <461AA9EF.6000806@pressure.to> References: <461AA78C.8050805@ohio.edu> <461AA9EF.6000806@pressure.to> Message-ID: According to the wxWidgets book on page 348, wxGridTableBase is: "A base class enabling an application to provide data to a virtual grid. An instance of a derived class plugs into wxGrid with SetTable." The pdf version of the wxWidgets book can be downloaded from the publisher here: http://www.phptr.com/bookstore/product.asp?isbn=0131473816&rl=1#info4 A very good source of info when the online documentation is a little thin, I bought the book a few years ago and find it very helpful for the not so ordinary wxWidgets tasks. Sean On 4/9/07, Alex Fenton wrote: > Alex Ciarlillo wrote: > > Trying to setup a GridTableBase to hold some floating point numbers for > > a Grid. Getting an error with the following: > > > > table = Wx::GridTableBase.new > > > > I don't know of a class GridTableBase. there may be such an internal > class in WxWidgets. In ruby you perhaps want to inherit from Wx::Grid? > > a > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From vinh.chuc at gmail.com Mon Apr 9 20:35:52 2007 From: vinh.chuc at gmail.com (Vinh CHUC) Date: Tue, 10 Apr 2007 02:35:52 +0200 Subject: [Wxruby-users] What does the end user need to run wxruby apps ? Message-ID: Hi ! I'm new to this mailing list ! I'm just beginning to learn ruby programmation, ( so far mainly coded php web apps, and math algorithms with Caml ), so i'm a noob about libraries, toolkits, etc .... I wondered what does the end user need to run wxruby applications ? _ On Windows, he'll need the ruby interpreter ( such as the one click ruby installer ), and via Rubygems, he has to install the wxruby.gem, that's all ?? the wxruby .gem package includes both the wxwidgets library itself and the "bridge" to ruby ??? _ on linux, same, the ruby interpreter & rubygems ( via apt-get / urpmi / yum ... ) and then to install the wxruby.gem ?? _ I also came across the 2 tools called "Tar2RubyScript", and "Rubyscript2exe", do these 2 utilities have support for wxruby ?? ( = is it possible to bundle the ruby inpreter, wxruby and all other dependencies in a single .exe ?? if yes do you have links to tutorials explaining how to do it thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070410/c86cfd4f/attachment-0001.html From alex at pressure.to Mon Apr 9 23:08:29 2007 From: alex at pressure.to (Alex Fenton) Date: Tue, 10 Apr 2007 04:08:29 +0100 Subject: [Wxruby-users] What does the end user need to run wxruby apps ? In-Reply-To: References: Message-ID: <461AFFAD.2050800@pressure.to> Hi Vinh CHUC wrote: > I wondered what does the end user need to run wxruby applications ? > On Windows and OS X, only the ruby and the wxruby gem is needed - it contains both the wxwidgets library and the bridge to ruby. It's similar on Linux, except the user must have libgtk2 library installed too. If they're using GNOME, this will already be installed; if they're using KDE or another WM, it should certainly be available in any distro via apt. Generally I think it's fair to say that wxRuby is one of the easiest ruby GUI toolkits to install on Windows and OS X. > _ I also came across the 2 tools called "Tar2RubyScript", and > "Rubyscript2exe", do these 2 utilities have support for wxruby ?? ( = > is it possible to bundle the ruby inpreter, wxruby and all other > dependencies in a single .exe ?? Yes, these tools should work well with wxRuby. Myself and others have used rubyscript2exe plus wxruby 0.6.0 to create end-user desktop applications (eg http://www.pressure.to/qda/). This can further be wrapped in an installer (eg http://nsis.sourceforge.net/Main_Page) to create a package that works like a 'normal' application. > if yes do you have links to tutorials explaining how to do it I haven't tried with wxruby2-preview, but I can't think of any reasons why the standard instructions (http://www.erikveen.dds.nl/rubyscript2exe/) shouldn't work. You might need to use the RUBYSCRIPT2EXE.appdir to find the location of support files such as help files or icons that are required by the app, but this is covered in the rubyscript2exe documentation. I agree it might make a nice topic for a wxruby tutorial - thanks for the suggestion - I'll try and do something about using wxruby2 and rubyscript2exe. cheers alex From vinh.chuc at gmail.com Tue Apr 10 09:33:51 2007 From: vinh.chuc at gmail.com (Vinh CHUC) Date: Tue, 10 Apr 2007 15:33:51 +0200 Subject: [Wxruby-users] What does the end user need to run wxruby apps ?&In-Reply-To=ede36c450704091735p610843b0oe872006e2bbd0fa1@mail.gmail.com Message-ID: thanks ! yes it would be cool if someone skilled could write a how-to about wxruby2 & rubyscript2exe here is a similar how-to, written for ruby-gnome & rubyscript2exe http://ruby-gnome2.sourceforge.jp/hiki.cgi?cmd=view&p=tips_rubyscript2exe&key=rubyscript2exe bye -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070410/2b7a2240/attachment.html From vinh.chuc at gmail.com Tue Apr 10 09:36:14 2007 From: vinh.chuc at gmail.com (Vinh CHUC) Date: Tue, 10 Apr 2007 15:36:14 +0200 Subject: [Wxruby-users] What does the end user need to run wxruby apps ? Message-ID: thanks ! yes it would be cool if someone skilled could write a how-to about wxruby2 & rubyscript2exe here is a similar how-to, written for ruby-gnome & rubyscript2exe http://ruby-gnome2.sourceforge.jp/hiki.cgi?cmd=view&p=tips_rubyscript2exe&key=rubyscript2exe bye -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070410/f7b5a300/attachment.html From music.soothes.the.soul at gmail.com Tue Apr 10 11:05:29 2007 From: music.soothes.the.soul at gmail.com (Paul CHUCKSON) Date: Tue, 10 Apr 2007 17:05:29 +0200 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) Message-ID: Hi everyone ! i can't make wxruby work on my debian box, i installed wxruby2preview with the gem command line tool but when i try to run one of the samples, i get this error message : dialogs.rb:1:in `require': no such file to load -- wxruby (LoadError) from dialogs.rb:1 i searched this mailing list a bit, i tried with the -rubygem argument, i get this error : /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- wxruby (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from dialogs.rb:1 then i tried with the ruby shell ( irb ), i entered require 'wx' then i get these errors LoadError: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.4' not found (required by /usr/lib/ruby/gems/1.8/gems/wxruby2-preview-0.0.39-i686-linux/lib/wxruby2.so) - /usr/lib/ruby/gems/1.8/gems/wxruby2-preview-0.0.39-i686-linux /lib/wxruby2.so from /usr/lib/ruby/gems/1.8/gems/wxruby2-preview-0.0.39-i686-linux /lib/wxruby2.so from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `require' from /usr/lib/ruby/gems/1.8/gems/wxruby2-preview-0.0.39-i686-linux /lib/wx.rb:12 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in `require' from (irb):3 i checked my apt-get package manager, i have libc6, libc6-dev installed, i don't know why i have these errors ( i did installed the linux-i686 version of wxruby not the windows or mac ones ) thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070410/1d1accfe/attachment.html From pnomolos at gmail.com Tue Apr 10 13:24:49 2007 From: pnomolos at gmail.com (Philip Schalm) Date: Tue, 10 Apr 2007 10:24:49 -0700 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: Message-ID: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> Debian sid provides glibc 2.3.6-1, so unfortunately you will be out of luck unless you feel like upgrading on your own (something I *do not* recommend - if you want to upgrade glibc you're probably better off just installing a different distro (if this is just a personal system, Ubuntu?)) On 4/10/07, Paul CHUCKSON wrote: > Hi everyone ! > i can't make wxruby work on my debian box, i installed wxruby2preview with > the gem command line tool > but when i try to run one of the samples, i get this error message : > > dialogs.rb:1:in `require': no such file to load -- wxruby (LoadError) > from dialogs.rb:1 > > i searched this mailing list a bit, i tried with the -rubygem argument, i > get this error : > > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- wxruby (LoadError) > from > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from dialogs.rb:1 > > then i tried with the ruby shell ( irb ), i entered > require 'wx' > then i get these errors > > LoadError: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.4' not found > (required by > /usr/lib/ruby/gems/1.8/gems/wxruby2-preview-0.0.39-i686-linux/lib/wxruby2.so) > - > /usr/lib/ruby/gems/1.8/gems/wxruby2-preview-0.0.39-i686-linux > /lib/wxruby2.so > from > /usr/lib/ruby/gems/1.8/gems/wxruby2-preview-0.0.39-i686-linux/lib/wxruby2.so > from > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in > `require' > from /usr/lib/ruby/gems/1.8/gems/wxruby2- > preview-0.0.39-i686-linux/lib/wx.rb:12 > from > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in > `gem_original_require' > from > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:32:in > `require' > from (irb):3 > > i checked my apt-get package manager, i have libc6, libc6-dev installed, i > don't know why i have these errors ( i did installed the linux-i686 version > of wxruby not the windows or mac ones ) > > thanks > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- -Phil <>< From alex at pressure.to Tue Apr 10 13:41:09 2007 From: alex at pressure.to (Alex Fenton) Date: Tue, 10 Apr 2007 18:41:09 +0100 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> Message-ID: <461BCC35.1000902@pressure.to> Hi Philip Schalm wrote: > Debian sid provides glibc 2.3.6-1, so unfortunately you will be out of > luck unless you feel like upgrading on your own (something I *do not* > recommend - if you want to upgrade glibc you're probably better off > just installing a different distro (if this is just a personal system, > Ubuntu?)) > As Philip says, the problem is that the wxruby gem is built on a system with a newer glibc than that provided by your distro. For info, it's built on the current stable release of Ubuntu. I understand there's recently (last few days) been a new stable release of Debian, which I would hope includes a newer glibc. Failing that, it is not too hard to compile wxRuby yourself on Linux - the wiki supplies fairly comprehensive instructions. cheers alex From pnomolos at gmail.com Tue Apr 10 13:46:34 2007 From: pnomolos at gmail.com (Philip Schalm) Date: Tue, 10 Apr 2007 10:46:34 -0700 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: <461BCC35.1000902@pressure.to> References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> Message-ID: <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> Right, good suggestion about just compiling wxRuby :) [I forgot that part, as I once tried to upgrade glibc on a system and my mind immediately went to the headache that was] By the way, the new release of Debian still does not include glibc 2.4, and I got the part about 2.3.6 wrong -> Debian provides glibc2.2 (the documentation version number is 2.3.6) On 4/10/07, Alex Fenton wrote: > Hi > > Philip Schalm wrote: > > Debian sid provides glibc 2.3.6-1, so unfortunately you will be out of > > luck unless you feel like upgrading on your own (something I *do not* > > recommend - if you want to upgrade glibc you're probably better off > > just installing a different distro (if this is just a personal system, > > Ubuntu?)) > > > As Philip says, the problem is that the wxruby gem is built on a system > with a newer glibc than that provided by your distro. For info, it's > built on the current stable release of Ubuntu. > > I understand there's recently (last few days) been a new stable release > of Debian, which I would hope includes a newer glibc. Failing that, it > is not too hard to compile wxRuby yourself on Linux - the wiki supplies > fairly comprehensive instructions. > > cheers > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- -Phil <>< From music.soothes.the.soul at gmail.com Tue Apr 10 16:24:20 2007 From: music.soothes.the.soul at gmail.com (Paul Anonymous) Date: Tue, 10 Apr 2007 22:24:20 +0200 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> Message-ID: then i'll try to compile wxruby :) thanks 2007/4/10, Philip Schalm : > > Right, good suggestion about just compiling wxRuby :) [I forgot that > part, as I once tried to upgrade glibc on a system and my mind > immediately went to the headache that was] > > By the way, the new release of Debian still does not include glibc > 2.4, and I got the part about 2.3.6 wrong -> Debian provides glibc2.2 > (the documentation version number is 2.3.6) > > On 4/10/07, Alex Fenton wrote: > > Hi > > > > Philip Schalm wrote: > > > Debian sid provides glibc 2.3.6-1, so unfortunately you will be out of > > > luck unless you feel like upgrading on your own (something I *do not* > > > recommend - if you want to upgrade glibc you're probably better off > > > just installing a different distro (if this is just a personal system, > > > Ubuntu?)) > > > > > As Philip says, the problem is that the wxruby gem is built on a system > > with a newer glibc than that provided by your distro. For info, it's > > built on the current stable release of Ubuntu. > > > > I understand there's recently (last few days) been a new stable release > > of Debian, which I would hope includes a newer glibc. Failing that, it > > is not too hard to compile wxRuby yourself on Linux - the wiki supplies > > fairly comprehensive instructions. > > > > cheers > > alex > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > -- > -Phil <>< > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070410/58512502/attachment-0001.html From music.soothes.the.soul at gmail.com Tue Apr 10 17:15:28 2007 From: music.soothes.the.soul at gmail.com (Paul Anonymous) Date: Tue, 10 Apr 2007 23:15:28 +0200 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> Message-ID: i just tried compiling wxruby, as explained on the website, i get these errors while compiling with rake : /usr/bin/ld: can't find -lwx_gtk2u_xrc-2.6 collect2: ld returned 1 exit status rake aborted! Command failed with status (1): [g++ -shared -fPIC -o -rdynamic -Wl,-expo...] i checked my apt-get, i have all those package installed : wx2.6-headers wx-common libwxbase2.6 libwxbase2.6-dev libwxgtk2.6 libwxgtk2.6-dev what did i do wrong ?? thanks again 2007/4/10, Philip Schalm : > > Right, good suggestion about just compiling wxRuby :) [I forgot that > part, as I once tried to upgrade glibc on a system and my mind > immediately went to the headache that was] > > By the way, the new release of Debian still does not include glibc > 2.4, and I got the part about 2.3.6 wrong -> Debian provides glibc2.2 > (the documentation version number is 2.3.6) > > On 4/10/07, Alex Fenton wrote: > > Hi > > > > Philip Schalm wrote: > > > Debian sid provides glibc 2.3.6-1, so unfortunately you will be out of > > > luck unless you feel like upgrading on your own (something I *do not* > > > recommend - if you want to upgrade glibc you're probably better off > > > just installing a different distro (if this is just a personal system, > > > Ubuntu?)) > > > > > As Philip says, the problem is that the wxruby gem is built on a system > > with a newer glibc than that provided by your distro. For info, it's > > built on the current stable release of Ubuntu. > > > > I understand there's recently (last few days) been a new stable release > > of Debian, which I would hope includes a newer glibc. Failing that, it > > is not too hard to compile wxRuby yourself on Linux - the wiki supplies > > fairly comprehensive instructions. > > > > cheers > > alex > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > -- > -Phil <>< > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070410/98c52d8e/attachment.html From sean.m.long at gmail.com Tue Apr 10 18:16:33 2007 From: sean.m.long at gmail.com (Sean Long) Date: Tue, 10 Apr 2007 15:16:33 -0700 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> Message-ID: Paul, I don't have a Linux machine right now but it looks like rake is looking for the unicode version of the XRC part of wxWidgets. I would check: 1) That you are in fact using the unicode build of wxWidgets 2) That the XRC part of the library is actually installed When I have used wxWidgets with Linux in the past I always compile wxWidgets myself, did not have much luck with the apt-get packages. Sean On 4/10/07, Paul Anonymous wrote: > i just tried compiling wxruby, as explained on the website, i get these > errors while compiling with rake : > > /usr/bin/ld: can't find -lwx_gtk2u_xrc-2.6 > collect2: ld returned 1 exit status > rake aborted! > Command failed with status (1): [g++ -shared -fPIC -o -rdynamic > -Wl,-expo...] > > i checked my apt-get, i have all those package installed : > wx2.6-headers > wx-common > libwxbase2.6 > libwxbase2.6-dev > libwxgtk2.6 > libwxgtk2.6-dev > > what did i do wrong ?? > thanks again > > > > 2007/4/10, Philip Schalm : > > Right, good suggestion about just compiling wxRuby :) [I forgot that > > part, as I once tried to upgrade glibc on a system and my mind > > immediately went to the headache that was] > > > > By the way, the new release of Debian still does not include glibc > > 2.4, and I got the part about 2.3.6 wrong -> Debian provides glibc2.2 > > (the documentation version number is 2.3.6) > > > > On 4/10/07, Alex Fenton wrote: > > > Hi > > > > > > Philip Schalm wrote: > > > > Debian sid provides glibc 2.3.6-1, so unfortunately you will be out of > > > > luck unless you feel like upgrading on your own (something I *do not* > > > > recommend - if you want to upgrade glibc you're probably better off > > > > just installing a different distro (if this is just a personal system, > > > > Ubuntu?)) > > > > > > > As Philip says, the problem is that the wxruby gem is built on a system > > > with a newer glibc than that provided by your distro. For info, it's > > > built on the current stable release of Ubuntu. > > > > > > I understand there's recently (last few days) been a new stable release > > > of Debian, which I would hope includes a newer glibc. Failing that, it > > > is not too hard to compile wxRuby yourself on Linux - the wiki supplies > > > fairly comprehensive instructions. > > > > > > cheers > > > alex > > > _______________________________________________ > > > wxruby-users mailing list > > > wxruby-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > > > > -- > > -Phil <>< > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From vinh.chuc at gmail.com Tue Apr 10 18:43:05 2007 From: vinh.chuc at gmail.com (Vinh CHUC) Date: Wed, 11 Apr 2007 00:43:05 +0200 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> Message-ID: the wxwidgets i use are the one provided by the debian repositories, i don't know if this is the unicode version or not .. i did some research, the xrc part of the library is included in the contrib-dev package that i just installed, but the error message remains ... if i want to compile wxwidgets by myself, woudn't that conflict with the wxwidgets .debs already installed ?( .deb required by some wxwidgets apps i already use ) i mean how can i replace the repository wxwidgets by the one i'll compile, without breaking my wxwidgets apps ?? or maybe is there a way to compile wxwidgets, that i don't install, and then i would tell rake to use this wxwidgets instead of my system's one ?? thanks 2007/4/11, Sean Long : > > Paul, > > I don't have a Linux machine right now but it looks like rake is > looking for the unicode version of the XRC part of wxWidgets. > > I would check: > > 1) That you are in fact using the unicode build of wxWidgets > 2) That the XRC part of the library is actually installed > > When I have used wxWidgets with Linux in the past I always compile > wxWidgets myself, did not have much luck with the apt-get packages. > > Sean > > On 4/10/07, Paul Anonymous wrote: > > i just tried compiling wxruby, as explained on the website, i get these > > errors while compiling with rake : > > > > /usr/bin/ld: can't find -lwx_gtk2u_xrc-2.6 > > collect2: ld returned 1 exit status > > rake aborted! > > Command failed with status (1): [g++ -shared -fPIC -o -rdynamic > > -Wl,-expo...] > > > > i checked my apt-get, i have all those package installed : > > wx2.6-headers > > wx-common > > libwxbase2.6 > > libwxbase2.6-dev > > libwxgtk2.6 > > libwxgtk2.6-dev > > > > what did i do wrong ?? > > thanks again > > > > > > > > 2007/4/10, Philip Schalm : > > > Right, good suggestion about just compiling wxRuby :) [I forgot that > > > part, as I once tried to upgrade glibc on a system and my mind > > > immediately went to the headache that was] > > > > > > By the way, the new release of Debian still does not include glibc > > > 2.4, and I got the part about 2.3.6 wrong -> Debian provides glibc2.2 > > > (the documentation version number is 2.3.6) > > > > > > On 4/10/07, Alex Fenton wrote: > > > > Hi > > > > > > > > Philip Schalm wrote: > > > > > Debian sid provides glibc 2.3.6-1, so unfortunately you will be > out of > > > > > luck unless you feel like upgrading on your own (something I *do > not* > > > > > recommend - if you want to upgrade glibc you're probably better > off > > > > > just installing a different distro (if this is just a personal > system, > > > > > Ubuntu?)) > > > > > > > > > As Philip says, the problem is that the wxruby gem is built on a > system > > > > with a newer glibc than that provided by your distro. For info, it's > > > > built on the current stable release of Ubuntu. > > > > > > > > I understand there's recently (last few days) been a new stable > release > > > > of Debian, which I would hope includes a newer glibc. Failing that, > it > > > > is not too hard to compile wxRuby yourself on Linux - the wiki > supplies > > > > fairly comprehensive instructions. > > > > > > > > cheers > > > > alex > > > > _______________________________________________ > > > > wxruby-users mailing list > > > > wxruby-users at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > > > > > > > > -- > > > -Phil <>< > > > _______________________________________________ > > > wxruby-users mailing list > > > wxruby-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > > > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070411/cee9c432/attachment.html From music.soothes.the.soul at gmail.com Tue Apr 10 19:50:43 2007 From: music.soothes.the.soul at gmail.com (Paul Anonymous) Date: Wed, 11 Apr 2007 01:50:43 +0200 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> Message-ID: i compiled wxwidgets, following the howto on the wxruby website, then i ran rake with the option --libdir=/pathtothenewlycompiledwxwidgets , i took twice as long as before to compile, and it ended on the same error ..... what should i do ?? thanks 2007/4/11, Vinh CHUC : > > the wxwidgets i use are the one provided by the debian repositories, i > don't know if this is the unicode version or not .. > i did some research, the xrc part of the library is included in the > contrib-dev package that i just installed, but the error message remains ... > > > if i want to compile wxwidgets by myself, woudn't that conflict with the > wxwidgets .debs already installed ?( .deb required by some wxwidgets apps i > already use ) > i mean how can i replace the repository wxwidgets by the one i'll compile, > without breaking my wxwidgets apps ?? > > or maybe is there a way to compile wxwidgets, that i don't install, and > then i would tell rake to use this wxwidgets instead of my system's one ?? > thanks > > > > 2007/4/11, Sean Long < sean.m.long at gmail.com>: > > > > Paul, > > > > I don't have a Linux machine right now but it looks like rake is > > looking for the unicode version of the XRC part of wxWidgets. > > > > I would check: > > > > 1) That you are in fact using the unicode build of wxWidgets > > 2) That the XRC part of the library is actually installed > > > > When I have used wxWidgets with Linux in the past I always compile > > wxWidgets myself, did not have much luck with the apt-get packages. > > > > Sean > > > > On 4/10/07, Paul Anonymous < music.soothes.the.soul at gmail.com> wrote: > > > i just tried compiling wxruby, as explained on the website, i get > > these > > > errors while compiling with rake : > > > > > > /usr/bin/ld: can't find -lwx_gtk2u_xrc- 2.6 > > > collect2: ld returned 1 exit status > > > rake aborted! > > > Command failed with status (1): [g++ -shared -fPIC -o -rdynamic > > > -Wl,-expo...] > > > > > > i checked my apt-get, i have all those package installed : > > > wx2.6-headers > > > wx-common > > > libwxbase2.6 > > > libwxbase2.6-dev > > > libwxgtk2.6 > > > libwxgtk2.6-dev > > > > > > what did i do wrong ?? > > > thanks again > > > > > > > > > > > > 2007/4/10, Philip Schalm < pnomolos at gmail.com>: > > > > Right, good suggestion about just compiling wxRuby :) [I forgot that > > > > part, as I once tried to upgrade glibc on a system and my mind > > > > immediately went to the headache that was] > > > > > > > > By the way, the new release of Debian still does not include glibc > > > > 2.4, and I got the part about 2.3.6 wrong -> Debian provides > > glibc2.2 > > > > (the documentation version number is 2.3.6) > > > > > > > > On 4/10/07, Alex Fenton wrote: > > > > > Hi > > > > > > > > > > Philip Schalm wrote: > > > > > > Debian sid provides glibc 2.3.6-1, so unfortunately you will be > > out of > > > > > > luck unless you feel like upgrading on your own (something I *do > > not* > > > > > > recommend - if you want to upgrade glibc you're probably better > > off > > > > > > just installing a different distro (if this is just a personal > > system, > > > > > > Ubuntu?)) > > > > > > > > > > > As Philip says, the problem is that the wxruby gem is built on a > > system > > > > > with a newer glibc than that provided by your distro. For info, > > it's > > > > > built on the current stable release of Ubuntu. > > > > > > > > > > I understand there's recently (last few days) been a new stable > > release > > > > > of Debian, which I would hope includes a newer glibc. Failing > > that, it > > > > > is not too hard to compile wxRuby yourself on Linux - the wiki > > supplies > > > > > fairly comprehensive instructions. > > > > > > > > > > cheers > > > > > alex > > > > > _______________________________________________ > > > > > wxruby-users mailing list > > > > > wxruby-users at rubyforge.org > > > > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > > > > > > > > > > > > -- > > > > -Phil <>< > > > > _______________________________________________ > > > > wxruby-users mailing list > > > > wxruby-users at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > > > > > > > > _______________________________________________ > > > wxruby-users mailing list > > > wxruby-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070411/bb76b39a/attachment-0001.html From alex at pressure.to Wed Apr 11 05:18:49 2007 From: alex at pressure.to (Alex Fenton) Date: Wed, 11 Apr 2007 10:18:49 +0100 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> Message-ID: <461CA7F9.6080904@pressure.to> Vinh CHUC wrote: > if i want to compile wxwidgets by myself, woudn't that conflict with > the wxwidgets .debs already installed ?( .deb required by some > wxwidgets apps i already use ) > i mean how can i replace the repository wxwidgets by the one i'll > compile, without breaking my wxwidgets apps ?? It shouldn't be a problem to have multiple versions of wxWidgets installed with different compile options. The designers of wxWidgets make this particularly easy on Linux and OS X, through the use of wx-config. This allows applications to compile against different installed versions. wxRuby currently will compile against the default install. You can find this out by running wx-config --list on the command line. For example, I've got seven different versions installed, and am currently working on the development branch of wxruby which targets 2.8 (0.0.39 targets 2.6). I get: SCIPIUS:~ alex$ wx-config --list Default config is mac-unicode-release-static-2.8 Default config will be used for output Alternate matches: mac-ansi-release-2.5 mac-ansi-release-static-2.5 mac-ansi-release-static-2.6 mac-unicode-debug-static-2.6 mac-unicode-release-static-2.6 mac-unicode-release-static-2.7 hth alex From alex at pressure.to Wed Apr 11 05:24:12 2007 From: alex at pressure.to (Alex Fenton) Date: Wed, 11 Apr 2007 10:24:12 +0100 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> Message-ID: <461CA93C.20603@pressure.to> Paul Anonymous wrote: > i compiled wxwidgets, following the howto on the wxruby website, then > i ran rake with the option > --libdir=/pathtothenewlycompiledwxwidgets , i took twice as long as > before to compile, and it ended on the same error ..... I think the --libdir argument will not be respected by rake - so I'd guess you are still compiling against the system's non-unicode version. > what should i do ?? I'd suggest installing the newly compiled unicode wxWidgets (make install)- it should be no problem to have multiple different versions installed in parallel. Before you run rake to compile wxruby, test that wx-config returns the correct configuration (i.e. gtk-unicode-release-static) hth alex From music.soothes.the.soul at gmail.com Wed Apr 11 09:52:17 2007 From: music.soothes.the.soul at gmail.com (Paul Anonymous) Date: Wed, 11 Apr 2007 15:52:17 +0200 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: <461CA93C.20603@pressure.to> References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> <461CA93C.20603@pressure.to> Message-ID: ok i'll try thanks again 2007/4/11, Alex Fenton : > > Paul Anonymous wrote: > > i compiled wxwidgets, following the howto on the wxruby website, then > > i ran rake with the option > > --libdir=/pathtothenewlycompiledwxwidgets , i took twice as long as > > before to compile, and it ended on the same error ..... > I think the --libdir argument will not be respected by rake - so I'd > guess you are still compiling against the system's non-unicode version. > > what should i do ?? > I'd suggest installing the newly compiled unicode wxWidgets (make > install)- it should be no problem to have multiple different versions > installed in parallel. > > Before you run rake to compile wxruby, test that wx-config returns the > correct configuration (i.e. gtk-unicode-release-static) > > hth > 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: http://rubyforge.org/pipermail/wxruby-users/attachments/20070411/28151a2f/attachment.html From music.soothes.the.soul at gmail.com Wed Apr 11 10:28:07 2007 From: music.soothes.the.soul at gmail.com (Paul Anonymous) Date: Wed, 11 Apr 2007 16:28:07 +0200 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> <461CA93C.20603@pressure.to> Message-ID: i intalled wxwidgets 2.8 static gtk unicode, the wx-config output is correct Default config is gtk2-unicode-release-static-2.8 Default config will be used for output but now i get different errors .... :'( : g++ -c -I/usr/local/lib/wx/include/gtk2-unicode-release-static-2.8-I/usr/local/include/wx- 2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -D__WXGTK__ -fno-strict-aliasing -O2 -fPIC -Wno-unused-function -I /usr/lib/r uby/1.8 -I /usr/lib/ruby/gems/1.8/gems/rake-0.7.2/bin -I /usr/lib/ruby/gems/1.8/gems/rake-0.7.2/lib -I /usr/local/lib/s ite_ruby/1.8 -I /usr/local/lib/site_ruby/1.8/i486-linux -I /usr/local/lib/site_ruby/1.8/i386-linux -I /usr/local/lib/si te_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i486-linux -I /usr/lib/ruby/1.8/i386-linux -I . -I /home/chucky/Deskt op/temp/wxruby2/doc/lib -o obj/CheckListBox.o src/CheckListBox.cpp src/CheckListBox.h:35: error: conflicting return type specified for 'virtual int SwigDirector_wxCheckListBox::GetCount( ) const' /usr/local/include/wx-2.8/wx/gtk/listbox.h:68: error: overriding 'virtual unsigned int wxListBox::GetCount() const' src/CheckListBox.cpp: In function 'VALUE _wrap_wxCheckListBox_HitTest__SWIG_1(int, VALUE*, VALUE)': src/CheckListBox.cpp:3348: error: no matching function for call to 'wxCheckListBox::HitTest(wxCoord&, wxCoord&) const' /usr/local/include/wx-2.8/wx/listbox.h:107: note: candidates are: int wxListBoxBase::HitTest(const wxPoint&) const rake aborted! Command failed with status (1): [g++ -c -I/usr/local/lib/wx/include/gtk2-...] i checked that directory /usr/local/lib/wx/include/gtk2-unicode-release-static-2.8/wx/setup.h maybe it's this file which cause a problem ?? p.s. the wxwidgets make install didn't install wxwidgets to the right directory ( not detected by wx-config ), i had to move the wx-2.8 folder from /usr/local/include to /usr/include, and then it was detected by wx-config thanks in advance 2007/4/11, Paul Anonymous : > > ok i'll try > thanks again > > 2007/4/11, Alex Fenton : > > > > Paul Anonymous wrote: > > > i compiled wxwidgets, following the howto on the wxruby website, then > > > i ran rake with the option > > > --libdir=/pathtothenewlycompiledwxwidgets , i took twice as long as > > > before to compile, and it ended on the same error ..... > > I think the --libdir argument will not be respected by rake - so I'd > > guess you are still compiling against the system's non-unicode version. > > > what should i do ?? > > I'd suggest installing the newly compiled unicode wxWidgets (make > > install)- it should be no problem to have multiple different versions > > installed in parallel. > > > > Before you run rake to compile wxruby, test that wx-config returns the > > correct configuration (i.e. gtk-unicode-release-static) > > > > hth > > 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: http://rubyforge.org/pipermail/wxruby-users/attachments/20070411/4ad08bd5/attachment.html From caoyangruby at gmail.com Wed Apr 11 22:16:00 2007 From: caoyangruby at gmail.com (yang cao) Date: Thu, 12 Apr 2007 10:16:00 +0800 Subject: [Wxruby-users] how to use Chinese Characters in wxRuby? In-Reply-To: <461621C3.20703@pressure.to> References: <460E6C24.8040900@gmail.com> <461621C3.20703@pressure.to> Message-ID: Hi 2007/4/6, Alex Fenton : > Hi > > yang cao wrote: > > yes,I'm using wxruby2 > > When I change > > "samples/text/unicode.rb" 's content: > > > > > Does the sample work if you don't edit it? Try running the original > sample with > > ruby -rubygems samples/text/unicode.rb it works well. but when i add chinese characters in unicode.rb and save it using windows notepad.exe -encoding utf-8 like the attach files. it raise the error : samples/text/aunicode.rb:1: Invalid char `\357' in expression samples/text/aunicode.rb:1: Invalid char `\273' in expression samples/text/aunicode.rb:1: Invalid char `\277' in expression samples/text/unicode.rb:119: syntax error, unexpected tCONSTANT, expecting ')' fd = Wx::FileDialog.new( nil, 'Import file', "", "", > > and run unicode.rb in this way: > > ruby -Ku unicode.rb > > > You don't need to run it with -Ku - the sample should be setting $KCODE > = 'u' itself. > > I got the error message like this: > > > > unicode.rb:119: syntax error, unexpected tCONSTANT, expecting ')' > > fd = Wx::FileDialog.new( nil, 'Import file', "", "", > > ^ > > unicode.rb:128: warning: parenthesize argument(s) for future version > > unicode.rb:128: syntax error, unexpected tCONSTANT, expecting kEND > > Wx::MessageDialog.new(self, message, 'Wrong encoding', > > ^ > > and more ... > > > > all the string cause error. > I wonder if perhaps the encoding of the script got changed when you > edited it? wxRuby requires non-ASCII characters in scripts to be in > UTF8. You could check whether the edited version is still valid UTF8 by > doing: > > ruby -riconv -e 'Iconv.iconv("UTF-8", "UTF-8", File.read(ARGV[0]))' > samples/text/unicode.rb when i add chinese charaters in unicode.rb ,save it in utf-8 using windows notepad, then tried this, it raise no error, but ruby -rubygems samples/text/unicode.rb still raise the errors: samples/text/unicode.rb:1: Invalid char `\357' in expression samples/text/unicode.rb:1: Invalid char `\273' in expression samples/text/unicode.rb:1: Invalid char `\277' in expression samples/text/unicode.rb:119: syntax error, unexpected tCONSTANT, expecting ')' fd = Wx::FileDialog.new( nil, 'Import file', "", "", ^ and more ..... it likes that ruby can't execute utf8 files without -Ku but wxruby2 cant understand ansi files with chinese charaters... how can i do...? > > If this raises an IllegalSequenceError, then the script isn't valid utf8. > > hth > alex > thanks! cy > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- A non-text attachment was scrubbed... Name: unicode.rb_save_in_utf-8.PNG Type: image/png Size: 101860 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20070412/c5b49eca/attachment-0001.png -------------- next part -------------- A non-text attachment was scrubbed... Name: unicode.rb Type: application/octet-stream Size: 8323 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20070412/c5b49eca/attachment-0001.obj From alex at pressure.to Thu Apr 12 05:11:59 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Apr 2007 10:11:59 +0100 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: <39e69c8e0704101024j7c6231e9y37120f8a7b3f0e61@mail.gmail.com> <461BCC35.1000902@pressure.to> <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> <461CA93C.20603@pressure.to> Message-ID: <461DF7DF.9060108@pressure.to> Paul Anonymous wrote: > i intalled wxwidgets 2.8 static gtk unicode, the wx-config output is > correct > > Default config is gtk2-unicode-release-static-2.8 > Default config will be used for output That looks good, but I'm afraid the 0.0.39 release requires wxWidgets 2.6.3, not 2.8. I think the errors are because of that. You can either 1) compile wxWidgets 2.6.3 using the same options and install it alongside the 2.8 you've built 2) download the wxwidgets_282 branch from wxruby's subversion repo, which targets wxWidgets 2.8 I'd recommend option 1) as the development branch may be less stable. And you'll have wxWidgets 2.8 ready for the next wxruby release... Alex From alex at pressure.to Thu Apr 12 06:09:04 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Apr 2007 11:09:04 +0100 Subject: [Wxruby-users] how to use Chinese Characters in wxRuby? In-Reply-To: References: <460E6C24.8040900@gmail.com> <461621C3.20703@pressure.to> Message-ID: <461E0540.8030105@pressure.to> yang cao wrote: >> Does the sample work if you don't edit it? Try running the original >> sample with >> >> ruby -rubygems samples/text/unicode.rb > > it works well. > but when i add chinese characters in unicode.rb and save it using > windows notepad.exe -encoding utf-8 like the attach files. > it raise the error : I've tried your example on Windows and I'm getting the same error. However, the wxruby unicode sample does work fine here. I feel pretty sure that your problem is coming from using notepad to edit the file. > samples/text/aunicode.rb:1: Invalid char `\357' in expression > samples/text/aunicode.rb:1: Invalid char `\273' in expression > samples/text/aunicode.rb:1: Invalid char `\277' in expression I think notepad is inserting these invalid characters into the sample - I'd strongly suggest you try using Scite, a free programming editor which should have been installed alongside your ruby installation. You will find it a much more helpful editor for writing ruby scripts generally. I was able to fix these 'Invalid char' errors by simply copying your code and pasting it into a new file in Scite, setting the encoding to UTF-8 (in File -> Encoding) and saving. > samples/text/unicode.rb:119: syntax error, unexpected tCONSTANT, > expecting ')' > fd = Wx::FileDialog.new( nil, 'Import file', "", "", Similarly, your example has a broken UTF8 character on line 91. You should be able to put a Chinese (or any other) string in the button label on that line in Scite, and it should work fine. hth Alex From music.soothes.the.soul at gmail.com Thu Apr 12 06:50:24 2007 From: music.soothes.the.soul at gmail.com (Paul Anonymous) Date: Thu, 12 Apr 2007 12:50:24 +0200 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: <461DF7DF.9060108@pressure.to> References: <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> <461CA93C.20603@pressure.to> <461DF7DF.9060108@pressure.to> Message-ID: i can't believe it, it works !!!!!!!!!!!!!!!!!!!! thank you so much !! if you want i can give you the .gem ( if others glibc<<2.4 users can't run wxruby like me ) 2007/4/12, Alex Fenton : > > Paul Anonymous wrote: > > i intalled wxwidgets 2.8 static gtk unicode, the wx-config output is > > correct > > > > Default config is gtk2-unicode-release-static-2.8 > > Default config will be used for output > That looks good, but I'm afraid the 0.0.39 release requires wxWidgets > 2.6.3, not 2.8. I think the errors are because of that. > > You can either > 1) compile wxWidgets 2.6.3 using the same options and install it > alongside the 2.8 you've built > 2) download the wxwidgets_282 branch from wxruby's subversion repo, > which targets wxWidgets 2.8 > > I'd recommend option 1) as the development branch may be less stable. > And you'll have wxWidgets 2.8 ready for the next wxruby release... > > 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: http://rubyforge.org/pipermail/wxruby-users/attachments/20070412/b4ee14b4/attachment.html From music.soothes.the.soul at gmail.com Thu Apr 12 07:03:41 2007 From: music.soothes.the.soul at gmail.com (Paul Anonymous) Date: Thu, 12 Apr 2007 13:03:41 +0200 Subject: [Wxruby-users] I'm looking for a wxwidgets interface builder which can output ruby code Message-ID: Hi ! well i'm looking for a wxwidgets programming gui ( such as gtk/glade qt-designer ), which can output ruby code, i found wxglade, and wxdesigner, but both can't output ruby files ... do you one ? ( which runs on linux ) thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070412/1eb9f9d2/attachment.html From alex at pressure.to Thu Apr 12 07:09:36 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Apr 2007 12:09:36 +0100 Subject: [Wxruby-users] I'm looking for a wxwidgets interface builder which can output ruby code In-Reply-To: References: Message-ID: <461E1370.9030301@pressure.to> Paul Anonymous wrote: > well i'm looking for a wxwidgets programming gui ( such as gtk/glade > qt-designer ), which can output ruby code, > i found wxglade, and wxdesigner, but both can't output ruby files ... Choose any of the major wxWidgets designers but save the design as an 'XRC' file. This is an xml dialect which describes a layout of widgets. Any wxWidgets port, including wxRuby can then load this layout and apply behaviours to it. Take a look at samples/xrc/xrc_sample.rb to see how it's done in wxRuby. hth alex From alex at pressure.to Thu Apr 12 07:13:21 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Apr 2007 12:13:21 +0100 Subject: [Wxruby-users] Wxruby doesn't work on my Debian sid ( glibc error ) In-Reply-To: References: <39e69c8e0704101046y4c1b5af0l830df08829c3dfb1@mail.gmail.com> <461CA93C.20603@pressure.to> <461DF7DF.9060108@pressure.to> Message-ID: <461E1451.6060302@pressure.to> Paul Anonymous wrote: > i can't believe it, it works !!!!!!!!!!!!!!!!!!!! Great, glad it all worked out in the end. Thanks for your patience. > if you want i can give you the .gem ( if others glibc<<2.4 users can't > run wxruby like me ) That's a kind offer, thanks. I don't think the gems distribution system will be able to tell the two gem files apart if we put it on rubyforge - we've had a few problems with this in the past - but I'm sure the binary gem and/or the details on the mailing list will be helpful to anyone else on a similar Linux distro. alex From music.soothes.the.soul at gmail.com Thu Apr 12 07:33:27 2007 From: music.soothes.the.soul at gmail.com (Paul Anonymous) Date: Thu, 12 Apr 2007 13:33:27 +0200 Subject: [Wxruby-users] I'm looking for a wxwidgets interface builder which can output ruby code In-Reply-To: <461E1370.9030301@pressure.to> References: <461E1370.9030301@pressure.to> Message-ID: thanks ( i should have read the website tutorials pages :) ) 2007/4/12, Alex Fenton : > > Paul Anonymous wrote: > > well i'm looking for a wxwidgets programming gui ( such as gtk/glade > > qt-designer ), which can output ruby code, > > i found wxglade, and wxdesigner, but both can't output ruby files ... > Choose any of the major wxWidgets designers but save the design as an > 'XRC' file. This is an xml dialect which describes a layout of widgets. > > Any wxWidgets port, including wxRuby can then load this layout and apply > behaviours to it. Take a look at samples/xrc/xrc_sample.rb to see how > it's done in wxRuby. > > hth > 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: http://rubyforge.org/pipermail/wxruby-users/attachments/20070412/a05c9bc7/attachment.html From caoyangruby at gmail.com Thu Apr 12 10:09:16 2007 From: caoyangruby at gmail.com (yang cao) Date: Thu, 12 Apr 2007 22:09:16 +0800 Subject: [Wxruby-users] how to use Chinese Characters in wxRuby? In-Reply-To: <461E0540.8030105@pressure.to> References: <460E6C24.8040900@gmail.com> <461621C3.20703@pressure.to> <461E0540.8030105@pressure.to> Message-ID: it seems that ruby1.8 doesn't support utf8 files with bomb .... but windows notepad only can save utf8 encoded files with bomb. when i save the file with :set fileencoding=utf-8 :set nobomb in vim. Things goes well. Scite is also a nice programming editor, :) Thanks a lot! 2007/4/12, Alex Fenton : > yang cao wrote: > >> Does the sample work if you don't edit it? Try running the original > >> sample with > >> > >> ruby -rubygems samples/text/unicode.rb > > > > it works well. > > but when i add chinese characters in unicode.rb and save it using > > windows notepad.exe -encoding utf-8 like the attach files. > > it raise the error : > I've tried your example on Windows and I'm getting the same error. > However, the wxruby unicode sample does work fine here. I feel pretty > sure that your problem is coming from using notepad to edit the file. > > samples/text/aunicode.rb:1: Invalid char `\357' in expression > > samples/text/aunicode.rb:1: Invalid char `\273' in expression > > samples/text/aunicode.rb:1: Invalid char `\277' in expression > I think notepad is inserting these invalid characters into the sample - > I'd strongly suggest you try using Scite, a free programming editor > which should have been installed alongside your ruby installation. You > will find it a much more helpful editor for writing ruby scripts generally. > > I was able to fix these 'Invalid char' errors by simply copying your > code and pasting it into a new file in Scite, setting the encoding to > UTF-8 (in File -> Encoding) and saving. > > samples/text/unicode.rb:119: syntax error, unexpected tCONSTANT, > > expecting ')' > > fd = Wx::FileDialog.new( nil, 'Import file', "", "", > Similarly, your example has a broken UTF8 character on line 91. You > should be able to put a Chinese (or any other) string in the button > label on that line in Scite, and it should work fine. > > hth > Alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From alex at pressure.to Thu Apr 12 10:23:22 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Apr 2007 15:23:22 +0100 Subject: [Wxruby-users] how to use Chinese Characters in wxRuby? In-Reply-To: References: <460E6C24.8040900@gmail.com> <461621C3.20703@pressure.to> <461E0540.8030105@pressure.to> Message-ID: <461E40DA.4000809@pressure.to> yang cao wrote: > it seems that ruby1.8 doesn't support utf8 files with bomb .... > but windows notepad only can save utf8 encoded files with bomb. > Ah, thanks for the info, that makes sense. Iconv knows about the BOM, becuase your sample file was not showing any IllegalSequence errors, but ruby doesn't. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/3208 Honestly I'm surprised that this isn't fixed in ruby... cheers alex From sean.m.long at gmail.com Thu Apr 12 11:18:27 2007 From: sean.m.long at gmail.com (Sean Long) Date: Thu, 12 Apr 2007 08:18:27 -0700 Subject: [Wxruby-users] I'm looking for a wxwidgets interface builder which can output ruby code In-Reply-To: References: <461E1370.9030301@pressure.to> Message-ID: Paul, I recommend DialogBlocks it is what I have used for a few years, works great and the author provides great support via the yahoo group. Not to mention it was written by Julian Smart the guy who originally started wxWidgets (then wxWindows). http://www.anthemion.co.uk/dialogblocks/ Sean On 4/12/07, Paul Anonymous wrote: > thanks ( i should have read the website tutorials pages :) ) > > 2007/4/12, Alex Fenton : > > Paul Anonymous wrote: > > > well i'm looking for a wxwidgets programming gui ( such as gtk/glade > > > qt-designer ), which can output ruby code, > > > i found wxglade, and wxdesigner, but both can't output ruby files ... > > Choose any of the major wxWidgets designers but save the design as an > > 'XRC' file. This is an xml dialect which describes a layout of widgets. > > > > Any wxWidgets port, including wxRuby can then load this layout and apply > > behaviours to it. Take a look at samples/xrc/xrc_sample.rb to see how > > it's done in wxRuby. > > > > hth > > alex > > > > > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From bureaux.sebastien at neuf.fr Thu Apr 12 11:55:43 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Thu, 12 Apr 2007 17:55:43 +0200 Subject: [Wxruby-users] (no subject) Message-ID: <000501c77d1b$074d1670$0201a8c0@SN111194970311> Bonjour. Je n'ai pas encore eu l'occasion d'utiliser TE_RICH2 en plus de TE_RICH | TE_MULTILINE, je compte l'essay?. Pour rentrer le texte dans TextCtrl j'utilise : @dou << texte Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070412/70d670f9/attachment.html From alex at pressure.to Thu Apr 12 12:09:21 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 12 Apr 2007 17:09:21 +0100 Subject: [Wxruby-users] (no subject) In-Reply-To: <000501c77d1b$074d1670$0201a8c0@SN111194970311> References: <000501c77d1b$074d1670$0201a8c0@SN111194970311> Message-ID: <461E59B1.3080705@pressure.to> Sebastien wrote: > Bonjour. Je n'ai pas encore eu l'occasion d'utiliser TE_RICH2 en plus > de TE_RICH | TE_MULTILINE, je compte l'essay?. > Pour rentrer le texte dans TextCtrl j'utilise : @dou << texte > Sebastien Sebastien - aussi, est-ce qu'il marche correctement si vous utiliser la m?thode "set_style" comme ci: attr = TextAttr.new(Colour.new("black"), NULL_COLOUR, @font) @dou.set_style(0, @dou.get_last_position, attr) ( in case anyone else can help, this is following on from a forum discussion: http://rubyforge.org/forum/forum.php?thread_id=13171&forum_id=12981 ) Basically, when displaying some text in a TextCtrl using a custom font, after a few thousand lines the text size reverts to the normal size when it should be double normal size: @font.set_point_size(NORMAL_FONT.get_point_size * 2) @dou = TextCtrl.new(@s, -1, "", Point.new(10, 70), Size.new(410, 210), TE_RICH | TE_MULTILINE) @dou.set_default_style(TextAttr.new(Colour.new("black"), NULL_COLOUR, @font)) alex From caoyangruby at gmail.com Thu Apr 12 12:30:30 2007 From: caoyangruby at gmail.com (yang cao) Date: Fri, 13 Apr 2007 00:30:30 +0800 Subject: [Wxruby-users] how to use Chinese Characters in wxRuby? In-Reply-To: <461E40DA.4000809@pressure.to> References: <460E6C24.8040900@gmail.com> <461621C3.20703@pressure.to> <461E0540.8030105@pressure.to> <461E40DA.4000809@pressure.to> Message-ID: <461E5EA6.1050305@gmail.com> Thank you! ye, BOM(Byte Order Mark), not bomb, hehe. cheers cy Alex Fenton ??: > yang cao wrote: > >> it seems that ruby1.8 doesn't support utf8 files with bomb .... >> but windows notepad only can save utf8 encoded files with bomb. >> >> > Ah, thanks for the info, that makes sense. Iconv knows about the BOM, > becuase your sample file was not showing any IllegalSequence errors, but > ruby doesn't. > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/3208 > > Honestly I'm surprised that this isn't fixed in ruby... > > cheers > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > From bureaux.sebastien at neuf.fr Thu Apr 12 14:52:15 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Thu, 12 Apr 2007 20:52:15 +0200 Subject: [Wxruby-users] =?iso-8859-1?q?_taille_de_caract=E8re?= Message-ID: <000501c77d33$b098da80$0201a8c0@SN111194970311> en fait je vous renvoi ce message car maintenant la taille de la police change au bout de 500 lignes environ, alors que j'avais reussi ? garder la taille jusqu'? environ 5000 lignes. Je ne comprend pas. Est-ce que c'est instable? le bout de code que vous m'avez envoyer ne marche pas. merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070412/f187bbf0/attachment.html From bureaux.sebastien at neuf.fr Thu Apr 12 14:17:09 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Thu, 12 Apr 2007 20:17:09 +0200 Subject: [Wxruby-users] (no subject) Message-ID: <000501c77d2e$c9a8a9b0$0201a8c0@SN111194970311> J'ai essayer le bout de code que vous m'avez envoyer, mais ?a n'est pas mieux. Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070412/04eb26c1/attachment.html From caoyangruby at gmail.com Fri Apr 13 04:14:26 2007 From: caoyangruby at gmail.com (yang cao) Date: Fri, 13 Apr 2007 16:14:26 +0800 Subject: [Wxruby-users] who can give me an EvtHandler#connect example? Message-ID: I read the api document online: http://wxruby.rubyforge.org/doc/evthandler.html but still don't know how to use it. EvtHandler#connect connect(Integer id, Integer lastId, EventType eventType, ObjectEventFunction function, Object userData = nil, EvtHandler eventSink = nil) the online doc's example is write in C++: frame->Connect( ID_EXIT, EVT_COMMAND_MENU_SELECTED, CommandEventHandler(MyFrame::OnQuit) ); is it like this?: frame.connect(Wx::ID_EXIT, Wx::EVT_COMMAND_MENU_SELECTED,frame.on_exit); I need to attach event, but not in initialtion function. thanks! cy From alex at pressure.to Fri Apr 13 04:34:02 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 13 Apr 2007 09:34:02 +0100 Subject: [Wxruby-users] who can give me an EvtHandler#connect example? In-Reply-To: References: Message-ID: <461F407A.5000509@pressure.to> yang cao wrote: > I read the api document online: http://wxruby.rubyforge.org/doc/evthandler.html > but still don't know how to use it. > > EvtHandler#connect > wxRuby doesn't currently support the #connect method for hooking up events. There's an open feature request for it: https://rubyforge.org/tracker/index.php?func=detail&aid=609&group_id=35&atid=221 However, I don't think it's a problem for you as you can already do what you want; see below. > is it like this?: > frame.connect(Wx::ID_EXIT, Wx::EVT_COMMAND_MENU_SELECTED,frame.on_exit); > No, this won't work. In ruby, frame.on_exit calls the method, rather than being a reference to the method to be called later (as in Python or C++) > I need to attach event, but not in initialtion function. > You can do this by using the ordinary way evt_menu(Wx::ID_EXIT) { ... } in wxRuby these can be used anywhere, not just in the initialize method. All of the evt_xxxx methods in ruby are implemented in C++ using EvtHandler#connect. For example, I tried adding an event handler in the on_about method in the minimal sample, and it works correctly. alex From alex at pressure.to Fri Apr 13 05:30:58 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 13 Apr 2007 10:30:58 +0100 Subject: [Wxruby-users] =?iso-8859-1?q?taille_de_caract=E8re?= In-Reply-To: <000501c77d33$b098da80$0201a8c0@SN111194970311> References: <000501c77d33$b098da80$0201a8c0@SN111194970311> Message-ID: <461F4DD2.2010406@pressure.to> Sebastien wrote: > en fait je vous renvoi ce message car maintenant la taille de la > police change au bout de 500 lignes environ, alors que j'avais reussi > ? garder la taille jusqu'? environ 5000 lignes. Avec Wx::TE_RICH2? Ca c'est bizarre. Je vais essayer encore une fois avec Windows. > le bout de code que vous m'avez envoyer ne marche pas. Qu'est-ce qui se passe quand vous vous servez de la methode 'set_style'- une erreur Ruby - ou rien de tout? merci Alex From alex at pressure.to Fri Apr 13 06:36:39 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 13 Apr 2007 11:36:39 +0100 Subject: [Wxruby-users] =?iso-8859-1?q?taille_de_caract=E8re?= In-Reply-To: <461F4DD2.2010406@pressure.to> References: <000501c77d33$b098da80$0201a8c0@SN111194970311> <461F4DD2.2010406@pressure.to> Message-ID: <461F5D37.9050106@pressure.to> Alex Fenton wrote: > Sebastien wrote: > >> en fait je vous renvoi ce message car maintenant la taille de la >> police change au bout de 500 lignes environ, alors que j'avais reussi >> ? garder la taille jusqu'? environ 5000 lignes. >> > Avec Wx::TE_RICH2? Ca c'est bizarre. Je vais essayer encore une fois > avec Windows. > D'accord, j'ai essay? un ?chantillon complet (voyez au-dessus) avec Windows XP, mais je ne peux pas reproduire l'erreur que vouz avez d?crite. Je pense que nous avons besoin d'un ?chantillon complet mais court qui montre le probl?me. Notez qu'on peut rencontre une erreur en utilisant append_text avec texte en UTF-8, quand le TextCtrl appara?t completement vide: http://rubyforge.org/tracker/index.php?func=detail&aid=8068&group_id=35&atid=218 mais je crois que cela n'applique pas ici... merci alex __ require 'wx' class LongTextApp < Wx::App def on_init frame = Wx::Frame.new( nil, -1, "Long Text Test", Wx::Point.new(50, 50), Wx::Size.new(450, 340)) @font = Wx::Font.new @font.set_point_size(Wx::NORMAL_FONT.get_point_size * 2) text = %q|AbC deFG hiJ KlM nOpQ RsTu v Wx Yz 12 3456 789 !"^&*| * 10_000 tx = Wx::TextCtrl.new( frame, -1, "", Wx::Point.new(10, 10), Wx::Size.new(300, 200), Wx::TE_RICH|Wx::TE_MULTILINE ) attr = Wx::TextAttr.new(Wx::BLACK, Wx::NULL_COLOUR, @font) tx.set_default_style(attr) tx.append_text text frame.show() end end LongTextApp.new.main_loop() From bureaux.sebastien at neuf.fr Fri Apr 13 07:59:00 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 13 Apr 2007 13:59:00 +0200 Subject: [Wxruby-users] =?iso-8859-1?q?_taille_de_caract=E8re?= Message-ID: <000501c77dc3$203e5880$0201a8c0@SN111194970311> Il y a des choses au niveau de la programation que j'ai un peu de mal ? comprendre, car sur les docs, tout est en anglais, ?a n'est pas ?vident, et j'ai d?buter la programation , il n'y a que quelques mois.Je ne me suis pas trop interress? a wxruby2 pour l'instant, car j'?ssai de comprendre un maximum de chose avec wxruby, dans un premier temps. ensuite, le bout de code que vous m'avez envoyer hier, ne vas pas, le probl?me reste le m?me. Par contre le bout de code que vous m'avez envoyer ce matin "class LongTextApp"..... il faut que je fasse quoi avec ce bout de code? J'ai un peu de mal ? vous suivre. merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070413/430a2544/attachment-0001.html From bureaux.sebastien at neuf.fr Fri Apr 13 08:12:11 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 13 Apr 2007 14:12:11 +0200 Subject: [Wxruby-users] =?iso-8859-1?q?_taille_de_caract=E8re?= Message-ID: <000501c77dc4$f7b51410$0201a8c0@SN111194970311> voila le bout de code que j'utilise pour cr?er ma fen?tre pour lire les fichiers: def CreationTexteCtrlBoite @font.set_point_size(NORMAL_FONT.get_point_size * 2) @dou = TextCtrl.new(@s, -1, "", Point.new(10, 70), Size.new(410, 210), TE_RICH | TE_MULTILINE) @dou.set_default_style(TextAttr.new(Colour.new("black"), NULL_COLOUR, @font)) end et voici le bout de code que j'utilise pour ouvrir les fichiers: def onOuvertureDeFichiers fichier = FileDialog.new(self, "Ouverture de fichiers", "", "" , "fichiers .txt|*txt*|fichiers .rtf|*rtf*|fichiers .xpm|*xpm*|"+ "fichiers .rb|*rb*|tous fichiers *.*|*.*|") fichier.set_directory(get_home_dir) if fichier.show_modal == ID_OK @z.clear @dou.clear texte = File.open(fichier.get_path, "r").read @dou << texte @dou.set_default_style(TextAttr.new(Colour.new("black"), NULL_COLOUR, @font)) nom = fichier.get_filename @z << nom log_status("%s", fichier.get_path) end end Est-ce que c'est moi qui a fait une erreur quelque part? Merci aussi de me r?pondre en fran?ais, c'est cool. Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070413/a2f80bc3/attachment.html From alex at pressure.to Fri Apr 13 08:58:04 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 13 Apr 2007 13:58:04 +0100 Subject: [Wxruby-users] =?iso-8859-1?q?taille_de_caract=E8re?= In-Reply-To: <000501c77dc3$203e5880$0201a8c0@SN111194970311> References: <000501c77dc3$203e5880$0201a8c0@SN111194970311> Message-ID: <461F7E5C.1010201@pressure.to> Sebastien wrote: > Il y a des choses au niveau de la programation que j'ai un peu de mal > ? comprendre, Je suis d?sol? que je sois difficile ? suivre - j'ai appris la langue fran?aise avant que l'internet ne fusse bien connu - et afin de lire Balzac et Flaubert, pas pour la programation. > car sur les docs, tout est en anglais, ?a n'est pas ?vident, et j'ai > d?buter la programation , il n'y a que quelques mois. C'est vrai qu'il n'y a pas des docs pour wxWidgets en fran?ais. Je ne sais pas s'il y ait des docs pour QT ou GTK en fran?ais, car il est possible que vous trouviez apprendre la programation GUI beaucoup plus facile avec des docs. > Je ne me suis pas trop interress? a wxruby2 pour l'instant, car > j'?ssai de comprendre un maximum de chose avec wxruby, dans un premier > temps. Je vous fortement conseille d'utiliser wxruby2, et pas wxruby 0.6.0. Il a peu d'erreurs, il est plus b?ti, et, vu votre projet de traduction, il marche bien avec langues multiples. Nous sommes bien heureux de parler de wxruby2, mais je regrette que nous ne puissions pas vous aider avec wxruby 0.6.0. > Par contre le bout de code que vous m'avez envoyer ce matin "class > LongTextApp"..... il faut que je fasse quoi avec ce bout de code? Svp, je voudrais que vous enregistriez ce bout de code comme un fichier .rb, et essayiez ?a avec wxruby2. Il contient un TextCtrl avec plus de 5,000 lignes, et je veux savoir si le probleme persiste. merci alex From bureaux.sebastien at neuf.fr Fri Apr 13 09:04:59 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 13 Apr 2007 15:04:59 +0200 Subject: [Wxruby-users] =?iso-8859-1?q?_taille_de_caract=E8re?= Message-ID: <000501c77dcc$57b3f3c0$0201a8c0@SN111194970311> je vais ?ssayer le bout de code "class LongTextApp"...... et je vous dirait si cela fonctionne ou pas. merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070413/c3ad89b8/attachment.html From bureaux.sebastien at neuf.fr Fri Apr 13 09:33:16 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 13 Apr 2007 15:33:16 +0200 Subject: [Wxruby-users] =?iso-8859-1?q?_taille_de_caract=E8re?= Message-ID: <000501c77dd0$4b3d8120$0201a8c0@SN111194970311> j'ai essayer le bout de code et ?a marche.La taille de la police reste la m?me. Cela fait un moment que j'ai install? wxruby2, mais je ne m'en ?tait pas encore servi.Ou est la diff?rence avec wxruby? Est_ce qu'il y a des changements au niveau de la programmation? Quels sont les changements r?els? Par rapport au bout de code que vous m'avez envoyer, je ne voit pas de diff?rence au niveau de la programmation avec wxruby! je vais ?ssayer par la suite de me servir de wxruby2, car je me doute qu'il est plus performant que wxruby. Merci pour les r?ponses. Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070413/160d00a0/attachment.html From caoyangruby at gmail.com Fri Apr 13 10:46:48 2007 From: caoyangruby at gmail.com (yang cao) Date: Fri, 13 Apr 2007 22:46:48 +0800 Subject: [Wxruby-users] who can give me some more examples about wxruby? Message-ID: the .rb files in samples folders contains lots of basic usage of the classes, but I am require some more 'skeleton' examples, in order to study at another view. and also need wx_sugar examples. thanks! cy From bureaux.sebastien at neuf.fr Fri Apr 13 13:27:43 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 13 Apr 2007 19:27:43 +0200 Subject: [Wxruby-users] =?iso-8859-1?q?_taille_de_caract=E8re?= Message-ID: <000501c77df1$0bf98240$0201a8c0@SN111194970311> Par contre, je voulais savoir, si j'utilise wxruby2, est-ce que je peut d?sinstaller wxruby0.6.0 ? merci. Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070413/3ae1eaf9/attachment.html From alex at pressure.to Fri Apr 13 14:12:13 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 13 Apr 2007 19:12:13 +0100 Subject: [Wxruby-users] =?iso-8859-1?q?taille_de_caract=E8re?= In-Reply-To: <000501c77dd0$4b3d8120$0201a8c0@SN111194970311> References: <000501c77dd0$4b3d8120$0201a8c0@SN111194970311> Message-ID: <461FC7FD.30002@pressure.to> Sebastien wrote: > j'ai essayer le bout de code et ?a marche.La taille de la police reste > la m?me. > Cela fait un moment que j'ai install? wxruby2, mais je ne m'en ?tait > pas encore servi.Ou est la diff?rence avec wxruby? wxruby2 est plus performant que wxruby dans plusieurs fa?ons: - Beaucoup des classes et des methodes manques au wxruby 0.6.0 (par exemple, la constant importante Wx::TE_RICH2 n'existe pas; elle permet l'utilisation des longues textes riches sur Windows) - wxruby2 marche plus bien avec des langues non-anglais (UTF8) - wxruby2 marche plus bien sur OS X et Linux - wxruby2 est sous developpement actuelle, et nous d?pannons des erreurs rapidement - m?me si on trouve des erreurs au wxruby 0.6.0, il n'est pas probable qu'elles soient jamais r?par?es > Est_ce qu'il y a des changements au niveau de la programmation? ? ce niveau, les differences entre eux sont minimales. On dit 'require 'wx'' pour utiliser wxruby, et 'require 'wx'' pour utiliser wxruby2. Donc, on ne doit pas d?sinstaller wxruby 0.6.0. Franchement, nous n'aidons que avec l'utilisation de wxruby2. merci alex From caoyangruby at gmail.com Fri Apr 13 14:19:25 2007 From: caoyangruby at gmail.com (yang cao) Date: Sat, 14 Apr 2007 02:19:25 +0800 Subject: [Wxruby-users] who can give me an EvtHandler#connect example? In-Reply-To: <461F407A.5000509@pressure.to> References: <461F407A.5000509@pressure.to> Message-ID: 2007/4/13, Alex Fenton : > yang cao wrote: > > I read the api document online: http://wxruby.rubyforge.org/doc/evthandler.html > > but still don't know how to use it. > > > > EvtHandler#connect > > > wxRuby doesn't currently support the #connect method for hooking up > events. There's an open feature request for it: > https://rubyforge.org/tracker/index.php?func=detail&aid=609&group_id=35&atid=221 > > However, I don't think it's a problem for you as you can already do what > you want; see below. > > is it like this?: > > frame.connect(Wx::ID_EXIT, Wx::EVT_COMMAND_MENU_SELECTED,frame.on_exit); > > > No, this won't work. In ruby, frame.on_exit calls the method, rather > than being a reference to the method to be called later (as in Python or ye~, i see :) > C++) > > > I need to attach event, but not in initialtion function. > > > > You can do this by using the ordinary way > > evt_menu(Wx::ID_EXIT) { ... } > > in wxRuby these can be used anywhere, not just in the initialize method. > All of the evt_xxxx methods in ruby are implemented in C++ using > EvtHandler#connect. > > For example, I tried adding an event handler in the on_about method in > the minimal sample, and it works correctly. how can evt_key_down methods pop up the key_down event? like in a textctrl, user typed a 'c'. i want the event handler process it like this: from the ancestor to the descendant, not the opposite, is there any way to do this? thanks! cy > > alex > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From caoyangruby at gmail.com Sat Apr 14 01:29:47 2007 From: caoyangruby at gmail.com (yang cao) Date: Sat, 14 Apr 2007 13:29:47 +0800 Subject: [Wxruby-users] how to simulate key_down event(when event.get_key_code()==Wx::K_DOWN) in ListCtrl or TreeCtrl? Message-ID: I want to simulate vi(vim) like operations in ListCtrl or TreeCtrl, that is, for example, when user pressed a 'j' on keyboard,the selected item change into the next one item, just like user press a Wx::K_DOWN(arrow key down on keyboard) . but not jump to some item started with a "J" charater. evt_tree_key_down(TreeTest_Ctrl) { | e | on_tree_key_down(e) } ... def on_tree_key_down(event) keycode = event.get_key_code() case keycode when 74 # 'j' 's keycode #what should I write here? ............... end end that's the basic, when I know how to write, i will organize the program's struct. thanks! cy From alex at pressure.to Sat Apr 14 06:11:12 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 14 Apr 2007 11:11:12 +0100 Subject: [Wxruby-users] how to simulate key_down event(when event.get_key_code()==Wx::K_DOWN) in ListCtrl or TreeCtrl? In-Reply-To: References: Message-ID: <4620A8C0.2020209@pressure.to> yang cao wrote: > I want to simulate vi(vim) like operations in ListCtrl or TreeCtrl, > that is, for example, when user pressed a 'j' on keyboard,the selected > item change into the next one item, just like user press a > Wx::K_DOWN(arrow key down on keyboard) . Perhaps something like this? case event.get_key_code when ?j # correct ASCII code for 'j' curr_sel = get_selection # what's currently selected? return unless curr_sel if sib = get_next_sibling(curr_sel) select_item(sib) end end This only scrolls down through the TreeCtrl if the current item has another sibling - you'd need to decide whether 'j' should move down into the current item's children, or up into its parent's siblings if it doesn't. get_item_parent and get_children (which is in WxSugar) should help. alex From bureaux.sebastien at neuf.fr Sat Apr 14 09:12:20 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Sat, 14 Apr 2007 15:12:20 +0200 Subject: [Wxruby-users] =question sur wxruby2 Message-ID: <000501c77e96$892fbdb0$0201a8c0@SN111194970311> Bonjour, je voulais savoir si wxruby2 est int?gr? ? l'interpr?teur ruby? Que veut dire $0 ? merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070414/33ef7f03/attachment.html From alex at pressure.to Sun Apr 15 17:09:24 2007 From: alex at pressure.to (Alex Fenton) Date: Sun, 15 Apr 2007 22:09:24 +0100 Subject: [Wxruby-users] =question sur wxruby2 In-Reply-To: <000501c77e96$892fbdb0$0201a8c0@SN111194970311> References: <000501c77e96$892fbdb0$0201a8c0@SN111194970311> Message-ID: <46229484.9010108@pressure.to> Salut - Sebastien wrote: > Bonjour, je voulais savoir si wxruby2 est int?gr? ? l'interpr?teur ruby? Pardonnez-moi, je ne connais pas le sens exact de 'int?gr?' ici. Que voudriez-vous que wxruby2 fasse? > Que veut dire $0 ? C'est un idiom Ruby - cette variable contient le chemin d'acc?s du script qu'on a ex?cut?. Par exemple: > ruby foo/bar.rb $0 => 'foo/bar.rb' alex From bureaux.sebastien at neuf.fr Sun Apr 15 17:38:43 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Sun, 15 Apr 2007 23:38:43 +0200 Subject: [Wxruby-users] =question sur wxruby2 Message-ID: <000501c77fa6$718097a0$0201a8c0@SN111194970311> Bonjour. quand je dit "int?gr?", en fait ?a veut ? "l'int?rieur de", donc quand je vous ai demand? si wxruby2 est int?gr? ? l'interpr?teur ruby, je voulais savoir si il est d?ja install? ou si il faut le t?l?charger et l'install?? Est-ce que la valeur "get_value" de wxruby est la m?me que celle de wxruby2? merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070415/e65517bb/attachment.html From bureaux.sebastien at neuf.fr Sun Apr 15 18:41:06 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Mon, 16 Apr 2007 00:41:06 +0200 Subject: [Wxruby-users] =question sur wxruby2 Message-ID: <000501c77faf$283bf1d0$0201a8c0@SN111194970311> Je voulait aussi savoir. Pourquoi quand je cherche une traduction, traducteur-wxruby affiche certain mots et pas d'autres? en fait c'est al?atoire. merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070416/feba881c/attachment.html From alex at pressure.to Mon Apr 16 13:01:35 2007 From: alex at pressure.to (Alex Fenton) Date: Mon, 16 Apr 2007 18:01:35 +0100 Subject: [Wxruby-users] =question sur wxruby2 In-Reply-To: <000501c77fa6$718097a0$0201a8c0@SN111194970311> References: <000501c77fa6$718097a0$0201a8c0@SN111194970311> Message-ID: <4623ABEF.60404@pressure.to> Sebastien wrote: > Bonjour. quand je dit "int?gr?", en fait ?a veut ? "l'int?rieur de", > donc quand je vous ai demand? si wxruby2 est int?gr? ? l'interpr?teur > ruby, je voulais savoir si il est d?ja install? ou si il faut le > t?l?charger et l'install?? Aucun d'outil GUI pour ruby n'est int?gr? ? l'interpr?teur. Il faut les charg?s par 'require'. On doit t?l?charger et install?r wxruby2, et aussi wxruby, ruby-GTK et QT-Ruby. TkRuby (seul) est empaquet? avec une distribution normale de ruby, mais TkRuby est souvent vu comme trop laid pour utilisation serieuse. > Est-ce que la valeur "get_value" de wxruby est la m?me que celle de > wxruby2? > merci Oui, dans tous les cas. alex From bureaux.sebastien at neuf.fr Tue Apr 17 16:26:17 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Tue, 17 Apr 2007 22:26:17 +0200 Subject: [Wxruby-users] =question sur wxruby2 Message-ID: <000501c7812e$a79f4460$0201a8c0@SN111194970311> Bonjour, je voudrais savoir ? propos de "ConfigBase" Est_ce qu'il ? toujours la m?me valeur dans wxruby2? Est-ce que l'on peut le placer dans n'importe quelle classe? Est-ce que vous pourriez me donner un exemple avec ConfigBase, svp, car il n'y en a pas dans les d?mos. Les ConfigBase que j'ai placer dans Traducteur-wxruby ne marche pas avec wxruby2. Ou ce trouve les changements? merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070417/57b873a3/attachment.html From pjlegato at gmail.com Tue Apr 17 20:18:34 2007 From: pjlegato at gmail.com (Paul Legato) Date: Tue, 17 Apr 2007 17:18:34 -0700 Subject: [Wxruby-users] Turning off spell checker in TextCtrl Message-ID: <80414390704171718m36a15e38we4e4f00a76c17fbe@mail.gmail.com> Hi, I'm running WxRuby2 on Mac OS X. Something is spell checking the text that I put into it; words it doesn't recognize get an annoying red line under them. How can I turn the spell checker off? Thanks, Paul From alex at pressure.to Fri Apr 20 04:40:45 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 20 Apr 2007 09:40:45 +0100 Subject: [Wxruby-users] Turning off spell checker in TextCtrl In-Reply-To: <80414390704171718m36a15e38we4e4f00a76c17fbe@mail.gmail.com> References: <80414390704171718m36a15e38we4e4f00a76c17fbe@mail.gmail.com> Message-ID: <46287C8D.9060201@pressure.to> Paul Legato wrote: > I'm running WxRuby2 on Mac OS X. Something is spell checking the text > that I put into it; words it doesn't recognize get an annoying red > line under them. How can I turn the spell checker off? > Hmm ... I'm running OS X but haven't ever seen this. What version of OS X are you using? Can you see this spellchecking in samples/text/textctrl.rb? thanks alex From bureaux.sebastien at neuf.fr Fri Apr 20 11:56:50 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Fri, 20 Apr 2007 17:56:50 +0200 Subject: [Wxruby-users] =ConfigBase Message-ID: <000501c78364$828f5bf0$0201a8c0@SN111194970311> Je vous renvoi ce message car vous n'avez pas r?pondu au pr?c?dent. je voudrais savoir ? propos de "ConfigBase" Est_ce qu'il ? toujours la m?me valeur dans wxruby2? Est-ce que l'on peut le placer dans n'importe quelle classe? Est-ce que vous pourriez me donner un exemple avec ConfigBase, svp, car il n'y en a pas dans les d?mos. merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070420/ce3432d5/attachment.html From sean.m.long at gmail.com Fri Apr 20 13:22:19 2007 From: sean.m.long at gmail.com (Sean Long) Date: Fri, 20 Apr 2007 10:22:19 -0700 Subject: [Wxruby-users] Turning off spell checker in TextCtrl In-Reply-To: <46287C8D.9060201@pressure.to> References: <80414390704171718m36a15e38we4e4f00a76c17fbe@mail.gmail.com> <46287C8D.9060201@pressure.to> Message-ID: > Hmm ... I'm running OS X but haven't ever seen this. What version of OS > X are you using? I also see this using 10.4.9 > Can you see this spellchecking in samples/text/textctrl.rb? Yes I can spell check in that sample. To turn it off he can right click (or control click) in the text area, in the spelling menu of the pop up select 'Check Spelling as You Type' so it does not show a check mark. The problem with the above fix is that it needs to be done to every text area and must be redone every time the app is restarted. Sean From pjlegato at gmail.com Fri Apr 20 16:46:16 2007 From: pjlegato at gmail.com (Paul Legato) Date: Fri, 20 Apr 2007 13:46:16 -0700 Subject: [Wxruby-users] Turning off spell checker in TextCtrl In-Reply-To: References: <80414390704171718m36a15e38we4e4f00a76c17fbe@mail.gmail.com> <46287C8D.9060201@pressure.to> Message-ID: <80414390704201346vddb6339i9b923271a81a0444@mail.gmail.com> I'm on 10.4.8. Spellchecking is being done in samples/text/textctrl.rb. Turning off spellcheck via the right click menu works, but it's not really suitable for an app that is going to always display data that is not in the dictionary in a textctrl.... I need a way to turn it off programmatically. Can this be done? Thanks, Paul On 4/20/07, Sean Long wrote: > > Hmm ... I'm running OS X but haven't ever seen this. What version of OS > > X are you using? > > I also see this using 10.4.9 > > > Can you see this spellchecking in samples/text/textctrl.rb? > > Yes I can spell check in that sample. > > To turn it off he can right click (or control click) in the text area, > in the spelling menu of the pop up select 'Check Spelling as You Type' > so it does not show a check mark. > > The problem with the above fix is that it needs to be done to every > text area and must be redone every time the app is restarted. > > Sean > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From alex at pressure.to Fri Apr 20 17:05:00 2007 From: alex at pressure.to (Alex Fenton) Date: Fri, 20 Apr 2007 22:05:00 +0100 Subject: [Wxruby-users] Turning off spell checker in TextCtrl In-Reply-To: <80414390704201346vddb6339i9b923271a81a0444@mail.gmail.com> References: <80414390704171718m36a15e38we4e4f00a76c17fbe@mail.gmail.com> <46287C8D.9060201@pressure.to> <80414390704201346vddb6339i9b923271a81a0444@mail.gmail.com> Message-ID: <46292AFC.2020603@pressure.to> Paul Legato wrote: > I'm on 10.4.8. Spellchecking is being done in samples/text/textctrl.rb. > > Turning off spellcheck via the right click menu works, but it's not > really suitable for an app that is going to always display data that > is not in the dictionary in a textctrl.... I need a way to turn it off > programmatically. Can this be done? > Paul, Sean, thanks for the info. Had a look at the Apple Carbon API reference and this was indeed added to the native text control that wxWidgets wraps in 10.4 (I'm on 10.3). There isn't any way to control this programmatically in wxWidgets 2.6.3, and hence in current wxRuby releases. However wxWidgets 2.8 adds a TextCtrl#CheckSpelling method for Mac, which accepts a boolean to switch this on or off. We should be able to add support for this method in wxRuby on the current development branch which targets 2.8.3 and hence for the next release. Sean - I can't test this out, but I think we should add something roughly like the following to swig/classes/include/wxTextCtrl.h to create a TextCtrl#check_spelling method. #ifdef __WXMAC__ #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 void CheckSpelling(bool check); #endif #endif Paul - with this added, you should be able to do something like: if text_ctrl.respond_to?(:check_spelling) text_ctrl.check_spelling(false) end cheers alex From sean.m.long at gmail.com Sat Apr 21 01:58:28 2007 From: sean.m.long at gmail.com (Sean Long) Date: Fri, 20 Apr 2007 22:58:28 -0700 Subject: [Wxruby-users] Turning off spell checker in TextCtrl In-Reply-To: <46292AFC.2020603@pressure.to> References: <80414390704171718m36a15e38we4e4f00a76c17fbe@mail.gmail.com> <46287C8D.9060201@pressure.to> <80414390704201346vddb6339i9b923271a81a0444@mail.gmail.com> <46292AFC.2020603@pressure.to> Message-ID: Alex, Your method worked except the public method name is MacCheckSpelling, I just did a rename in the .i to check_spelling. It works fine, I already committed it to svn. Sean > Sean - I can't test this out, but I think we should add something > roughly like the following to swig/classes/include/wxTextCtrl.h to > create a TextCtrl#check_spelling method. > #ifdef __WXMAC__ > #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 > void CheckSpelling(bool check); > #endif > #endif > > Paul - with this added, you should be able to do something like: > > if text_ctrl.respond_to?(:check_spelling) > text_ctrl.check_spelling(false) > end From alex at pressure.to Sat Apr 21 04:35:56 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 21 Apr 2007 09:35:56 +0100 Subject: [Wxruby-users] =ConfigBase In-Reply-To: <000501c78364$828f5bf0$0201a8c0@SN111194970311> References: <000501c78364$828f5bf0$0201a8c0@SN111194970311> Message-ID: <4629CCEC.2040307@pressure.to> Sebastien wrote: > je voudrais savoir ? propos de "ConfigBase" > Est_ce qu'il ? toujours la m?me valeur dans wxruby2? A ce moment, 'ConfigBase' n'existe pas dans wxruby2. Il manque ? wxruby2 parce qu'on pense que l'API de cette classe n'est pas 'ruby-ish'. On peut employer un autre package, comme ce ci: http://raa.ruby-lang.org/project/preferences/ alex From alex at pressure.to Sat Apr 21 04:46:43 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 21 Apr 2007 09:46:43 +0100 Subject: [Wxruby-users] =question sur wxruby2 In-Reply-To: <000501c77faf$283bf1d0$0201a8c0@SN111194970311> References: <000501c77faf$283bf1d0$0201a8c0@SN111194970311> Message-ID: <4629CF73.7020403@pressure.to> Sebastien wrote: > Je voulait aussi savoir. > Pourquoi quand je cherche une traduction, traducteur-wxruby affiche > certain mots et pas d'autres? Je ne connais pas le program, mais si vous pensez que c'est la faute de wxruby2, veuillez nous montrer un ?chantillon, et d?crire ce qui se passe, et ce que vous attendez. merci alex From bureaux.sebastien at neuf.fr Sat Apr 21 06:07:27 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Sat, 21 Apr 2007 12:07:27 +0200 Subject: [Wxruby-users] =question sur wxruby2 Message-ID: <000501c783fc$de2b10b0$0201a8c0@SN111194970311> Bonjour, je vais d?ja essayer de r?soudre le probl?me et si je ne trouve pas, je vous donnerais un ?chantillon. Est-ce que vous compter int?gr? wxruby2 ? l'interpr?teur ruby par la suite? car je pense que se serait une bonne chose. amicalement Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070421/a157e6a0/attachment.html From bureaux.sebastien at neuf.fr Sat Apr 21 06:13:57 2007 From: bureaux.sebastien at neuf.fr (Sebastien) Date: Sat, 21 Apr 2007 12:13:57 +0200 Subject: [Wxruby-users] =ConfigBase Message-ID: <000501c783fd$c6b0f980$0201a8c0@SN111194970311> C'est bien se que je pensait que 'ConfigBase' n'est pas dans wxruby2. merci Sebastien -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070421/2e0f94d6/attachment.html From flyerhzm at gmail.com Thu Apr 26 03:14:42 2007 From: flyerhzm at gmail.com (huang zhimin) Date: Thu, 26 Apr 2007 15:14:42 +0800 Subject: [Wxruby-users] Bitmap in Toolbar display only a quarter of picture on Windows XP Message-ID: I don't know why the bitmap in toolbar displays only a quarter of picture on Windows XP, but it displays OK on Ubuntu. The attachments are results both on Windows XP and Ubuntu -- flyerhzm at hotmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070426/467a8172/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: windowsxp.bmp Type: image/bmp Size: 31518 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20070426/467a8172/attachment-0002.bmp -------------- next part -------------- A non-text attachment was scrubbed... Name: ubuntu.bmp Type: image/bmp Size: 60982 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20070426/467a8172/attachment-0003.bmp From alex at pressure.to Thu Apr 26 03:36:08 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 26 Apr 2007 08:36:08 +0100 Subject: [Wxruby-users] Bitmap in Toolbar display only a quarter of picture on Windows XP In-Reply-To: References: Message-ID: <46305668.4050000@pressure.to> huang zhimin wrote: > I don't know why the bitmap in toolbar displays only a quarter of > picture on Windows XP, but it displays OK on Ubuntu. > The attachments are results both on Windows XP and Ubuntu It looks to me like Windows XP is cropping the image to 16x15, which is the default size: http://wxruby.rubyforge.org/doc/toolbar.html#ToolBar_settoolbitmapsize Perhaps try calling set_tool_bitmap_size(Wx::Size.new(32,32)) before adding any tools, or use a 16x15 set of images on all platforms. HTH alex From flyerhzm at gmail.com Thu Apr 26 06:25:39 2007 From: flyerhzm at gmail.com (huang zhimin) Date: Thu, 26 Apr 2007 18:25:39 +0800 Subject: [Wxruby-users] Bitmap in Toolbar display only a quarter of picture on Windows XP In-Reply-To: <46305668.4050000@pressure.to> References: <46305668.4050000@pressure.to> Message-ID: Thanks, it's done On 4/26/07, Alex Fenton wrote: > > huang zhimin wrote: > > I don't know why the bitmap in toolbar displays only a quarter of > > picture on Windows XP, but it displays OK on Ubuntu. > > The attachments are results both on Windows XP and Ubuntu > It looks to me like Windows XP is cropping the image to 16x15, which is > the default size: > > http://wxruby.rubyforge.org/doc/toolbar.html#ToolBar_settoolbitmapsize > > Perhaps try calling set_tool_bitmap_size(Wx::Size.new(32,32)) before > adding any tools, or use a 16x15 set of images on all platforms. > > HTH > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- flyerhzm at hotmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070426/6b9eed20/attachment.html From flyerhzm at gmail.com Thu Apr 26 08:44:49 2007 From: flyerhzm at gmail.com (huang zhimin) Date: Thu, 26 Apr 2007 20:44:49 +0800 Subject: [Wxruby-users] How to close Frame? Message-ID: When I call frame.destory on Windows XP, I am told that CodeLineStatistics/init.rb:5: [BUG] Segmentation fault ruby 1.8.6 (2007-03-13) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. What's the correct way to close the frame? -- flyerhzm at hotmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070426/83c73069/attachment.html From alex at pressure.to Thu Apr 26 09:26:02 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 26 Apr 2007 14:26:02 +0100 Subject: [Wxruby-users] How to close Frame? In-Reply-To: References: Message-ID: <4630A86A.5030507@pressure.to> huang zhimin wrote: > When I call frame.destory on Windows XP, I am told that > > CodeLineStatistics/init.rb:5: [BUG] Segmentation fault > ruby 1.8.6 (2007-03-13) [i386-mswin32] WxRuby developers - should we even have a #destroy method in Ruby? > What's the correct way to close the frame? I think frame.close() should be sufficient? alex From flyerhzm at gmail.com Thu Apr 26 10:46:23 2007 From: flyerhzm at gmail.com (huang zhimin) Date: Thu, 26 Apr 2007 22:46:23 +0800 Subject: [Wxruby-users] How to close Frame? In-Reply-To: <4630A86A.5030507@pressure.to> References: <4630A86A.5030507@pressure.to> Message-ID: I got the problem. Because I create a DirDialog, but not destroy it. On 4/26/07, Alex Fenton wrote: > > huang zhimin wrote: > > When I call frame.destory on Windows XP, I am told that > > > > CodeLineStatistics/init.rb:5: [BUG] Segmentation fault > > ruby 1.8.6 (2007-03-13) [i386-mswin32] > WxRuby developers - should we even have a #destroy method in Ruby? > > What's the correct way to close the frame? > I think frame.close() should be sufficient? > > alex > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- flyerhzm at hotmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070426/38458f72/attachment.html From zedenator at gmail.com Thu Apr 26 15:09:58 2007 From: zedenator at gmail.com (zedenator) Date: Thu, 26 Apr 2007 20:09:58 +0100 Subject: [Wxruby-users] mouse event handling Message-ID: Hi all, I have difficulty understanding WxRuby / WxWidgets event handling, hoping someone here can lend us some light. Im writing a simple gui app where I need to receive mouse click events from the shapes drawn on a canvas (a simple object inheriting from ScrolledWindow, as seen in many examples). Shapes arent buttons so I think I'll need to be checking the coordinates to be able to work out what's been clicked exactly, but please correct me if Im wrong. So I went and wrote a little prototype and it seems to me that the only widget capable of receiving mouse events is a Panel. I've tested this by placing a catch-all evt_mouse_events right in my App class ("event tables are searched up through the hierarchy of windows", say the WxWidgets docs), but its only trigered when I move the cursor over the Panel and not ScrolledWindow or, in fact, anywhere else in the app window. This isnt quite what I was expecting, so I guess I have two questions: 1 - am I thinking correctly about the Panel being the only widget capable of receiving mouse events? 2 - any other way I can detect user clicks? All comments welcome. Thanks in advance. ./zedenator From zedenator at gmail.com Thu Apr 26 17:40:25 2007 From: zedenator at gmail.com (zedenator) Date: Thu, 26 Apr 2007 22:40:25 +0100 Subject: [Wxruby-users] mouse event handling Message-ID: Good news everyone! After a reframing break I gave it another go and it all 'just worked'. Im not sure at all what I had wrong previously, but now canvas (and anything else I want) are all able to receive mouse events w/o any problems, just like one would expect. Thanks for your patience :) ./zedenator From alex at pressure.to Thu Apr 26 18:32:06 2007 From: alex at pressure.to (Alex Fenton) Date: Thu, 26 Apr 2007 23:32:06 +0100 Subject: [Wxruby-users] mouse event handling In-Reply-To: References: Message-ID: <46312866.9040606@pressure.to> Hi zedenator wrote: > Im writing a simple gui app where I need to receive mouse click events > from the shapes drawn on a canvas (a simple object inheriting from > ScrolledWindow, as seen in many examples). Shapes arent buttons so I > think I'll need to be checking the coordinates to be able to work out > what's been clicked exactly, but please correct me if Im wrong. > > So I went and wrote a little prototype and it seems to me that the > only widget capable of receiving mouse events is a Panel. I've tested > this by placing a catch-all evt_mouse_events right in my App class > ("event tables are searched up through the hierarchy of windows", say > the WxWidgets docs), but its only trigered when I move the cursor over > the Panel and not ScrolledWindow or, in fact, anywhere else in the app > window. > > This isnt quite what I was expecting, so I guess I have two questions: > > 1 - am I thinking correctly about the Panel being the only widget > capable of receiving mouse events? > 2 - any other way I can detect user clicks? > Well firstly glad it worked out. So far as I understand, in WxWidgets / WxRuby there are two broad types of events 1) 'Command' events that result from interactions specific to a widget - eg pressing a button, selecting an item in a list or dropdown, etc 2) Other events that are generic GUI interactions - such as mouse movement, resizing, scrolling, maximising or closing windows The first sort are bubbled up, so that panels or frames can capture command events generated by widgets they contain. The second sort aren't, so you need to define an event handler within the relevant widget itself - for example, the panel. In your example, I guess Panels are useful because they cover a large space and receive the events generated within them - but I could be wrong on this. alex From abram.abraham at gmail.com Fri Apr 27 18:27:29 2007 From: abram.abraham at gmail.com (Abram Abraham) Date: Fri, 27 Apr 2007 18:27:29 -0400 Subject: [Wxruby-users] panel as child of grid on Windows Message-ID: <51422c240704271527m390d1460rfb2c5f06a7aea612@mail.gmail.com> I am attempting to add controls inside a Wx::Grid. I added a Wx::Panel as a child of the grid, then added a control to that panel. In the actual code, the child panel would be sized and located inside a single grid cell, but I simplified the example code. On linux with GTK, this code performs as expected--you get a green panel with a clickable button in it. On windows XP, however, the grid and panel have painting conflicts. The panel paints over the grid in the label section, but the grid cells paint over the panel. Also, the panel does not receive mouse events, making the button unclickable. Instead, the mouse events go to the underlying grid. Any ideas? Abram require 'wx' class MainApp < Wx::App def on_init frame = Wx::Frame.new(nil, -1, "My Frame", Wx::Point.new(50, 50), Wx:: Size.new(450, 340)) panel = MyPanel.new(frame, -1, Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE) frame.show() end end class MyPanel < Wx::Panel def initialize (parent, id, pos, size) super(parent, id, pos, size) grid = Wx::Grid.new(self, -1, Wx::DEFAULT_POSITION, Wx::Size.new (400,400)) grid.create_grid( 2, 2 ) panel = GridChildPanel.new(self, -1, pos, Wx::Size.new (100,100)) end end class GridChildPanel < Wx::Panel def initialize(parent, id, pos, size) super(parent, id, pos, size) set_background_colour(Wx::GREEN) button = Wx:: Button.new(self, -1, 'Push me') end end app = MainApp.new app.main_loop() -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070427/31b7d5c7/attachment.html From alex at pressure.to Sat Apr 28 08:44:56 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 28 Apr 2007 13:44:56 +0100 Subject: [Wxruby-users] panel as child of grid on Windows In-Reply-To: <51422c240704271527m390d1460rfb2c5f06a7aea612@mail.gmail.com> References: <51422c240704271527m390d1460rfb2c5f06a7aea612@mail.gmail.com> Message-ID: <463341C8.3040305@pressure.to> Hi Abram Abraham wrote: > I am attempting to add controls inside a Wx::Grid. I added a Wx::Panel > as a child of the grid, then added a control to that panel. In the > actual code, the child panel would be sized and located inside a > single grid cell, but I simplified the example code. At the moment the panel and the grid are siblings - both children of the frame - so they'll get drawn on top or alongside one another (I get the latter on OS X). Having a control eg a button within a Wx::Grid isn't a UI feature across the platforms, so it's not going to work as is. If you just want to have controls in a grid-like arrangement, use Wx::GridSizer or Wx::FlexGridSizer. It should be possible to draw arbitrary content within a Wx::Grid cell by inheriting from the abstract class Wx::GridCellRenderer and writing your own draw method. I haven't tried to do this and not sure if it will work in current wxRuby. What UI interaction are you trying to offer? - I'd expect there's an easier and more standard way to achieve it alex From mario at ruby-im.net Sat Apr 28 11:11:03 2007 From: mario at ruby-im.net (Mario Steele) Date: Sat, 28 Apr 2007 10:11:03 -0500 Subject: [Wxruby-users] XRC Problem Message-ID: <46336407.6060000@ruby-im.net> Hello All, I've looked back through the wxruby-users archive, and found someone else was having the same problem when it comes to Accessing XRC and getting a GTK Error about GtkPizza. I don't know what the problem is, as what I'm using, is wxGlade to develop my user interface, and it creates all the controls in what looks like it should be fine, but it's not working. The simplest of my program is: begin require 'wx' rescue LoadError => no_wx_err begin require 'rubygems' require 'wx' rescue LoadError raise no_wx_err end end module XrcEnabled def getXrcControl(id) return find_window_by_id( Wx::xrcid(id) ) end end class ContactList < Wx::Frame include XrcEnabled def initialize() super(nil,-1,"RubyIM") $xml.load_frame_subclass(self,nil,"ContactList") # Grab all the controls for what I'm creating end end class RubyIMApp < Wx::App def on_init $xml = Wx::XmlResource.get(); $xml.init_all_handlers(); xrc_file = File.join( File.dirname(__FILE__), "xrc", "ContactList.xrc") $xml.load(xrc_file) main = ContactList.new() main.show(true) end end RubyIMApp.new.main_loop() The wxGlade xrc file source is: Ruby IM - Contact List 297, 732 Connect to IM Server... Disconnect from Server Exit from RubyIM Add a Chatroom to your contact list... Join a Chat room Start a new chat... List Current Existing Chat Rooms Add a Contact to your contact list... Edit an existing contact in your Contact list... Remove an Existing contact.... Show Offline Contacts.... 1 Show empty groups in your contact list 1 Client Preferences... Privacy Options... View your current file transfers.... Client debug window... Mute System Sounds 1 View Help File... About RubyIM... 1 -1 32, 31 Add a Contact Add a contact to your contact list /home/eumario/Projects/RubyIM/images/add_contact.png Add Chat Room Add a chat room to your contact list /home/eumario/Projects/RubyIM/images/add_chat.png wxVERTICAL wxALL|wxEXPAND And like before, which according to the wxruby-users archive, this is the same problem that Alex was dealing with back on wxruby2 0.0.37 back in December. Any insight will be much appreciated. Thanks, Mario Steele From alex at pressure.to Sat Apr 28 14:12:45 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 28 Apr 2007 19:12:45 +0100 Subject: [Wxruby-users] XRC Problem In-Reply-To: <46336407.6060000@ruby-im.net> References: <46336407.6060000@ruby-im.net> Message-ID: <46338E9D.2050708@pressure.to> Mario Steele wrote: > Hello All, > > I've looked back through the wxruby-users archive, and found someone > else was having the same problem when it comes to Accessing XRC and > getting a GTK Error about GtkPizza. I don't know what the problem is, > as what I'm using, is wxGlade to develop my user interface, and it > creates all the controls in what looks like it should be fine, but it's > not working. The simplest of my program is: > I don't have a chance to test it out on GTK right now, but does it help if you put a panel as the first and only child of the frame, and then make the toolbar and treectrl chidren of that? alex From alex at pressure.to Sat Apr 28 15:00:29 2007 From: alex at pressure.to (Alex Fenton) Date: Sat, 28 Apr 2007 20:00:29 +0100 Subject: [Wxruby-users] XRC Problem In-Reply-To: <46336407.6060000@ruby-im.net> References: <46336407.6060000@ruby-im.net> Message-ID: <463399CD.5040702@pressure.to> Mario Steele wrote: > I've looked back through the wxruby-users archive, and found someone > else was having the same problem when it comes to Accessing XRC and > getting a GTK Error about GtkPizza. I've looked again at the wxWidgets docs and the way wxRuby is wrapping XmlResource. I think there is something not quite right in the wrapping that may possibly explain this bug, if my other suggestion doesn't help. However I'll need a day or three to try fixing it. For anyone interested - I think the wx LoadFrame method expects to receive a frame made with the no-args default constructor, but we're passing it Frames that have been fully initialized. I'm guessing we need to re-jig initialisation of windows and dialogs from XRC. a From sleight42 at gmail.com Sat Apr 28 22:29:46 2007 From: sleight42 at gmail.com (Evan Light) Date: Sat, 28 Apr 2007 22:29:46 -0400 Subject: [Wxruby-users] wxruby unfriendly to other threads? Message-ID: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> I've seen a few e-mails about multithreading with respect to wxruby but nothing recent. Unless I'm mistaken, and that may be, there still appear to be problems. The following code seems to hang my spawned thread in favor of the wxruby event loop: Thread.new do puts "in thread" loop do sleep 5 puts "looping" end end puts "main loop" app.main_loop "in thread" and "main loop" appear at approximately the same time, contending for STDOUT. However, "looping" never appears on STDOUT. Is wxruby halting all non wxruby threads? Evan Light IMs (all): sleight42 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070428/c018cfb3/attachment.html From sleight42 at gmail.com Sat Apr 28 22:32:37 2007 From: sleight42 at gmail.com (Evan Light) Date: Sat, 28 Apr 2007 22:32:37 -0400 Subject: [Wxruby-users] wxruby and threading Message-ID: <79BD4B12-5E29-4603-AAF2-FC46C0EA9D17@gmail.com> I stand corrected. My threads priority is must be massively lower than wxruby. "looping" does print but not even close to every five seconds as in my code example. Evan Light IMs (all): sleight42 Skype-In: (703) 531-8484 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070428/74f167d0/attachment.html From alex at pressure.to Sun Apr 29 05:13:05 2007 From: alex at pressure.to (Alex Fenton) Date: Sun, 29 Apr 2007 10:13:05 +0100 Subject: [Wxruby-users] wxruby unfriendly to other threads? In-Reply-To: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> References: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> Message-ID: <463461A1.2060006@pressure.to> Evan Light wrote: > I've seen a few e-mails about multithreading with respect to wxruby > but nothing recent. Unless I'm mistaken, and that may be, there still > appear to be problems. I think you're right that other ruby threads don't receive very high priority relative to wxruby's thread. However, you can explicitly tell wxruby to let other threads run when the GUI is idle, by adding something like the following to your App's on_init method. evt_idle { Thread.pass } If you simply want to do timed events, Wx::Timer class should work. This code moves a Gauge forward once per second timer = Wx::Timer.new(self, 42) # 42 is an arbitrary id evt_timer(42) { | e | @gauge.value += 1 } timer.start(1000) # 1000ms = 1s interval Do other ruby GUI co-operate better with ruby's lightweight threadS? alex From mario at ruby-im.net Sun Apr 29 06:01:11 2007 From: mario at ruby-im.net (Mario Steele) Date: Sun, 29 Apr 2007 05:01:11 -0500 Subject: [Wxruby-users] XRC Problem In-Reply-To: <46338E9D.2050708@pressure.to> References: <46336407.6060000@ruby-im.net> <46338E9D.2050708@pressure.to> Message-ID: <46346CE7.3000003@ruby-im.net> Alex Fenton wrote: > I don't have a chance to test it out on GTK right now, but does it help > if you put a panel as the first and only child of the frame, and then > make the toolbar and treectrl chidren of that? > With wxGlade, it doesn't give me the option to add it to like a wxSizerBox, like the normal Glade does. It is possible that this is a Bug more specifically with wxGlade, then with wxRuby. Unfortunately I don't know of any other GUI designer that I personally like to use. Mario Steele -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070429/f05b699a/attachment-0001.html From mario at ruby-im.net Sun Apr 29 06:57:47 2007 From: mario at ruby-im.net (Mario Steele) Date: Sun, 29 Apr 2007 05:57:47 -0500 Subject: [Wxruby-users] XRC Problem In-Reply-To: <46338E9D.2050708@pressure.to> References: <46336407.6060000@ruby-im.net> <46338E9D.2050708@pressure.to> Message-ID: <46347A2B.9040707@ruby-im.net> Alex Fenton wrote: > I don't have a chance to test it out on GTK right now, but does it help > if you put a panel as the first and only child of the frame, and then > make the toolbar and treectrl chidren of that? > > alex > Hey Alex, I figured out a way around my problem. Instead of utilizing XmlResource#load_frame_subclass(), I just use XmlResource#load_frame, and when I get the Wx::Frame, I just extend it with a Module, which works just fine. Thanks anyways, Mario Steele -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070429/bedd66be/attachment.html From alex at pressure.to Sun Apr 29 10:26:40 2007 From: alex at pressure.to (Alex Fenton) Date: Sun, 29 Apr 2007 15:26:40 +0100 Subject: [Wxruby-users] XRC Problem In-Reply-To: <46347A2B.9040707@ruby-im.net> References: <46336407.6060000@ruby-im.net> <46338E9D.2050708@pressure.to> <46347A2B.9040707@ruby-im.net> Message-ID: <4634AB20.3020803@pressure.to> Hi Mario > I figured out a way around my problem. Instead of utilizing > XmlResource#load_frame_subclass(), I just use XmlResource#load_frame, > and when I get the Wx::Frame, I just extend it with a Module, which > works just fine. I'm glad you found a workaround. You've helped pin down a longstanding bug that's now fixed in subversion. The listbook.rb sample was misleading; the correct way to initialize a layout from XRC in a subclass of Frame is: class MyFrame < Wx::Frame def initialize(...) super() # note, no arguments to parent class constructor $xml.load_frame_subclass(self, nil, 'ID_FRAME') This won't work with 0.0.39 because the empty constructor for Wx::Frame isn't available. But in future versions you'll be able to use normal class inheritance with XRC + Frames. Thanks for the report alex From sleight42 at gmail.com Sun Apr 29 13:10:15 2007 From: sleight42 at gmail.com (Evan Light) Date: Sun, 29 Apr 2007 13:10:15 -0400 Subject: [Wxruby-users] wxruby unfriendly to other threads? In-Reply-To: <463461A1.2060006@pressure.to> References: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> <463461A1.2060006@pressure.to> Message-ID: <72E0F2CB-B6B8-4C83-84A1-3172F333D06C@gmail.com> First off, thanks for the reply. On Apr 29, 2007, at 5:13 AM, Alex Fenton wrote: > Evan Light wrote: >> I've seen a few e-mails about multithreading with respect to wxruby >> but nothing recent. Unless I'm mistaken, and that may be, there >> still >> appear to be problems. > I think you're right that other ruby threads don't receive very high > priority relative to wxruby's thread. > It certainly seems that way. Wx appears to be doing something tricky underneath the covers somewhere with respect to other Threads. I ratcheted the priority on my Thread higher and higher to absolutely no avail. If I had to guess, Wx is downgrading the priority of other Threads while significantly increasing the priority of the event loop thread. > However, you can explicitly tell wxruby to let other threads run when > the GUI is idle, by adding something like the following to your App's > on_init method. > > evt_idle { Thread.pass } > Cute idea. I'd tried playing with the idle event handler; however, I hadn't specifically tried getting the event handler thread to pass. Unfortunately, this simply causes my program to exit immediately despite the following call to Wx:App.main_loop class MyApp < Wx::App def on_init evt_idle {Thread.pass} end end app = MyApp.new Thread.new do loop do puts "foo" end end puts "main loop" app.main_loop This causes "foo" to print several times but Wx, for some misbegotten reason, seems to dump out of the main loop and exit without a RuntimeError. > If you simply want to do timed events, Wx::Timer class should work. > This > code moves a Gauge forward once per second > > timer = Wx::Timer.new(self, 42) # 42 is an arbitrary id > evt_timer(42) { | e | @gauge.value += 1 } > timer.start(1000) # 1000ms = 1s interval > Ah, yes. I didn't look for this but, if memory serves, X has a similar way of handling timed events without additional threads. Sadly, I didn't think to look for this. Be it enough to say that I tend to shy away from thick client development when I can. This should do the trick! Thank you! > Do other ruby GUI co-operate better with ruby's lightweight threadS? > Good question! I'll play with Ruby/Tk and FXRuby and let you know. Evan Light IMs (all): sleight42 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070429/44906c23/attachment.html From alex at pressure.to Sun Apr 29 13:50:19 2007 From: alex at pressure.to (Alex Fenton) Date: Sun, 29 Apr 2007 18:50:19 +0100 Subject: [Wxruby-users] wxruby unfriendly to other threads? In-Reply-To: <72E0F2CB-B6B8-4C83-84A1-3172F333D06C@gmail.com> References: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> <463461A1.2060006@pressure.to> <72E0F2CB-B6B8-4C83-84A1-3172F333D06C@gmail.com> Message-ID: <4634DADB.4030108@pressure.to> > Unfortunately, this simply causes my program to exit immediately > despite the following call to Wx:App.main_loop > > class MyApp < Wx::App > def on_init > evt_idle {Thread.pass} > end > end ... > This causes "foo" to print several times but Wx, for some misbegotten > reason, seems to dump out of the main loop and exit without a > RuntimeError. The problem here is just that App#on_init isn't returning a true value - the return value of evt_idle is nil. You have to a return a true value from on_init, signalling successful initialisation, otherwise the main_loop is never entered and execution ends. That aside, however, I've tried on a few more platforms and am getting inconsistent results using 'evt_idle { Thread.pass }'. On OS X and the current dev branch, which I tried before, it works well. However OS X + 0.0.39 segfaults. And on Linux/GTK with either dev or 0.0.39 the non-GUI thread seems to be running slow, and the application won't close on exit. Perhaps some tweaking of the Ruby thread code would help. What OS are you on? >> If you simply want to do timed events, Wx::Timer class should work. This >> code moves a Gauge forward once per second ... >> evt_timer(42) { | e | @gauge.value += 1 } PS - this is wxSugar code - not wxRuby. ... > This should do the trick! :) >> Do other ruby GUI co-operate better with ruby's lightweight threadS? >> > > Good question! I'll play with Ruby/Tk and FXRuby and let you know. That would be useful. If another toolkit has addressed this we may be able to borrow their approach. alex From alex at pressure.to Sun Apr 29 14:17:48 2007 From: alex at pressure.to (Alex Fenton) Date: Sun, 29 Apr 2007 19:17:48 +0100 Subject: [Wxruby-users] wxruby unfriendly to other threads? In-Reply-To: <4634DADB.4030108@pressure.to> References: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> <463461A1.2060006@pressure.to> <72E0F2CB-B6B8-4C83-84A1-3172F333D06C@gmail.com> <4634DADB.4030108@pressure.to> Message-ID: <4634E14C.5050003@pressure.to> Alex Fenton wrote: > That aside, however, I've tried on a few more platforms and am getting > inconsistent results using 'evt_idle { Thread.pass }'. > Sorry to reply to my own post, but just to let you know that using Wx::Timer + Thread.pass + evt_timer inside App#on_init seems to work well on OS X (dev, not 0.0.39), GTK (both) and Windows (both). def on_init t = Wx::Timer.new(self, 55) evt_timer(55) { Thread.pass } t.start(100) ... A sleep(1) loop plus a 100ms timer runs every 1s to 1.1s, which is what I'd expect. This would be suitable for a background task; Wx::Timer alone would probably be better for a timed loop. A quick search suggests that the ruby ports of QT, GTK and Fox all suffer the same problem and recommend a similar solution. hth a From sleight42 at gmail.com Sun Apr 29 14:31:34 2007 From: sleight42 at gmail.com (Evan Light) Date: Sun, 29 Apr 2007 14:31:34 -0400 Subject: [Wxruby-users] wxruby unfriendly to other threads? In-Reply-To: <4634DADB.4030108@pressure.to> References: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> <463461A1.2060006@pressure.to> <72E0F2CB-B6B8-4C83-84A1-3172F333D06C@gmail.com> <4634DADB.4030108@pressure.to> Message-ID: On Apr 29, 2007, at 1:50 PM, Alex Fenton wrote: > > What OS are you on? OS X 10.4.9 >>> If you simply want to do timed events, Wx::Timer class should >>> work. This >>> code moves a Gauge forward once per second > ... > ... >> This should do the trick! > :) > Yup, the timer works. Now I'm just fighting what is probably PEBKAC. Trying to remove all of the widgets within a Sizer and then add new ones. Having problems there. >>> Do other ruby GUI co-operate better with ruby's lightweight threadS? >>> >> >> Good question! I'll play with Ruby/Tk and FXRuby and let you know. > That would be useful. If another toolkit has addressed this we may be > able to borrow their approach. > Sounds like you just answered that one in your latest e-mail. Great information, BTW, thanks! Being able to spawn another thread is hugely preferable to making the event loop wait for some or another operation. Evan Light IMs (all): sleight42 Skype-In: (703) 531-8484 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070429/515aab6c/attachment-0001.html From sleight42 at gmail.com Sun Apr 29 14:44:37 2007 From: sleight42 at gmail.com (Evan Light) Date: Sun, 29 Apr 2007 14:44:37 -0400 Subject: [Wxruby-users] wxruby unfriendly to other threads? In-Reply-To: References: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> <463461A1.2060006@pressure.to> <72E0F2CB-B6B8-4C83-84A1-3172F333D06C@gmail.com> <4634DADB.4030108@pressure.to> Message-ID: Uh, woops. That Sizer.remove is now unsupported may be the problem. So how does one empty sizer? Simply creating a new sizer and calling Window#set_sizer seems to have unusual effects... On Apr 29, 2007, at 2:31 PM, Evan Light wrote: > Trying to remove all of the widgets within a Sizer and then add > new ones. Having problems there. Evan Light IMs (all): sleight42 Skype-In: (703) 531-8484 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070429/a3bfd395/attachment.html From sleight42 at gmail.com Sun Apr 29 14:54:46 2007 From: sleight42 at gmail.com (Evan Light) Date: Sun, 29 Apr 2007 14:54:46 -0400 Subject: [Wxruby-users] wxruby unfriendly to other threads? In-Reply-To: References: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> <463461A1.2060006@pressure.to> <72E0F2CB-B6B8-4C83-84A1-3172F333D06C@gmail.com> <4634DADB.4030108@pressure.to> Message-ID: <024B479C-A1A0-44BB-B410-852FBD02717D@gmail.com> One final self reply. Window#destroy_children seems to mostly do the trick. Still have some other issues but closer now. On Apr 29, 2007, at 2:44 PM, Evan Light wrote: > Uh, woops. That Sizer.remove is now unsupported may be the > problem. So how does one empty sizer? Simply creating a new sizer > and calling Window#set_sizer seems to have unusual effects... > > On Apr 29, 2007, at 2:31 PM, Evan Light wrote: > >> Trying to remove all of the widgets within a Sizer and then add >> new ones. Having problems there. > Evan Light IMs (all): sleight42 Skype-In: (703) 531-8484 http://evan.tiggerpalace.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20070429/e4a71f1d/attachment.html From alex at pressure.to Sun Apr 29 15:38:29 2007 From: alex at pressure.to (Alex Fenton) Date: Sun, 29 Apr 2007 20:38:29 +0100 Subject: [Wxruby-users] removing items from sizers In-Reply-To: References: <47BE5E8C-26E0-4DCD-BEBD-94523C29DFE8@gmail.com> <463461A1.2060006@pressure.to> <72E0F2CB-B6B8-4C83-84A1-3172F333D06C@gmail.com> <4634DADB.4030108@pressure.to> Message-ID: <4634F435.1000403@pressure.to> > Trying to remove all of the widgets within a Sizer and then add new > ones. Having problems there. Perhaps something like sizer = Wx::BoxSizer.new(Wx::VERTICAL) sizer.add( Wx::Button.new(self, -1, 'water') ) sizer.add( Wx::Button.new(self, -1, 'wood') ) self.set_sizer(sizer) get_children.length.times { sizer.remove(0) } sizer.add( Wx::Button.new(self, -1, 'ice') ) sizer.add( Wx::Button.new(self, -1, 'fire') ) sizer.add( Wx::Button.new(self, -1, 'earth') ) sizer.layout If things aren't looking right after some removals or additions, make sure you are calling sizer.layout to recalculate the widgets' sizes a