From riosgabrielf at gmail.com Tue Jul 1 07:59:45 2008 From: riosgabrielf at gmail.com (Gabriel Rios) Date: Tue, 1 Jul 2008 08:59:45 -0300 Subject: [wxruby-users] Printing Problem: text very small In-Reply-To: <48692113.8070407@pressure.to> References: <9d7d67e9bb450c2bed55d8cdc4009d05@ruby-forum.com> <48692113.8070407@pressure.to> Message-ID: On Mon, Jun 30, 2008 at 3:08 PM, Alex Fenton wrote: > Take a look at: > http://docs.wxwidgets.org/stable/wx_printingoverview.html#printingoverview > > In particular Wx::Printout has some methods to get scaling from screen to > print dimensions > http://docs.wxwidgets.org/stable/wx_wxprintout.html#wxprintout > Thanks Alex, It helps me a lot and solve my problem. -- Gabriel Falc?o Rios From erubin at valcom.com Tue Jul 1 13:52:03 2008 From: erubin at valcom.com (Eric Rubin) Date: Tue, 1 Jul 2008 13:52:03 -0400 Subject: [wxruby-users] Glitch with RubyScript2exe In-Reply-To: Message-ID: <002c01c8dba3$2bc06380$a50ba8c0@valcom.com> I used RubyScript2exe to build a Windows exe from my WxRuby app and it worked great. When I added --rubyscript2exe-rubyw to the command line, to get rid of the DOS window, it still worked (once I redirected my stdin and stderr to a log file), except that occasionally a DOS window appears and disappears (very quickly). This occurs predictably, when certain events occur. (It's not every time I write debug messages to the log file.) The occurrence is not related to any GUI activity. It happens when my Ruby app receives a certain message from another app. It may not even be related to WxRuby. Any idea of what might be causing this? (It's annoying and certainly not acceptable for a release version.) Thanks, Eric Rubin From lists at ruby-forum.com Tue Jul 1 15:04:35 2008 From: lists at ruby-forum.com (Joseph Edelstein) Date: Tue, 1 Jul 2008 21:04:35 +0200 Subject: [wxruby-users] Treads slowing down the process Message-ID: <787239e17e79e99cdd55824da10e4993@ruby-forum.com> Hello, I was having problems with my GUI freezing if you clicked off of it when it was running or if it was processing a large file. After researching the forum, I found a thread that dealt with the problem by adding a timer and Thread.pass to the App. This solved the problem of the GUI freezing or hanging. However, it has caused the program to run very slowly. What use to take only a few seconds now takes a few minutes. People will be processing large text files with this program so speed is important. Thanks in advance for any help. Joe Ruby code: begin require 'rubygems' rescue LoadError end require 'rubyscript2exe' require 'wx' include Wx require 'Bogus_Frame.rb' require 'bogus_conts.rb' include Process RUBYSCRIPT2EXE.lib = ["Bogus_GUI.xrc"] RUBYSCRIPT2EXE.lib = ['Bogus_Frame.rb'] RUBYSCRIPT2EXE.lib = ['bogus_conts.rb'] class BogusFrame < BogusBase include Bogus_code def initialize @ext_def_source = ".txt" @ext_def_result = ".txt" super evt_button(source_button) {|event| source(event)} evt_button(result_button) {|event| result(event)} evt_button(start_button) {|event| main} end#def initialize def source(event) source_path = file_selector( "Select the file to load", "", "", @ext_def_source, "CSV (*.csv)|*.csv|Plain text (*.txt)|*.txt|All files (*.*)|*.*", CHANGE_DIR, self ) if source_path == nil return nil else @source_textbox.clear @source_textbox.append_text(source_path) end @ext_def_source = source_path[/[^\.]*$/] end#end def source def result(event) result_path = file_selector( "Select the file to load", "", "", @ext_def_result, "CSV (*.csv)|*.csv|Plain text (*.txt)|*.txt|All files (*.*)|*.*", CHANGE_DIR, self ) if result_path == nil return nil end # it is just a sample, would use SplitPath in real program @ext_def_result = result_path[/[^\.]*$/] @result_textbox.clear @result_textbox.append_text(result_path) end#end def source end#end Class class BogusApp < App def on_init() t = Wx::Timer.new(self, 55) evt_timer(55) { Thread.pass } t.start(1) BogusFrame.new.show end end BogusApp.new.main_loop() Attachments: http://www.ruby-forum.com/attachment/2290/bogus_conts.rb -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Wed Jul 2 02:09:55 2008 From: mario at ruby-im.net (Mario Steele) Date: Wed, 2 Jul 2008 01:09:55 -0500 Subject: [wxruby-users] Treads slowing down the process In-Reply-To: <787239e17e79e99cdd55824da10e4993@ruby-forum.com> References: <787239e17e79e99cdd55824da10e4993@ruby-forum.com> Message-ID: Hello Joseph, There is a certain problem with this. Threads tend to make things a bit slower with processing, due to the very nature of Threads. There is literally a pause current process, switch to next to give shared time, before switching back. So what may only take a few seconds, can increase when you involve Threads. The thing you have to remember, is that Threads are green in Ruby. Meaning they are software controlled, not Hardware controlled. As it is, what you are currently doing, to execute the Timer every millisecond, is about the best you can do, to increase the speed. So unfortunately, there's not much else here that can be solved. Unless you wish to get into separating the code that processes the Text file, into a separate file, and using something like Open3 to call the second bit of code, and monitor the output from the sub-process. That will be the only way you could truly get close-as-possible threading in Ruby. On Tue, Jul 1, 2008 at 2:04 PM, Joseph Edelstein wrote: > Hello, > > I was having problems with my GUI freezing if you clicked off of it when > it was running or if it was processing a large file. After researching > the forum, I found a thread that dealt with the problem by adding a > timer and Thread.pass to the App. This solved the problem of the GUI > freezing or hanging. > > However, it has caused the program to run very slowly. What use to take > only a few seconds now takes a few minutes. People will be processing > large text files with this program so speed is important. > > Thanks in advance for any help. > > Joe > > Ruby code: > > begin > require 'rubygems' > rescue LoadError > end > > require 'rubyscript2exe' > require 'wx' > include Wx > require 'Bogus_Frame.rb' > require 'bogus_conts.rb' > include Process > > RUBYSCRIPT2EXE.lib = ["Bogus_GUI.xrc"] > RUBYSCRIPT2EXE.lib = ['Bogus_Frame.rb'] > RUBYSCRIPT2EXE.lib = ['bogus_conts.rb'] > > class BogusFrame < BogusBase > include Bogus_code > def initialize > @ext_def_source = ".txt" > @ext_def_result = ".txt" > super > evt_button(source_button) {|event| source(event)} > evt_button(result_button) {|event| result(event)} > evt_button(start_button) {|event| main} > end#def initialize > > def source(event) > source_path = file_selector( > "Select the file to load", > "", "", > @ext_def_source, > "CSV (*.csv)|*.csv|Plain text > (*.txt)|*.txt|All files (*.*)|*.*", > CHANGE_DIR, > self > ) > if source_path == nil > return nil > else > @source_textbox.clear > @source_textbox.append_text(source_path) > end > @ext_def_source = source_path[/[^\.]*$/] > end#end def source > > def result(event) > result_path = file_selector( > "Select the file to load", > "", "", > @ext_def_result, > "CSV (*.csv)|*.csv|Plain text > (*.txt)|*.txt|All files (*.*)|*.*", > CHANGE_DIR, > self > ) > if result_path == nil > return nil > end > # it is just a sample, would use SplitPath in real program > @ext_def_result = result_path[/[^\.]*$/] > @result_textbox.clear > @result_textbox.append_text(result_path) > > end#end def source > > > end#end Class > > class BogusApp < App > def on_init() > t = Wx::Timer.new(self, 55) > evt_timer(55) { Thread.pass } > t.start(1) > BogusFrame.new.show > > end > end > > BogusApp.new.main_loop() > > Attachments: > http://www.ruby-forum.com/attachment/2290/bogus_conts.rb > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From riosgabrielf at gmail.com Thu Jul 3 08:13:40 2008 From: riosgabrielf at gmail.com (Gabriel Rios) Date: Thu, 3 Jul 2008 09:13:40 -0300 Subject: [wxruby-users] Background Colour of Button Widget. Message-ID: Hi again, im trying to paint a button background under windows but theres no visual change. This is supposed to work like that? I read here in the forums that the menubar "cant" change the color in windows, that apply to buttons too? -- Gabriel Falc?o Rios From lists at ruby-forum.com Thu Jul 3 16:28:04 2008 From: lists at ruby-forum.com (M. Muzaffar) Date: Thu, 3 Jul 2008 22:28:04 +0200 Subject: [wxruby-users] WxRuby with MySQl Message-ID: <8fb607e546e8329247d676e8a216c637@ruby-forum.com> Hi All! I am newbie to WxRuby. If someone can give me an example of storing data into MySQL database using WxRuby. /Muzaffar -- Posted via http://www.ruby-forum.com/. From therion at ninth-art.de Fri Jul 4 06:05:27 2008 From: therion at ninth-art.de (Georg Bege) Date: Fri, 04 Jul 2008 12:05:27 +0200 Subject: [wxruby-users] WxRuby with MySQl In-Reply-To: <8fb607e546e8329247d676e8a216c637@ruby-forum.com> References: <8fb607e546e8329247d676e8a216c637@ruby-forum.com> Message-ID: <486DF5E7.8020309@ninth-art.de> What has a GUI toolkit todo with storing data in an database?? This is a general ruby question I think but has nothing to do with wxwidgets. M. Muzaffar wrote: > Hi All! > > I am newbie to WxRuby. If someone can give me an example of storing data > into MySQL database using WxRuby. > > /Muzaffar > -- Georg 'Therion' Bege http://coruscant.info http://www.ninth-art.de therion at ninth-art.de !DSPAM:486df5f1132154935618243! From lists at ruby-forum.com Mon Jul 7 05:04:24 2008 From: lists at ruby-forum.com (Lc Yeap) Date: Mon, 7 Jul 2008 11:04:24 +0200 Subject: [wxruby-users] Sizer problem Message-ID: <4ae9104e419a658a66637988f8501782@ruby-forum.com> Greetings, Currenly i am trying to display a grid at the bottom of my GUI when a button is clicked. However, the original frame size will not be auto adjusted. it makes the GUI looks ugly and not user friendly as they need to use cursor to resize it. May i know is there any command that i can use to solve this problem? any method to adjust the frame after evt_button generate a grid at the bottom? thanks a lot. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Jul 7 07:38:05 2008 From: lists at ruby-forum.com (Petr Chelcicky) Date: Mon, 7 Jul 2008 13:38:05 +0200 Subject: [wxruby-users] wxDirDialog and show_modal don't work Message-ID: <21175d6d79b425d36cfb0531e794b453@ruby-forum.com> Hi, I'm playing around with wxRuby and XRC and I'm unable to create modal WxDirDialog. After opening it I'm always able to get focus on parent window. class TestApp < Wx::App def on_init @test = Main.new.show end end class Main < MainFrame def initialize super self.size = ([133,191]) evt_button(basic_config) { | event | butt_event(event) } end end def butt_eventos(event) adr = Wx::DirDialog.new( @test, "Choose a folder") case adr.show_modal() when Wx::ID_OK puts "Directory: %s" % [ adr.get_path ] when Wx::ID_CANCEL puts "NOT OK" end adr.destroy() end After changing DirDialog to FileDialog or MessageDialog it works great, and those dialogs are modal, so it looks that in Dirdialog is buggy, bt maybe I'm doing something wrong. Any ideas? Thnx. (I'm using latest wxRuby,wx_sugar, tested on winXP and Vista) -- Posted via http://www.ruby-forum.com/. From nochoice at xs4all.nl Tue Jul 8 06:39:18 2008 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Tue, 08 Jul 2008 12:39:18 +0200 Subject: [wxruby-users] wxDirDialog and show_modal don't work In-Reply-To: <21175d6d79b425d36cfb0531e794b453@ruby-forum.com> References: <21175d6d79b425d36cfb0531e794b453@ruby-forum.com> Message-ID: <487343D6.6080706@xs4all.nl> You are looking for the fit() method. From the docs: window.Fit(): The Fit() method sets the size of a window to fit around its children. If it has no children then nothing is done, if it does have children then the size of the window is set to the window's best size. http://docs.wxwidgets.org/stable/wx_windowsizingoverview.html#windowsizingoverview and http://wxruby.rubyforge.org/doc/window.html#Window_fit ps. frames that resize themselves aren't really considered user-friendly either. Best of luck, Jonathan Petr Chelcicky wrote: > Hi, > I'm playing around with wxRuby and XRC and I'm unable to create modal > WxDirDialog. After opening it I'm always able to get focus on parent > window. > > class TestApp < Wx::App > def on_init > @test = Main.new.show > end > end > > class Main < MainFrame > def initialize > super > self.size = ([133,191]) > evt_button(basic_config) { | event | butt_event(event) } > end > end > > def butt_eventos(event) > adr = Wx::DirDialog.new( @test, "Choose a folder") > case adr.show_modal() > when Wx::ID_OK > puts "Directory: %s" % > [ adr.get_path ] > when Wx::ID_CANCEL > puts "NOT OK" > end > adr.destroy() > end > > > After changing DirDialog to FileDialog or MessageDialog it works great, > and those dialogs are modal, so it looks that in Dirdialog is buggy, bt > maybe I'm doing something wrong. Any ideas? Thnx. > (I'm using latest wxRuby,wx_sugar, tested on winXP and Vista) > From nochoice at xs4all.nl Tue Jul 8 06:48:54 2008 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Tue, 08 Jul 2008 12:48:54 +0200 Subject: [wxruby-users] wxDirDialog and show_modal don't work In-Reply-To: <487343D6.6080706@xs4all.nl> References: <21175d6d79b425d36cfb0531e794b453@ruby-forum.com> <487343D6.6080706@xs4all.nl> Message-ID: <48734616.5010006@xs4all.nl> Sorry about that, Thunderbird wasn't cooperating causing me to accidentally responded to the wrong message. My bad. Jonathan Maasland wrote: > You are looking for the fit() method. > > From the docs: > window.Fit(): The Fit() method sets the size of a window to fit around > its children. If it has no children then nothing is done, if it does > have children then the size of the window is set to the window's best > size. > > http://docs.wxwidgets.org/stable/wx_windowsizingoverview.html#windowsizingoverview > > and > http://wxruby.rubyforge.org/doc/window.html#Window_fit > > ps. frames that resize themselves aren't really considered > user-friendly either. > > Best of luck, > Jonathan > > Petr Chelcicky wrote: >> Hi, >> I'm playing around with wxRuby and XRC and I'm unable to create modal >> WxDirDialog. After opening it I'm always able to get focus on parent >> window. >> >> class TestApp < Wx::App >> def on_init >> @test = Main.new.show >> end >> end >> >> class Main < MainFrame >> def initialize >> super >> self.size = ([133,191]) >> evt_button(basic_config) { | event | butt_event(event) } >> end >> end >> >> def butt_eventos(event) >> adr = Wx::DirDialog.new( @test, "Choose a folder") >> case adr.show_modal() >> when Wx::ID_OK >> puts "Directory: %s" % >> [ adr.get_path ] >> when Wx::ID_CANCEL >> puts "NOT OK" >> end >> adr.destroy() >> end >> >> >> After changing DirDialog to FileDialog or MessageDialog it works great, >> and those dialogs are modal, so it looks that in Dirdialog is buggy, bt >> maybe I'm doing something wrong. Any ideas? Thnx. >> (I'm using latest wxRuby,wx_sugar, tested on winXP and Vista) >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > From nochoice at xs4all.nl Tue Jul 8 06:53:57 2008 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Tue, 08 Jul 2008 12:53:57 +0200 Subject: [wxruby-users] Sizer problem In-Reply-To: <4ae9104e419a658a66637988f8501782@ruby-forum.com> References: <4ae9104e419a658a66637988f8501782@ruby-forum.com> Message-ID: <48734745.4000302@xs4all.nl> You are looking for the fit() method. From the docs: window.Fit(): The Fit() method sets the size of a window to fit around its children. If it has no children then nothing is done, if it does have children then the size of the window is set to the window's best size. http://docs.wxwidgets.org/stable/wx_windowsizingoverview.html#windowsizingoverview and http://wxruby.rubyforge.org/doc/window.html#Window_fit ps. frames that resize themselves aren't really considered user-friendly either. Best of luck, Jonathan (I'm really really starting to hate Thunderbird, 4th time I sent this message now) Lc Yeap wrote: > Greetings, > > Currenly i am trying to display a grid at the bottom of my GUI when a > button is clicked. However, the original frame size will not be auto > adjusted. it makes the GUI looks ugly and not user friendly as they need > to use cursor to resize it. May i know is there any command that i can > use to solve this problem? any method to adjust the frame after > evt_button generate a grid at the bottom? thanks a lot. > From alex at pressure.to Wed Jul 9 05:47:00 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 09 Jul 2008 10:47:00 +0100 Subject: [wxruby-users] DOS box popping up under rubyscript2exe Message-ID: <48748914.1030106@pressure.to> Hello My email has been broken for a week and some of it seems to have gone astray - so if there are other unanswered wxruby queries kicking about, please repost or forward me them. I have encountered this problem with a DOS box popping up under rubyw / rubyscript2exe; I don't think it's related to wxruby. I found them popping up when shelling out with backticks - I believe the way that ruby executes external programs on Windows causes this if no command shell is already present. This may be what's happen with receiving a message from an external program in your case. I got round it by calling the external program via Win32API on Windows, instead of ruby's own system/backticks. There's some code that encapsulates this here: http://weft-qda.rubyforge.org/svn/branches/stable_1-0/weft-qda/lib/weft/filters/win32backtick.rb hth alex From erubin at valcom.com Wed Jul 9 09:00:00 2008 From: erubin at valcom.com (Eric Rubin) Date: Wed, 9 Jul 2008 09:00:00 -0400 Subject: [wxruby-users] DOS box popping up under rubyscript2exe In-Reply-To: <48748914.1030106@pressure.to> Message-ID: <000001c8e1c3$b29d1350$a50ba8c0@valcom.com> Thanks, Alex. I did find a place where I was doing `hostname` and getting rid of this fixed the problem. Eric -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Wednesday, July 09, 2008 5:47 AM To: General discussion of wxRuby Subject: [wxruby-users] DOS box popping up under rubyscript2exe Hello My email has been broken for a week and some of it seems to have gone astray - so if there are other unanswered wxruby queries kicking about, please repost or forward me them. I have encountered this problem with a DOS box popping up under rubyw / rubyscript2exe; I don't think it's related to wxruby. I found them popping up when shelling out with backticks - I believe the way that ruby executes external programs on Windows causes this if no command shell is already present. This may be what's happen with receiving a message from an external program in your case. I got round it by calling the external program via Win32API on Windows, instead of ruby's own system/backticks. There's some code that encapsulates this here: http://weft-qda.rubyforge.org/svn/branches/stable_1-0/weft-qda/lib/weft/filt ers/win32backtick.rb hth alex _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users From mario at ruby-im.net Wed Jul 9 11:35:03 2008 From: mario at ruby-im.net (Mario Steele) Date: Wed, 9 Jul 2008 09:35:03 -0600 Subject: [wxruby-users] DOS box popping up under rubyscript2exe In-Reply-To: <000001c8e1c3$b29d1350$a50ba8c0@valcom.com> References: <48748914.1030106@pressure.to> <000001c8e1c3$b29d1350$a50ba8c0@valcom.com> Message-ID: You actually should be able to get the hostname, via Wx::get_host_name() which will return the hostname of the machine that the application runs on. On Wed, Jul 9, 2008 at 7:00 AM, Eric Rubin wrote: > Thanks, Alex. I did find a place where I was doing `hostname` and getting > rid of this fixed the problem. > > Eric > > -----Original Message----- > From: wxruby-users-bounces at rubyforge.org > [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton > Sent: Wednesday, July 09, 2008 5:47 AM > To: General discussion of wxRuby > Subject: [wxruby-users] DOS box popping up under rubyscript2exe > > Hello > > My email has been broken for a week and some of it seems to have gone > astray - so if there are other unanswered wxruby queries kicking about, > please repost or forward me them. > > I have encountered this problem with a DOS box popping up under rubyw / > rubyscript2exe; I don't think it's related to wxruby. I found them > popping up when shelling out with backticks - I believe the way that > ruby executes external programs on Windows causes this if no command > shell is already present. This may be what's happen with receiving a > message from an external program in your case. > > I got round it by calling the external program via Win32API on Windows, > instead of ruby's own system/backticks. There's some code that > encapsulates this here: > > > http://weft-qda.rubyforge.org/svn/branches/stable_1-0/weft-qda/lib/weft/filt > ers/win32backtick.rb > > 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 > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Jul 10 04:35:18 2008 From: lists at ruby-forum.com (Richard White) Date: Thu, 10 Jul 2008 10:35:18 +0200 Subject: [wxruby-users] ListCtrl LC_REPORT undefined method Message-ID: <5245a13643d2d57a4c08a6896d1cb803@ruby-forum.com> Hi Inserting an item with several columns into a ListCtrl: def add_items(items) i = 0 items.each do |data| self.insert_item(i, data[0]) self.set_item(i,1,data[1]) self.set_item(i,2,data[2]) i += 1 end end end works fine but I am unable to set the background colour of the item: self.set_item_background_colour(i,RED) gives: undefined method: set_item_background_colour Version is 1.9.4-i386-mswin32 Ideas? Refreshing that the Scottish heritage of wxWidgets influences spelling: I am so used to color as opposed to colour. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Jul 12 13:05:09 2008 From: lists at ruby-forum.com (Bob Bobrov) Date: Sat, 12 Jul 2008 19:05:09 +0200 Subject: [wxruby-users] Raising exceptions and "wrong number of arguments" problem Message-ID: <65829c2079f8c6154fc2129d3bcaebc6@ruby-forum.com> Hi everyone - what is the proper way to display error messages when you raise exceptions? For example, the following code... class MyWxRubyClass some code... evt_button(my_button) do begin some code... if wrong_condition raise "My Error Message" end some code... rescue Exception => msg puts msg Wx::MessageDialog.new(nil, msg, 'Error Popup', Wx::OK|Wx::ICON_ERROR).show_modal end end end ... produces "wrong # of arguments(1 for 0)" error message in both console and message box. How can I make it to display "My Error Message"? "Wrong # of arguments(1 for 0)" happens only when I raise my own error messages, ruby's native error messages are being displayd well. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Sat Jul 12 13:16:58 2008 From: alex at pressure.to (Alex Fenton) Date: Sat, 12 Jul 2008 18:16:58 +0100 Subject: [wxruby-users] Raising exceptions and "wrong number of arguments" problem In-Reply-To: <65829c2079f8c6154fc2129d3bcaebc6@ruby-forum.com> References: <65829c2079f8c6154fc2129d3bcaebc6@ruby-forum.com> Message-ID: <4878E70A.5020706@pressure.to> Bob Bobrov wrote: > Hi everyone - what is the proper way to display error messages when you > raise exceptions? > > For example, the following code... > > class MyWxRubyClass > some code... > evt_button(my_button) do > begin > some code... > if wrong_condition > raise "My Error Message" > end > some code... > rescue Exception => msg > puts msg > Wx::MessageDialog.new(nil, msg, 'Error Popup', > Wx::OK|Wx::ICON_ERROR).show_modal > end > end > end > > ... produces "wrong # of arguments(1 for 0)" error message in both > console and message box. Use Kernel.raise, eg Kernel.raise "My Error Message" The reason this is needed is because if you're inside a class that inherits from Wx::Window, a call to 'raise' unqualified is taken to mean the instance method Window#raise (which takes no arguments) alex From lists at ruby-forum.com Sat Jul 12 15:42:06 2008 From: lists at ruby-forum.com (Bob Bobrov) Date: Sat, 12 Jul 2008 21:42:06 +0200 Subject: [wxruby-users] Raising exceptions and "wrong number of arguments" probl In-Reply-To: <4878E70A.5020706@pressure.to> References: <65829c2079f8c6154fc2129d3bcaebc6@ruby-forum.com> <4878E70A.5020706@pressure.to> Message-ID: <2ea9fb421c5fa4bc26a7fb2f6b46663a@ruby-forum.com> Alex Fenton wrote: > The reason this is needed is because if you're inside a class that > inherits from Wx::Window, a call to 'raise' unqualified is taken to mean > the instance method Window#raise (which takes no arguments) > > alex Thank you very much, Alex :-) -- Posted via http://www.ruby-forum.com/. From magnus at aoeu.info Tue Jul 15 10:50:22 2008 From: magnus at aoeu.info (=?ISO-8859-1?Q?Magnus_Engstr=F6m?=) Date: Tue, 15 Jul 2008 16:50:22 +0200 Subject: [wxruby-users] Preloading the wx libraries Message-ID: <487CB92E.9060807@aoeu.info> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I have a Nokia N810, running Linux, and wxruby works quite well on it, except application startup which takes quite some time. I have thought about preloading the wx libraries in some kind of launcher, which then brings up the forms on some signal. I tried calling MyApplication.new.main_loop multiple times (exited the main loop in between), which complained about the constant THE_APP already being defined. Undefining this and trying again gave me a segfault. I also tried handling this in the on_init method, but it didn't work so well when it wasn't allowed to return ;-) Do someone have any suggestions about how to create this type of launcher? Best regards, Magnus -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkh8uS0ACgkQFsdVGDM22G6KigCbB57hPWZY+UFdnPfqIhCxsu3J VlYAn1sxXgSydAnmywJ8lUQAWtdHttKr =BLZH -----END PGP SIGNATURE----- From mario at ruby-im.net Tue Jul 15 13:26:33 2008 From: mario at ruby-im.net (Mario Steele) Date: Tue, 15 Jul 2008 11:26:33 -0600 Subject: [wxruby-users] Preloading the wx libraries In-Reply-To: <487CB92E.9060807@aoeu.info> References: <487CB92E.9060807@aoeu.info> Message-ID: *mouth drops* I never knew wxRuby was being used, or could even be used on something like that little thing. The problem with that, is you need to initialize Wx::App only once. Any attempt to use Wx::App more then once, will cause the error your getting. You could possibly setup a Client/Server system, in which you create a dummy library, that replicates the functionality of wxRuby, which actually communicates to the Server, to create the windows, and such. That would be the only way you would be able to "Pre Load" the wxRuby library. Sorry, that's about as much as I can help you with. L8ers, On Tue, Jul 15, 2008 at 8:50 AM, Magnus Engstr?m wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > I have a Nokia N810, running Linux, and wxruby works quite well on it, > except application startup which takes quite some time. > > I have thought about preloading the wx libraries in some kind of > launcher, which then brings up the forms on some signal. > > I tried calling MyApplication.new.main_loop multiple times (exited the > main loop in between), which complained about the constant THE_APP > already being defined. Undefining this and trying again gave me a > segfault. I also tried handling this in the on_init method, but it > didn't work so well when it wasn't allowed to return ;-) > > Do someone have any suggestions about how to create this type of launcher? > > Best regards, > Magnus > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > > iEYEARECAAYFAkh8uS0ACgkQFsdVGDM22G6KigCbB57hPWZY+UFdnPfqIhCxsu3J > VlYAn1sxXgSydAnmywJ8lUQAWtdHttKr > =BLZH > -----END PGP SIGNATURE----- > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Tue Jul 15 19:05:48 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 16 Jul 2008 00:05:48 +0100 Subject: [wxruby-users] Preloading the wx libraries In-Reply-To: References: <487CB92E.9060807@aoeu.info> Message-ID: <487D2D4C.7060505@pressure.to> Hi Mario Steele wrote: > *mouth drops* I never knew wxRuby was being used, or could even be > used on something like that little thing. Likewise ... cool > The problem with that, is you need to initialize Wx::App only once. > Any attempt to use Wx::App more then once, will cause the error your > getting. Generally, this is part of the design of the Wx library, not just wxRuby - it expects the main_loop to be entered only once, as part of the library is initialised at this point rather than at library load. > You could possibly setup a Client/Server system, in which you create a > dummy library, that replicates the functionality of wxRuby, which > actually communicates to the Server, to create the windows, and such. > That would be the only way you would be able to "Pre Load" the wxRuby > library. I looked into this approach a while back when I was trying to create an interactive wxRuby shell which could be used to test out ideas quickly. I never got it into a fully functional state, but here's the code in case it helps you. It creates a server app upon which a client can execute wx code. alex ##### CLIENT ##### require 'socket' include Socket::Constants while command = gets if command.chomp == "x" exit! end p 'command' socket = Socket.new( AF_INET, SOCK_STREAM, 0 ) sockaddr = Socket.pack_sockaddr_in( 5858, '127.0.0.1' ) socket.connect( sockaddr ) socket.write( command ) result = socket.readline STDOUT.puts ">> #{result}" socket.close end # results = socket.read ##### SERVER ##### require 'wx' require 'socket' class IRBApp < Wx::App def on_init server = TCPServer.new('127.0.0.1', 5858) $f = Wx::Frame.new(nil, -1, 'empty') # $f.show Wx::Timer.every(100) { Thread.pass } listener = Thread.new do while session = server.accept command = session.gets p command begin result = eval( command ) rescue => result end session.puts(result.inspect) session.close end end listener.abort_on_exception = true end end IRBApp.new().main_loop From magnus at aoeu.info Wed Jul 16 02:55:52 2008 From: magnus at aoeu.info (=?ISO-8859-1?Q?Magnus_Engstr=F6m?=) Date: Wed, 16 Jul 2008 08:55:52 +0200 Subject: [wxruby-users] Preloading the wx libraries In-Reply-To: <487D2D4C.7060505@pressure.to> References: <487CB92E.9060807@aoeu.info> <487D2D4C.7060505@pressure.to> Message-ID: <487D9B78.6050000@aoeu.info> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I tried this approach, but I missed the Thread.pass bit, so my threads wasn't very effective when I wasn't operating on the frames :) I'll play around a bit and see what happens. Thanks! /Magnus Alex Fenton wrote: > Hi > > Mario Steele wrote: >> *mouth drops* I never knew wxRuby was being used, or could even be >> used on something like that little thing. > Likewise ... cool > >> The problem with that, is you need to initialize Wx::App only once. >> Any attempt to use Wx::App more then once, will cause the error your >> getting. > Generally, this is part of the design of the Wx library, not just wxRuby > - it expects the main_loop to be entered only once, as part of the > library is initialised at this point rather than at library load. >> You could possibly setup a Client/Server system, in which you create a >> dummy library, that replicates the functionality of wxRuby, which >> actually communicates to the Server, to create the windows, and such. >> That would be the only way you would be able to "Pre Load" the wxRuby >> library. > I looked into this approach a while back when I was trying to create an > interactive wxRuby shell which could be used to test out ideas quickly. > I never got it into a fully functional state, but here's the code in > case it helps you. It creates a server app upon which a client can > execute wx code. > > alex > > ##### CLIENT ##### > > require 'socket' > include Socket::Constants > > > while command = gets > if command.chomp == "x" > exit! > end > p 'command' > socket = Socket.new( AF_INET, SOCK_STREAM, 0 ) > sockaddr = Socket.pack_sockaddr_in( 5858, '127.0.0.1' ) > socket.connect( sockaddr ) > socket.write( command ) > result = socket.readline > STDOUT.puts ">> #{result}" > socket.close > end > # results = socket.read > > ##### SERVER ##### > > require 'wx' > > require 'socket' > > class IRBApp < Wx::App > def on_init > > server = TCPServer.new('127.0.0.1', 5858) > > $f = Wx::Frame.new(nil, -1, 'empty') > # $f.show > Wx::Timer.every(100) { Thread.pass } > > listener = Thread.new do > while session = server.accept > command = session.gets > p command > begin > result = eval( command ) > rescue => result > end > session.puts(result.inspect) > session.close > end > end > listener.abort_on_exception = true > end > end > > > IRBApp.new().main_loop > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkh9m3gACgkQFsdVGDM22G6jzACdGkC6BEYamPeiQYTgD3o/61F/ BuAAn0X1kjRQGFoKdAkkespIylDu+Tsc =d6R+ -----END PGP SIGNATURE----- From lists at ruby-forum.com Wed Jul 16 20:21:21 2008 From: lists at ruby-forum.com (Philip Rutkowski) Date: Thu, 17 Jul 2008 02:21:21 +0200 Subject: [wxruby-users] wxruby and rgplot Message-ID: <8c0626d88e1207eb9521bb130b253c39@ruby-forum.com> hi- i'm really new to ruby (like 2 days new). so, i'm trying to plot a graph inside a window. i'm using rgplot and wxruby. i can plot using rgplot just fine. and i can create a window using wxruby. i just don't know how to combine the two. any ideas? where should i start learning? thanks!!! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jul 17 07:19:54 2008 From: lists at ruby-forum.com (Richard White) Date: Thu, 17 Jul 2008 13:19:54 +0200 Subject: [wxruby-users] ListCtrl LC_REPORT undefined method In-Reply-To: <5245a13643d2d57a4c08a6896d1cb803@ruby-forum.com> References: <5245a13643d2d57a4c08a6896d1cb803@ruby-forum.com> Message-ID: I can only assume that ListCtrl#set_item_background_colour is not supported by MSW so I have used ListItem#set_background_colour successfully instead. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Jul 17 18:37:16 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 17 Jul 2008 23:37:16 +0100 Subject: [wxruby-users] ListCtrl LC_REPORT undefined method In-Reply-To: References: <5245a13643d2d57a4c08a6896d1cb803@ruby-forum.com> Message-ID: <487FC99C.4000306@pressure.to> Richard White wrote: > I can only assume that ListCtrl#set_item_background_colour is not > supported by MSW so I have used ListItem#set_background_colour > successfully instead. > Missed your earlier message. From the wxWidgets headers it looks like set_item_background_colour should be supported on MSW, Mac and generic, but it's missing currently from wxRuby. We can add it for the next release. Thanks for the report. alex From alex at pressure.to Thu Jul 17 18:40:03 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 17 Jul 2008 23:40:03 +0100 Subject: [wxruby-users] wxruby and rgplot In-Reply-To: <8c0626d88e1207eb9521bb130b253c39@ruby-forum.com> References: <8c0626d88e1207eb9521bb130b253c39@ruby-forum.com> Message-ID: <487FCA43.3080002@pressure.to> Philip Rutkowski wrote: > i'm really new to ruby (like 2 days new). so, i'm trying to plot a graph > inside a window. i'm using rgplot and wxruby. i can plot using rgplot > just fine. and i can create a window using wxruby. i just don't know how > to combine the two. any ideas? where should i start learning? thanks!!! > It's not really clear what rgplot does from the home page, but I'm assuming that it writes a chart of some sort to an image file eg a PNG. If that's right, the easiest way to combine it with wxRuby is to use GnuPlot to write an image file, then paint that image file on a Wx::Window using a DC (Device Context). The sample file drawing/images.rb is a perfect simple example of how to do this. cheers alex From lists at ruby-forum.com Thu Jul 17 19:42:36 2008 From: lists at ruby-forum.com (Philip Rutkowski) Date: Fri, 18 Jul 2008 01:42:36 +0200 Subject: [wxruby-users] wxruby and rgplot In-Reply-To: <487FCA43.3080002@pressure.to> References: <8c0626d88e1207eb9521bb130b253c39@ruby-forum.com> <487FCA43.3080002@pressure.to> Message-ID: <0a8599762f0d4532f2f5de90669e8436@ruby-forum.com> Alex Fenton wrote: > Philip Rutkowski wrote: >> i'm really new to ruby (like 2 days new). so, i'm trying to plot a graph >> inside a window. i'm using rgplot and wxruby. i can plot using rgplot >> just fine. and i can create a window using wxruby. i just don't know how >> to combine the two. any ideas? where should i start learning? thanks!!! >> > It's not really clear what rgplot does from the home page, but I'm > assuming that it writes a chart of some sort to an image file eg a PNG. > > If that's right, the easiest way to combine it with wxRuby is to use > GnuPlot to write an image file, then paint that image file on a > Wx::Window using a DC (Device Context). The sample file > drawing/images.rb is a perfect simple example of how to do this. > > cheers > alex that's what i figured. one more question, where is the sample file "images.rb" located? thanks for your time! -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Jul 17 19:46:24 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 18 Jul 2008 00:46:24 +0100 Subject: [wxruby-users] wxruby and rgplot In-Reply-To: <0a8599762f0d4532f2f5de90669e8436@ruby-forum.com> References: <8c0626d88e1207eb9521bb130b253c39@ruby-forum.com> <487FCA43.3080002@pressure.to> <0a8599762f0d4532f2f5de90669e8436@ruby-forum.com> Message-ID: <487FD9D0.5070005@pressure.to> Philip Rutkowski wrote: > that's what i figured. one more question, where is the sample file > "images.rb" located? thanks for your time! > Assuming you installed via rubygems, somewhere inside your ruby/lib directory - something like ruby/lib/VERSION/gems/wxruby-VERSION/samples/drawing alex From Franz.Irlweg.ZNT at wacker.com Mon Jul 21 08:20:54 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Mon, 21 Jul 2008 14:20:54 +0200 Subject: [wxruby-users] how to set a font for the whol application Message-ID: Hi all, how can i set a special font for the whole application, so that all elments (inclusive MessageBox, TipWindow, ..) work with this font? (For a frame i can set the font, but then, only the inherited frames has setted this font.) Thanks in advance for any help, Franz

This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from
disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed.
If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further.
Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance.
 
Siltronic AG, Sitz München, Hanns-Seidel-Platz 4, 81737 München, Germany. Amtsgericht München HRB 150884
Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Peter-Alexander Wacker

-------------- next part -------------- An HTML attachment was scrubbed... URL: From Franz.Irlweg.ZNT at wacker.com Mon Jul 21 10:57:43 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Mon, 21 Jul 2008 16:57:43 +0200 Subject: [wxruby-users] how to set the font for the whole application Message-ID: Hi all, how can i set a special font for the whole application, so that all elments (inclusive MessageBox, TipWindow, ..) work with this font? (For a frame i can set the font, but then, only the inherited frames has setted this font.) Thanks in advance for any help, Franz

This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from
disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed.
If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further.
Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance.
 
Siltronic AG, Sitz München, Hanns-Seidel-Platz 4, 81737 München, Germany. Amtsgericht München HRB 150884
Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Peter-Alexander Wacker

-------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Mon Jul 21 12:15:45 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 21 Jul 2008 17:15:45 +0100 Subject: [wxruby-users] how to set a font for the whol application In-Reply-To: References: Message-ID: <4884B631.2090807@pressure.to> Hi Franz Irlweg, Franz (ZNT) wrote: > > how can i set a special font for the whole application, so that all > elments (inclusive MessageBox, TipWindow, ..) > work with this font? > > (For a frame i can set the font, but then, only the inherited frames > has setted this font.) > I'm afraid there's no method I know of that does this automatically across a whole application. Generally it is preferable that the font settings for MessageBox etc come from the user's own desktop settings, rather than being set by the application. alex From Franz.Irlweg.ZNT at wacker.com Tue Jul 22 04:07:48 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Tue, 22 Jul 2008 10:07:48 +0200 Subject: [wxruby-users] german umlauts Message-ID: Hi all, my wxruby application handles with data from a Oracle database. But i have problems with the german umlauts (?,?,?). I can write data to the database, but when i'm reading the data from the database, the application doesn't show the text. The application is running on a windows pc. Should i set some Locale .. ? Thanks in advance, Franz

This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from
disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed.
If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further.
Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance.
 
Siltronic AG, Sitz München, Hanns-Seidel-Platz 4, 81737 München, Germany. Amtsgericht München HRB 150884
Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Peter-Alexander Wacker

-------------- next part -------------- An HTML attachment was scrubbed... URL: From Franz.Irlweg.ZNT at wacker.com Tue Jul 22 04:04:42 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Tue, 22 Jul 2008 10:04:42 +0200 Subject: [wxruby-users] how to set a font for the whol application In-Reply-To: <4884B631.2090807@pressure.to> References: <4884B631.2090807@pressure.to> Message-ID: Thanks for the explanation, at least I know that it isn't possible. -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Monday, July 21, 2008 6:16 PM To: General discussion of wxRuby Subject: Re: [wxruby-users] how to set a font for the whol application Hi Franz Irlweg, Franz (ZNT) wrote: > > how can i set a special font for the whole application, so that all > elments (inclusive MessageBox, TipWindow, ..) work with this font? > > (For a frame i can set the font, but then, only the inherited frames > has setted this font.) > I'm afraid there's no method I know of that does this automatically across a whole application. Generally it is preferable that the font settings for MessageBox etc come from the user's own desktop settings, rather than being set by the application. alex _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at once so This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed. that we may take the appropriate action and avoid troubling you further. Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance. Siltronic AG, Sitz Muenchen, Hanns-Seidel-Platz 4, 81737 Muenchen, Germany. Amtsgericht Muenchen HRB 150884 Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Peter-Alexander Wacker From mario at ruby-im.net Tue Jul 22 04:35:30 2008 From: mario at ruby-im.net (Mario Steele) Date: Tue, 22 Jul 2008 03:35:30 -0500 Subject: [wxruby-users] german umlauts In-Reply-To: References: Message-ID: I believe that Oracle needs an encoding for Text Data, just like MySQL does. You would need to reference the documentation for your database back end, in order to correctly set the encoding options for your data. On Tue, Jul 22, 2008 at 3:07 AM, Irlweg, Franz (ZNT) < Franz.Irlweg.ZNT at wacker.com> wrote: > Hi all, > > my wxruby application handles with data from a Oracle database. But i have > problems with the german umlauts (?,?,?). > I can write data to the database, but when i'm reading the data from the > database, the application doesn't show the text. > > The application is running on a windows pc. > Should i set some Locale .. ? > > Thanks in advance, > Franz > > This communication and any files or attachments transmitted with it may > contain information that is copyrighted or confidential and exempt from > disclosure under applicable law. It is intended solely for the use of the > individual or the entity to which it is addressed. > If you are not the intended recipient, you are hereby notified that any > use, dissemination, or copying of this communication is strictly prohibited. > > If you have received this communication in error, please notify us at once > so that we may take the appropriate action and avoid troubling you further. > Thank you for your cooperation. Please contact your local IT staff or email > info at siltronic.com if you need > assistance. > > Siltronic AG, Sitz M?nchen, Hanns-Seidel-Platz 4, 81737 M?nchen, Germany. > Amtsgericht M?nchen HRB 150884 > Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, > Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: > Peter-Alexander Wacker > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Wed Jul 23 05:09:06 2008 From: lists at ruby-forum.com (=?utf-8?Q?Magnus_Sj=c3=b6strand?=) Date: Wed, 23 Jul 2008 11:09:06 +0200 Subject: [wxruby-users] Problems loading .xrc file Message-ID: <9921570db54f295d020503e1df69a4ca@ruby-forum.com> Hi, I'm trying to load a gui with a xrcise/.xrc combo. I've tried both with this trivial .xrc - which is just a frame with nothing in it - and a few more advanced which worked great when compiled to c++. I've tried both win xp sp2 and vista, ruby 1.8.6 from the one-click installer and 1.8.7, wxRuby (1.9.7) and wx_sugar (0.1.20) installed with gems. C:\Users\magnuss\workspace\TestProject>ruby main.rb 10:55:50: Error: Cannot load resources from file 'file:/C%3A/Users/magnuss/workspace/TestProject/noname.xrc'. c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.7-x86-mswin32/lib/wx/classes/xmlresource.rb:31:in `load': Failed to load XRC from 'noname.xrc'; check the file exists and is valid XML (RuntimeError) from ./forms.rb:16:in `initialize' from main.rb:10:in `new' from main.rb:10 The .xrc file is in the same directory as my main.rb, and does indeed exist :) Any ideas or tips would be greatly appreciated :) best regards, Magnus Sj?strand ===================================================== main.rb require "wx" require "forms" include Wx class MainWindow < MainWindowBase end MainWindow.new.main_loop ===================================================== noname.xrc 500,300 ===================================================== forms.rb class MainWindowBase < Wx::Frame def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("noname.xrc") xml.load_frame_subclass(self, parent, "MainFrame") finder = lambda do | x | int_id = Wx::xrcid(x) begin Wx::Window.find_window_by_id(int_id, self) || int_id # Temporary hack to work around regression in 1.9.2; remove # begin/rescue clause in later versions rescue RuntimeError int_id end end if self.class.method_defined? "on_init" self.on_init() end end end -- Posted via http://www.ruby-forum.com/. From magnus at aoeu.info Wed Jul 23 05:39:00 2008 From: magnus at aoeu.info (=?UTF-8?B?TWFnbnVzIEVuZ3N0csO2bQ==?=) Date: Wed, 23 Jul 2008 11:39:00 +0200 Subject: [wxruby-users] Problems loading .xrc file In-Reply-To: <9921570db54f295d020503e1df69a4ca@ruby-forum.com> References: <9921570db54f295d020503e1df69a4ca@ruby-forum.com> Message-ID: <4886FC34.8030504@aoeu.info> Hi Magnus, I'm using XRC on both Windows and Linux, and I'm usually building applications the same way, so I wrote a template to have a quick starting point. It should work fine on Windows too I think. Make sure to start it from the right directory though (double-clicking on wxtemplate should work), currently it looks for ui/ui.xrc relative to starting directory. /Magnus Magnus Sj?strand wrote: > Hi, > > I'm trying to load a gui with a xrcise/.xrc combo. I've tried both with > this trivial .xrc - which is just a frame with nothing in it - and a few > more advanced which worked great when compiled to c++. > > I've tried both win xp sp2 and vista, ruby 1.8.6 from the one-click > installer and 1.8.7, wxRuby (1.9.7) and wx_sugar (0.1.20) installed with > gems. > > C:\Users\magnuss\workspace\TestProject>ruby main.rb > 10:55:50: Error: Cannot load resources from file > 'file:/C%3A/Users/magnuss/workspace/TestProject/noname.xrc'. > c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.7-x86-mswin32/lib/wx/classes/xmlresource.rb:31:in > `load': Failed to load XRC from 'noname.xrc'; check the file exists > and is valid XML (RuntimeError) > from ./forms.rb:16:in `initialize' > from main.rb:10:in `new' > from main.rb:10 > > The .xrc file is in the same directory as my main.rb, and does indeed > exist :) > > Any ideas or tips would be greatly appreciated :) > > best regards, > Magnus Sj?strand > > ===================================================== > main.rb > > require "wx" > require "forms" > > include Wx > > class MainWindow < MainWindowBase > > end > > MainWindow.new.main_loop > ===================================================== > noname.xrc > > > > > > 500,300 > > > > ===================================================== > forms.rb > > class MainWindowBase < Wx::Frame > > def initialize(parent = nil) > super() > xml = Wx::XmlResource.get > xml.flags = 2 # Wx::XRC_NO_SUBCLASSING > xml.init_all_handlers > xml.load("noname.xrc") > xml.load_frame_subclass(self, parent, "MainFrame") > > finder = lambda do | x | > int_id = Wx::xrcid(x) > begin > Wx::Window.find_window_by_id(int_id, self) || int_id > # Temporary hack to work around regression in 1.9.2; remove > # begin/rescue clause in later versions > rescue RuntimeError > int_id > end > end > > if self.class.method_defined? "on_init" > self.on_init() > end > end > end -------------- next part -------------- A non-text attachment was scrubbed... Name: wxtemplate.zip Type: application/octet-stream Size: 4355 bytes Desc: not available URL: From lists at ruby-forum.com Wed Jul 23 05:53:39 2008 From: lists at ruby-forum.com (=?utf-8?Q?Magnus_Sj=c3=b6strand?=) Date: Wed, 23 Jul 2008 11:53:39 +0200 Subject: [wxruby-users] Problems loading .xrc file In-Reply-To: <4886FC34.8030504@aoeu.info> References: <9921570db54f295d020503e1df69a4ca@ruby-forum.com> <4886FC34.8030504@aoeu.info> Message-ID: <8b7d6627b9baed304ed22e002a7b5ac6@ruby-forum.com> Hi, thanks for the files, it works great and I'll see what differs yours from mine :) //Magnus -- Posted via http://www.ruby-forum.com/. From Franz.Irlweg.ZNT at wacker.com Thu Jul 24 01:37:26 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Thu, 24 Jul 2008 07:37:26 +0200 Subject: [wxruby-users] how to set a font for the whol application In-Reply-To: <4884B631.2090807@pressure.to> References: <4884B631.2090807@pressure.to> Message-ID: Hi Alex, my application is started from a dos-box. So, how can I change the "deskop settings" in the dos-box? (Changing the desktop settings for all applications is not possible!) Franz -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Monday, July 21, 2008 6:16 PM To: General discussion of wxRuby Subject: Re: [wxruby-users] how to set a font for the whol application Hi Franz Irlweg, Franz (ZNT) wrote: > > how can i set a special font for the whole application, so that all > elments (inclusive MessageBox, TipWindow, ..) work with this font? > > (For a frame i can set the font, but then, only the inherited frames > has setted this font.) > I'm afraid there's no method I know of that does this automatically across a whole application. Generally it is preferable that the font settings for MessageBox etc come from the user's own desktop settings, rather than being set by the application. alex _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at once so This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed. that we may take the appropriate action and avoid troubling you further. Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance. Siltronic AG, Sitz Muenchen, Hanns-Seidel-Platz 4, 81737 Muenchen, Germany. Amtsgericht Muenchen HRB 150884 Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Peter-Alexander Wacker From Franz.Irlweg.ZNT at wacker.com Thu Jul 24 02:24:09 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Thu, 24 Jul 2008 08:24:09 +0200 Subject: [wxruby-users] german umlauts In-Reply-To: References: Message-ID: Hi Mario, could you send me a code snippet with the encoding settings for MYSQL? Franz ________________________________ From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Mario Steele Sent: Tuesday, July 22, 2008 10:36 AM To: General discussion of wxRuby Subject: Re: [wxruby-users] german umlauts I believe that Oracle needs an encoding for Text Data, just like MySQL does. You would need to reference the documentation for your database back end, in order to correctly set the encoding options for your data. On Tue, Jul 22, 2008 at 3:07 AM, Irlweg, Franz (ZNT) wrote: Hi all, my wxruby application handles with data from a Oracle database. But i have problems with the german umlauts (?,?,?). I can write data to the database, but when i'm reading the data from the database, the application doesn't show the text. The application is running on a windows pc. Should i set some Locale .. ? Thanks in advance, Franz This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed. If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further. Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance. Siltronic AG, Sitz M?nchen, Hanns-Seidel-Platz 4, 81737 M?nchen, Germany. Amtsgericht M?nchen HRB 150884 Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Peter-Alexander Wacker _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/

This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from
disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed.
If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further.
Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance.
 
Siltronic AG, Sitz München, Hanns-Seidel-Platz 4, 81737 München, Germany. Amtsgericht München HRB 150884
Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Peter-Alexander Wacker

-------------- next part -------------- An HTML attachment was scrubbed... URL: From bureaux.sebastien at neuf.fr Fri Jul 25 03:57:35 2008 From: bureaux.sebastien at neuf.fr (sebastien) Date: Fri, 25 Jul 2008 09:57:35 +0200 Subject: [wxruby-users] compileur Message-ID: Bonjour ? tous. J'ai vu plus haut des messages sur "Rubyscript2exe". Est-ce qu'il y ? d'autres compileurs que "Rubyscript2exe" pour convertir les applications cr?er avec "wxruby" en ex?cutable? J'aimerai pouvoir en utiliser d'autres. merci sebastien http://beusse.liveror.com/ -------------- section suivante -------------- Une pi?ce jointe HTML a ?t? nettoy?e... URL: From mario at ruby-im.net Fri Jul 25 06:53:52 2008 From: mario at ruby-im.net (Mario Steele) Date: Fri, 25 Jul 2008 05:53:52 -0500 Subject: [wxruby-users] compileur In-Reply-To: References: Message-ID: On Fri, Jul 25, 2008 at 2:57 AM, sebastien wrote: > Bonjour ? tous. > J'ai vu plus haut des messages sur "Rubyscript2exe". > Est-ce qu'il y ? d'autres compileurs que "Rubyscript2exe" pour convertir > les applications cr?er avec "wxruby" en ex?cutable? > J'aimerai pouvoir en utiliser d'autres. > [Hello everyone. I saw earlier messages on "Rubyscript2exe." Is there to other compilers that "Rubyscript2exe" to convert to create applications with "wxruby" executable? I'd like to be able to use other.] Bonjour sebastien, Il n'existe actuellement que deux compilateurs pour Ruby lui-m?me. RubyScript2exe est une option, l'autre est Exerb. En g?n?ral, les gens ont plus d'exp?rience avec une meilleure RubyScript2exe lors de la cr?ation d'applications wxRuby. [There is currently only two compilers for Ruby itself. RubyScript2exe is one option, the other is Exerb. Generally, people have more better experiences with RubyScript2exe when creating wxRuby applications.] Je travaille actuellement sur un compilateur pour le syst?me appel? Ruby Ruby environnement virtuel, ou RVE en abr?g?. Il fonctionne sur Windows, Linux et Macintosh OS X. [I am currently working on a compiler system for Ruby called Ruby Virtual Environment, or RVE for short. It will work on Windows, Linux and Macintosh OS X.] Actuellement, cependant, cela est encore dans conceptuel, et phases de conception, rien d'officiel encore. Il faut esp?rer que ce ne sera pas loin, mais pas garuntee aussi de cette ?poque. [Currently though, this is still in conceptual, and design stages, nothing official yet. Hopefully this will not be that far away, but no garuntee's as of this time.] Mario Steele -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From bureaux.sebastien at neuf.fr Fri Jul 25 07:52:14 2008 From: bureaux.sebastien at neuf.fr (sebastien) Date: Fri, 25 Jul 2008 13:52:14 +0200 Subject: [wxruby-users] compileur Message-ID: Bonjour Mario, j'ai d?j? essayer avec "Exerb", mais je n'ai rien compris. A chaque fois que j'ai t?l?charger la notice explicative de "Exerb" elle n'?tait pas en anglais ou en fran?ais (peut-?tre un dialecte). Si tu peut me donner un lien ou t?l?charger "Exerb" et quelques conseils pour que je comprenne le fonctionnement, ce serait sympa. Par contre, le jour ou ton compileur sera fonctionnel, poste un message pour le signal? pour que je le t?l?charge. merci sebastien http://beusse.liveror.com/ -------------- section suivante -------------- Une pi?ce jointe HTML a ?t? nettoy?e... URL: From lists at ruby-forum.com Fri Jul 25 15:53:17 2008 From: lists at ruby-forum.com (Luiz Macchi) Date: Fri, 25 Jul 2008 21:53:17 +0200 Subject: [wxruby-users] wxRuby code examples ! Message-ID: Hi all ! I am new at wxRuby and need more code examples to learn better ! I?m searching in the Net but all with simple examples and i cant understand somethings yet... Any special place to see some codes ? thanks any help -- Posted via http://www.ruby-forum.com/. From s.boolean at gmail.com Fri Jul 25 16:27:01 2008 From: s.boolean at gmail.com (=?ISO-8859-1?Q?Fernando_S=E1enz?=) Date: Fri, 25 Jul 2008 17:27:01 -0300 Subject: [wxruby-users] wxRuby code examples ! In-Reply-To: References: Message-ID: <5c37935e0807251327m3add5104uee29f36d0d8f3d72@mail.gmail.com> Welcome to WxRuby! specifically what things do not understand?? On Fri, Jul 25, 2008 at 4:53 PM, Luiz Macchi wrote: > Hi all ! I am new at wxRuby and need more code examples to learn better > ! > I?m searching in the Net but all with simple examples and i cant > understand somethings yet... > > Any special place to see some codes ? > > thanks any help > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Jul 25 17:01:50 2008 From: lists at ruby-forum.com (Luiz Macchi) Date: Fri, 25 Jul 2008 23:01:50 +0200 Subject: [wxruby-users] wxRuby code examples ! In-Reply-To: <5c37935e0807251327m3add5104uee29f36d0d8f3d72@mail.gmail.com> References: <5c37935e0807251327m3add5104uee29f36d0d8f3d72@mail.gmail.com> Message-ID: <58113d77c832909faa3949af3fd0091c@ruby-forum.com> Fernando S?enz wrote: > Welcome to WxRuby! > > specifically what things do not understand?? For example, i cant yet to center a Frame on the display ! Right, the API is there ! I?m using.. Frame#centre centre(Integer direction = BOTH) Centres the frame on the display. Parameters * direction The parameter may be HORIZONTAL, VERTICAL or BOTH. but it dont work :-( so I sure i?m doing something wrong, and cant understand yet to join create the controls, events, layouts all the things together etc... -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Fri Jul 25 18:46:12 2008 From: mario at ruby-im.net (Mario Steele) Date: Fri, 25 Jul 2008 17:46:12 -0500 Subject: [wxruby-users] compileur In-Reply-To: References: Message-ID: 2008/7/25 sebastien > Bonjour Mario, > j'ai d?j? essayer avec "Exerb", mais je n'ai rien compris. > A chaque fois que j'ai t?l?charger la notice explicative de "Exerb" elle > n'?tait pas en anglais ou en fran?ais (peut-?tre un dialecte). > Si tu peut me donner un lien ou t?l?charger "Exerb" et quelques conseils > pour que je comprenne le fonctionnement, ce serait sympa. > Par contre, le jour ou ton compileur sera fonctionnel, poste un message > pour le signal? pour que je le t?l?charge. > [Hello Mario, I already try with "Exerb" but I did not understand. Whenever I download the leaflet "Exerb" it was not in English or french (perhaps a dialect). If you can give me a link or download Exerb "and some advice so I understand how it would be nice. By cons, day or your compiler will be functional, post a message for which I reported for download.] Bonjour Sebastien, Exerb est fait par un petit nombre de plus au Japon, si la page principale de la langue se fait en japonais. Ils ont tr?s peu de documents en anglais, et il est difficile de traquer les informations dont vous avez besoin de cr?er un programme. Les avantages et les inconv?nients de Exerb, est assez simple. Avantages: Votre code ne doit pas extraites d'ex?cuter, ? l'instar de ce qui est fait avec RubyScript2exe, les seules parties qui sont extraites, sont les extensions compil?es, alors que d'autres, votre code reste dans l'ex?cutable. Que, dans mon livre est un grand pro. Toutefois, les inconv?nients sont que Exerb s'applique uniquement ? Windows, de sorte qu'il ne fonctionne pas sous Linux ou Mac OS X. En ce qui concerne mon compilateur, comme je l'ai dit avant, il est encore au stade de la planification, le contr?le des id?es diff?rentes. Il ne sera pas pr?t pour un certain temps. Pour t?l?charger Exerb, si vous ?tes toujours int?ress?, vous pouvez l'obtenir ici: http://downloads.sourceforge.jp/exerb/25874/exerb-4.2.0.zip Comme pour les instructions, je ne peux pas vous donner beaucoup, il 'll ?tre ? peu pr?s d'essai et erreur. Les bases, apr?s l'installation par exerb rubis setup.rb. Vous pouvez utiliser la mkexy myapp.rb Cette recette cr?e un fichier, que l'avenir nous le dira Exerb compilateur, de r?cup?rer tous les fichiers associ?s ? votre projet, et quel type d'application de votre cr?ation, cui pour la console, et interface graphique pour l'interface utilisateur graphique . Apr?s cela, puis vous ex?cutez exerb myapp.exy, qui permettra de cr?er l'application finale. Au-del? de cela, il n'ya pas grand chose, je peux sugg?rer, comme il est ? peu pr?s un succ?s manquez ou si cela fonctionnera ou non. J'ai assez bien eu des r?sultats mitig?s avec elle, comme d'autres l'ont ici aussi. Je vous souhaite bonne chance ? cet ?gard. [Exerb is done by a few over in Japan, so the main page's language is done in Japanese. They have very few docs in English, and it is hard to track down information you need to create a program. The Pros and Cons of Exerb, is pretty simple. Pros: Your code doesn't get extracted to execute, like what is done with RubyScript2exe, the only parts that get extracted, are the compiled extensions, other then that, your code remains in the Executable. That in my book is a major Pro. However, the cons are that Exerb is Windows only, so it doesn't work on Linux or Mac OS X. As for my compiler, as I stated before, it's still in the planning stage, testing various ideas. It won't be ready for a while. To download Exerb, if you are still interested, you can get it here: http://downloads.sourceforge.jp/exerb/25874/exerb-4.2.0.zip As for instructions, I can't give you much, it'll be pretty much trial and error. The basics, is after you install exerb through ruby setup.rb. You would use the mkexy myapp.rb This creates a recipe file, that will tell the Exerb compiler, to grab all of the files associated with your project, and what kind of application your creating, cui for console, and gui for Graphic User Interface. After that, then you would run exerb myapp.exy, which will create the final application. Beyond that, there's not much I can suggest, as it's pretty much a hit or miss on if it will work or not. I've pretty much had mixed results with it, as others have here as well. I wish you luck in this. ] -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sun Jul 27 14:06:09 2008 From: lists at ruby-forum.com (Niklas Baumstark) Date: Sun, 27 Jul 2008 20:06:09 +0200 Subject: [wxruby-users] Filling clipboard doesn't work Message-ID: <4a262246c56b9d257d2a0729a4b9eed8@ruby-forum.com> Hello, I ran into a bit of trouble with my first wxRuby application. I'm using ruby 1.8.6 with wxRuby 1.9.7 on x86 Linux (Ubuntu). Didn't test any other platform yet. In my application, I'm trying to access the clipboard like this: Wx::Clipboard.open do |clip| clip.set_data Wx::TextDataObject.new("TEST") clip.flush end This doesn't work. While running the app (after the execution of the above code), the menu entry "Paste" is enabled in other applications, but nothing is in the clipboard (at least nothing happens on pasting). After quitting my application, the menu entry is disabled again and the clipboard is empty. How do I access the clip properly? I still got another question: Is it possible to send key-messages to other apps using wxWidgets? Greeting, Niklas Baumstark -- Posted via http://www.ruby-forum.com/. From Franz.Irlweg.ZNT at wacker.com Mon Jul 28 05:44:50 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Mon, 28 Jul 2008 11:44:50 +0200 Subject: [wxruby-users] setting button colour on 1.9.5 Message-ID: Hi all, i'm working with wxruby 1.9.5 on windows. Trying to set the background colour for a button does not work! Thanks for any help, Franz

This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from
disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed.
If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further.
Thank you for your cooperation. Please contact your local IT staff or email info at siltronic.com if you need assistance.
 
Siltronic AG, Sitz München, Hanns-Seidel-Platz 4, 81737 München, Germany. Amtsgericht München HRB 150884
Vorstand: Wilhelm Sittenthaler (Vorsitz), Gerhard Brehm, Paul Lindblad, Joachim Manke, Michael Peterat. Vorsitzender des Aufsichtsrats: Peter-Alexander Wacker

-------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Mon Jul 28 08:17:19 2008 From: lists at ruby-forum.com (Niklas Baumstark) Date: Mon, 28 Jul 2008 14:17:19 +0200 Subject: [wxruby-users] wxRuby code examples ! In-Reply-To: <58113d77c832909faa3949af3fd0091c@ruby-forum.com> References: <5c37935e0807251327m3add5104uee29f36d0d8f3d72@mail.gmail.com> <58113d77c832909faa3949af3fd0091c@ruby-forum.com> Message-ID: Luiz Macchi wrote: > but it dont work :-( frame.centre(Wx::BOTH) works for me. -- Posted via http://www.ruby-forum.com/. From damnbigman at gmail.com Mon Jul 28 14:27:28 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Mon, 28 Jul 2008 12:27:28 -0600 Subject: [wxruby-users] Segfault with GridCellChoiceEditor Message-ID: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> I have a problem. In my application I have a few Grid objects in a Notebook. The Grid objects are populated via GridTableBase. Certain Grid cells need to have a choice interface (I'm artificially enforcing foreign key constraints). All this works to the point where you try to edit the value for that cell. The choice box renders (i.e. the drop down arrow appears) then the application segfaults. Unfortunately I'm stuck developing this in a Windows (XP) environment so I can't do much with the segfault. Any help would be most appreciated. Thanks, Glen Holcomb -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Tue Jul 29 06:37:41 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 29 Jul 2008 11:37:41 +0100 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> Message-ID: <488EF2F5.5020003@pressure.to> Hi Glen Glen Holcomb wrote: > In my application I have a few Grid objects in a Notebook. The Grid > objects are populated via GridTableBase. Certain Grid cells need to > have a choice interface (I'm artificially enforcing foreign key > constraints). All this works to the point where you try to edit the > value for that cell. The choice box renders (i.e. the drop down arrow > appears) then the application segfaults. Unfortunately I'm stuck > developing this in a Windows (XP) environment so I can't do much with > the segfault. Any help would be most appreciated. The problem here is the combination of GridTableBase and cell editors / renderers, which makes the memory management very tricky. It's noted as a bug here: http://rubyforge.org/tracker/index.php?func=detail&aid=19187&group_id=35&atid=218 I don't know how to fix it in the library, but you should be able to work around it by storing the cell editor in an instance variable somewhere. Then ruby will mark it and preserve it from GC. From the code you posted on c.l.r (please do post code on this mailing list as well) def get_attr(row, col, attr_kind) attr = Wx::GridCellAttr.new if @db_table == "computers" and col == 4 ## INSTEAD OF THIS # attr.set_editor(Wx::GridCellChoiceEditor.new(["CAD", "GIS", "CMT"])) ## TRY THIS @editors ||= [] @editors << Wx::GridCellChoiceEditor.new(["CAD", "GIS", "CMT"]) attr.set_editor(@editors.last) end attr end hth alex From alex at pressure.to Tue Jul 29 06:40:15 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 29 Jul 2008 11:40:15 +0100 Subject: [wxruby-users] setting button colour on 1.9.5 In-Reply-To: References: Message-ID: <488EF38F.3030906@pressure.to> Hi Franz Irlweg, Franz (ZNT) wrote: > > i'm working with wxruby 1.9.5 on windows. > Trying to set the background colour for a button does not work! > The background colour for a standard OS button will come from the user's desktop theme. Because these are native widgets, on most desktops this standard colour can't be changed - this is a feature not a bug ;) as it keeps applications consistent with respective GUI standards. If you really must have multi-coloured buttons, use Wx::BitmapButton. hth alex From alex at pressure.to Tue Jul 29 06:56:15 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 29 Jul 2008 11:56:15 +0100 Subject: [wxruby-users] compileur In-Reply-To: References: Message-ID: <488EF74F.9030309@pressure.to> sebastien wrote: > Bonjour ? tous. > J'ai vu plus haut des messages sur "Rubyscript2exe". > Est-ce qu'il y ? d'autres compileurs que "Rubyscript2exe" pour > convertir les applications cr?er avec "wxruby" en ex?cutable? > J'aimerai pouvoir en utiliser d'autres. Mario t'a deja d?crit les choix - seulement "exerb" ou "rubyscript2exe". Comme toi, je cherchais un autre - ni l'un ni l'autre me satisfait. [ Mario's already described to you the choices - only "exerb" or "rubyscript2exe". Like you, I was looking for another - neither really satisfied me] Pour l'application Weft QDA, j'ai cr?e un syst?me (avec Rake) qui ramasse tous les fichiers dont l'application a besoin, et une installation minimale de ruby. Donc, je me sers de NSIS (sur Windows) et Platypus+dmg (sur OS X) a faire un installer qu'on peut telecharger. Ca marche bien - l'application commence plus vite, le fichier est plus petit, il est facile d'inclure de la data] [For Weft QDA I created a system - using rake - which collects all the files required by the application, and a minimal ruby installation. Then, I use NSIS (on Windows) and Platypus + dmg (on OS X) to make an installer which can be downloaded. It works well - the appplicatin starts faster, the file is smaller, and it's easy to include data] Ce petit script trouve tous les fichiers: [This little script finds all the library files] http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/assemble_libraries.rb Rakefiles: http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/rake_assemble.rb http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/rake_mswin.rb http://weft-qda.rubyforge.org/svn/trunk/weft-qda/rake/rake_osx.rb alex From damnbigman at gmail.com Tue Jul 29 09:28:15 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Tue, 29 Jul 2008 07:28:15 -0600 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <488EF2F5.5020003@pressure.to> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> <488EF2F5.5020003@pressure.to> Message-ID: <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> On Tue, Jul 29, 2008 at 4:37 AM, Alex Fenton wrote: > Hi Glen > > Glen Holcomb wrote: > >> In my application I have a few Grid objects in a Notebook. The Grid >> objects are populated via GridTableBase. Certain Grid cells need to have a >> choice interface (I'm artificially enforcing foreign key constraints). All >> this works to the point where you try to edit the value for that cell. The >> choice box renders (i.e. the drop down arrow appears) then the application >> segfaults. Unfortunately I'm stuck developing this in a Windows (XP) >> environment so I can't do much with the segfault. Any help would be most >> appreciated. >> > The problem here is the combination of GridTableBase and cell editors / > renderers, which makes the memory management very tricky. It's noted as a > bug here: > > http://rubyforge.org/tracker/index.php?func=detail&aid=19187&group_id=35&atid=218 > > I don't know how to fix it in the library, but you should be able to work > around it by storing the cell editor in an instance variable somewhere. Then > ruby will mark it and preserve it from GC. From the code you posted on c.l.r > (please do post code on this mailing list as well) > > def get_attr(row, col, attr_kind) > attr = Wx::GridCellAttr.new > > if @db_table == "computers" and col == 4 > ## INSTEAD OF THIS > # attr.set_editor(Wx::GridCellChoiceEditor.new(["CAD", "GIS", "CMT"])) > ## TRY THIS > @editors ||= [] > @editors << Wx::GridCellChoiceEditor.new(["CAD", "GIS", "CMT"]) > attr.set_editor(@editors.last) > end > > attr > end > > hth > alex > > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > Thanks Alex, I'll give that a shot and let you know how it turns out. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From damnbigman at gmail.com Tue Jul 29 09:34:29 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Tue, 29 Jul 2008 07:34:29 -0600 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> <488EF2F5.5020003@pressure.to> <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> Message-ID: <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> On Tue, Jul 29, 2008 at 7:28 AM, Glen Holcomb wrote: > On Tue, Jul 29, 2008 at 4:37 AM, Alex Fenton wrote: > >> Hi Glen >> >> Glen Holcomb wrote: >> >>> In my application I have a few Grid objects in a Notebook. The Grid >>> objects are populated via GridTableBase. Certain Grid cells need to have a >>> choice interface (I'm artificially enforcing foreign key constraints). All >>> this works to the point where you try to edit the value for that cell. The >>> choice box renders (i.e. the drop down arrow appears) then the application >>> segfaults. Unfortunately I'm stuck developing this in a Windows (XP) >>> environment so I can't do much with the segfault. Any help would be most >>> appreciated. >>> >> The problem here is the combination of GridTableBase and cell editors / >> renderers, which makes the memory management very tricky. It's noted as a >> bug here: >> >> http://rubyforge.org/tracker/index.php?func=detail&aid=19187&group_id=35&atid=218 >> >> I don't know how to fix it in the library, but you should be able to work >> around it by storing the cell editor in an instance variable somewhere. Then >> ruby will mark it and preserve it from GC. From the code you posted on c.l.r >> (please do post code on this mailing list as well) >> >> def get_attr(row, col, attr_kind) >> attr = Wx::GridCellAttr.new >> >> if @db_table == "computers" and col == 4 >> ## INSTEAD OF THIS >> # attr.set_editor(Wx::GridCellChoiceEditor.new(["CAD", "GIS", "CMT"])) >> ## TRY THIS >> @editors ||= [] >> @editors << Wx::GridCellChoiceEditor.new(["CAD", "GIS", "CMT"]) >> attr.set_editor(@editors.last) >> end >> >> attr >> end >> >> hth >> alex >> >> >> >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > Thanks Alex, I'll give that a shot and let you know how it turns out. > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > Okay back sooner than I thought, turns out I had the code here at home after all. Still no go. I tried GC.disable at the top of the app too and I get the same exact behavior. The dropdown menu renders for a split second then it reverts to looking like the default cell. After that any attempt to interact with the app causes the segfault. Oddly it doesn't segfault immediately and will infact continue to run until I click anywhere in the window. Returning focus to the app doesn't kill it either. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From damnbigman at gmail.com Tue Jul 29 09:42:48 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Tue, 29 Jul 2008 07:42:48 -0600 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> <488EF2F5.5020003@pressure.to> <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> Message-ID: <48800a90807290642j4ec9d1abo7353a8c28892eb1f@mail.gmail.com> On Tue, Jul 29, 2008 at 7:34 AM, Glen Holcomb wrote: > On Tue, Jul 29, 2008 at 7:28 AM, Glen Holcomb wrote: > >> On Tue, Jul 29, 2008 at 4:37 AM, Alex Fenton wrote: >> >>> Hi Glen >>> >>> Glen Holcomb wrote: >>> >>>> In my application I have a few Grid objects in a Notebook. The Grid >>>> objects are populated via GridTableBase. Certain Grid cells need to have a >>>> choice interface (I'm artificially enforcing foreign key constraints). All >>>> this works to the point where you try to edit the value for that cell. The >>>> choice box renders (i.e. the drop down arrow appears) then the application >>>> segfaults. Unfortunately I'm stuck developing this in a Windows (XP) >>>> environment so I can't do much with the segfault. Any help would be most >>>> appreciated. >>>> >>> The problem here is the combination of GridTableBase and cell editors / >>> renderers, which makes the memory management very tricky. It's noted as a >>> bug here: >>> >>> http://rubyforge.org/tracker/index.php?func=detail&aid=19187&group_id=35&atid=218 >>> >>> I don't know how to fix it in the library, but you should be able to work >>> around it by storing the cell editor in an instance variable somewhere. Then >>> ruby will mark it and preserve it from GC. From the code you posted on c.l.r >>> (please do post code on this mailing list as well) >>> >>> def get_attr(row, col, attr_kind) >>> attr = Wx::GridCellAttr.new >>> >>> if @db_table == "computers" and col == 4 >>> ## INSTEAD OF THIS >>> # attr.set_editor(Wx::GridCellChoiceEditor.new(["CAD", "GIS", "CMT"])) >>> ## TRY THIS >>> @editors ||= [] >>> @editors << Wx::GridCellChoiceEditor.new(["CAD", "GIS", "CMT"]) >>> attr.set_editor(@editors.last) >>> end >>> >>> attr >>> end >>> >>> hth >>> alex >>> >>> >>> >>> >>> _______________________________________________ >>> wxruby-users mailing list >>> wxruby-users at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wxruby-users >>> >> >> Thanks Alex, I'll give that a shot and let you know how it turns out. >> >> -- >> "Hey brother Christian with your high and mighty errand, Your actions >> speak so loud, I can't hear a word you're saying." >> >> -Greg Graffin (Bad Religion) >> > > Okay back sooner than I thought, turns out I had the code here at home > after all. Still no go. I tried GC.disable at the top of the app too and I > get the same exact behavior. > > The dropdown menu renders for a split second then it reverts to looking > like the default cell. After that any attempt to interact with the app > causes the segfault. > > Oddly it doesn't segfault immediately and will infact continue to run until > I click anywhere in the window. Returning focus to the app doesn't kill it > either. > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > Okay check that, I really need to be more thorough in my testing. I can switch to other tabs in the notebook and edit cells in other Grids however upon going back to the grid where I tried to edit the Choice Value attempting to interact with any part of the grid causes death. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Tue Jul 29 09:47:04 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 29 Jul 2008 14:47:04 +0100 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> <488EF2F5.5020003@pressure.to> <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> Message-ID: <488F1F58.7020503@pressure.to> Glen Holcomb wrote: > Okay back sooner than I thought, turns out I had the code here at home > after all. Still no go. I tried GC.disable at the top of the app too > and I get the same exact behavior. > > The dropdown menu renders for a split second then it reverts to > looking like the default cell. After that any attempt to interact > with the app causes the segfault. > > Oddly it doesn't segfault immediately and will infact continue to run > until I click anywhere in the window. Returning focus to the app > doesn't kill it either. OK - sorry it didn't help - could you post a small but complete example that reproduces the issue so I can try it out and run it under a debugger please? thanks alex From damnbigman at gmail.com Tue Jul 29 10:39:21 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Tue, 29 Jul 2008 08:39:21 -0600 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <488F1F58.7020503@pressure.to> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> <488EF2F5.5020003@pressure.to> <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> <488F1F58.7020503@pressure.to> Message-ID: <48800a90807290739o2f642e91h2205b04db0f7e6a@mail.gmail.com> On Tue, Jul 29, 2008 at 7:47 AM, Alex Fenton wrote: > Glen Holcomb wrote: > >> Okay back sooner than I thought, turns out I had the code here at home >> after all. Still no go. I tried GC.disable at the top of the app too and I >> get the same exact behavior. >> >> The dropdown menu renders for a split second then it reverts to looking >> like the default cell. After that any attempt to interact with the app >> causes the segfault. >> >> Oddly it doesn't segfault immediately and will infact continue to run >> until I click anywhere in the window. Returning focus to the app doesn't >> kill it either. >> > OK - sorry it didn't help - could you post a small but complete example > that reproduces the issue so I can try it out and run it under a debugger > please? > > thanks > > alex > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > That's a good question :) I'll see what I can come up with. It might just be easier to send you the whole thing though as I'm using a sqlite database backend and Sequel, which could be contributing to or causing the problem. I'll see if I can get something small that will re-create the problem though. -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From damnbigman at gmail.com Tue Jul 29 11:05:17 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Tue, 29 Jul 2008 09:05:17 -0600 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <48800a90807290739o2f642e91h2205b04db0f7e6a@mail.gmail.com> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> <488EF2F5.5020003@pressure.to> <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> <488F1F58.7020503@pressure.to> <48800a90807290739o2f642e91h2205b04db0f7e6a@mail.gmail.com> Message-ID: <48800a90807290805q2d0f9b0bqcea59e8e5ade5ce9@mail.gmail.com> On Tue, Jul 29, 2008 at 8:39 AM, Glen Holcomb wrote: > On Tue, Jul 29, 2008 at 7:47 AM, Alex Fenton wrote: > >> Glen Holcomb wrote: >> >>> Okay back sooner than I thought, turns out I had the code here at home >>> after all. Still no go. I tried GC.disable at the top of the app too and I >>> get the same exact behavior. >>> >>> The dropdown menu renders for a split second then it reverts to looking >>> like the default cell. After that any attempt to interact with the app >>> causes the segfault. >>> >>> Oddly it doesn't segfault immediately and will infact continue to run >>> until I click anywhere in the window. Returning focus to the app doesn't >>> kill it either. >>> >> OK - sorry it didn't help - could you post a small but complete example >> that reproduces the issue so I can try it out and run it under a debugger >> please? >> >> thanks >> >> alex >> >> >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > > That's a good question :) I'll see what I can come up with. It might just > be easier to send you the whole thing though as I'm using a sqlite database > backend and Sequel, which could be contributing to or causing the problem. > > I'll see if I can get something small that will re-create the problem > though. > > -- > "Hey brother Christian with your high and mighty errand, Your actions speak > so loud, I can't hear a word you're saying." > > -Greg Graffin (Bad Religion) > Okay Alex, I've got it down to 225 lines, not short but I think it's the shortest I can do without possibly trivializing the issue. I'm going to try attaching the file as it is a bit long and since I've stripped the code for adding db records (for brevity's sake) I will need to attach a db file as well. I'm not sure if the list will allow attachments though so if not let me know. -Glen -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: seg_repro.rb Type: application/octet-stream Size: 6758 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: circadian.db Type: application/octet-stream Size: 8192 bytes Desc: not available URL: From bureaux.sebastien at neuf.fr Tue Jul 29 12:26:52 2008 From: bureaux.sebastien at neuf.fr (sebastien) Date: Tue, 29 Jul 2008 18:26:52 +0200 Subject: [wxruby-users] compileur Message-ID: <4B8B2E63D95D40D3855386B452666FDA@sebastien> Bonjour Alex. Peut tu m'expliquer plus en d?tail ce qu'il faut faire avec "rake_assemble.rb" et "NSIS"? Pour le moment j'ai installer "NSIS". Par contre je n'ai pas encore eu le temps de lire l'aide de "NSIS", ce que je vais faire d'ici peu. merci sebastien http://beusse.liveror.com/ -------------- section suivante -------------- Une pi?ce jointe HTML a ?t? nettoy?e... URL: From alex at pressure.to Wed Jul 30 04:17:51 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 30 Jul 2008 09:17:51 +0100 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <48800a90807290805q2d0f9b0bqcea59e8e5ade5ce9@mail.gmail.com> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> <488EF2F5.5020003@pressure.to> <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> <488F1F58.7020503@pressure.to> <48800a90807290739o2f642e91h2205b04db0f7e6a@mail.gmail.com> <48800a90807290805q2d0f9b0bqcea59e8e5ade5ce9@mail.gmail.com> Message-ID: <489023AF.5000703@pressure.to> Glen Holcomb wrote: > Okay Alex, > > I've got it down to 225 lines, not short but I think it's the shortest > I can do without possibly trivializing the issue. I'm going to try > attaching the file as it is a bit long and since I've stripped the > code for adding db records (for brevity's sake) I will need to attach > a db file as well. I'm not sure if the list will allow attachments > though so if not let me know. Thanks Glen - I ran your code with a debug build which turned up what looks to be the source of the error: [Debug] 08:47:15: ../src/generic/grid.cpp(495): assert "m_control" failed in Show(): The wxGridCellEditor must be created first! Further poking with the debugger suggests that what's happening is that somehow the editor is getting created but not correctly found when it comes to editing the cell. Unfortunately after an hour or two I couldn't get to the root of the problem. My suggested workaround would be to dispense with GridTableBase and use Wx::Grid and Wx::Grid.set_editor directly to link your sequel model with the GUI. This may be slightly less elegant but shouldn't involve any more code. The samples/grid/grid.rb demonstrates this. I've filed it as a bug on our tracker http://rubyforge.org/tracker/index.php?func=detail&aid=21389&group_id=35&atid=218 alex From damnbigman at gmail.com Wed Jul 30 09:19:36 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Wed, 30 Jul 2008 07:19:36 -0600 Subject: [wxruby-users] Segfault with GridCellChoiceEditor In-Reply-To: <489023AF.5000703@pressure.to> References: <48800a90807281127n1507f9fdn77c36c7410b2aa97@mail.gmail.com> <488EF2F5.5020003@pressure.to> <48800a90807290628g389db8acg1cac2b06672ee833@mail.gmail.com> <48800a90807290634s4fb43ff4nd1a487616e9e5aba@mail.gmail.com> <488F1F58.7020503@pressure.to> <48800a90807290739o2f642e91h2205b04db0f7e6a@mail.gmail.com> <48800a90807290805q2d0f9b0bqcea59e8e5ade5ce9@mail.gmail.com> <489023AF.5000703@pressure.to> Message-ID: <48800a90807300619l258671bbpd1a7001d3e1a7bbf@mail.gmail.com> On Wed, Jul 30, 2008 at 2:17 AM, Alex Fenton wrote: > Glen Holcomb wrote: > >> Okay Alex, >> >> I've got it down to 225 lines, not short but I think it's the shortest I >> can do without possibly trivializing the issue. I'm going to try attaching >> the file as it is a bit long and since I've stripped the code for adding db >> records (for brevity's sake) I will need to attach a db file as well. I'm >> not sure if the list will allow attachments though so if not let me know. >> > Thanks Glen - I ran your code with a debug build which turned up what looks > to be the source of the error: > > [Debug] 08:47:15: ../src/generic/grid.cpp(495): assert "m_control" failed > in Show(): The wxGridCellEditor must be created first! > > Further poking with the debugger suggests that what's happening is that > somehow the editor is getting created but not correctly found when it comes > to editing the cell. Unfortunately after an hour or two I couldn't get to > the root of the problem. > > My suggested workaround would be to dispense with GridTableBase and use > Wx::Grid and Wx::Grid.set_editor directly to link your sequel model with the > GUI. This may be slightly less elegant but shouldn't involve any more code. > The samples/grid/grid.rb demonstrates this. > > I've filed it as a bug on our tracker > > http://rubyforge.org/tracker/index.php?func=detail&aid=21389&group_id=35&atid=218 > > > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > Thanks Alex, I really appreciate all your effort on this. I'll switch it to just Wx::Grid for now, I don't think I'll have any huge db tables at least not at first so it should work okay. -Glen -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From erubin at valcom.com Wed Jul 30 10:31:13 2008 From: erubin at valcom.com (Eric Rubin) Date: Wed, 30 Jul 2008 10:31:13 -0400 Subject: [wxruby-users] Crash in evt_menu In-Reply-To: <48800a90807300619l258671bbpd1a7001d3e1a7bbf@mail.gmail.com> Message-ID: <008901c8f250$eb2c65c0$a50ba8c0@valcom.com> I'm trying to create a TaskBarIcon with a right-click menu but I get a crash (in the evt_menu call) as soon as I right-click on the icon. Here's the error message: C:/Projects/SoftPhone1/lib/SoftPhone.rb:35:in `process_event': Swig director type mismatch in output value of type 'wxMenu *' (TypeError) (The rescue doesn't catch the error). Here's the code (it doesn't matter which variant of the evt_menu call I use): class SysTrayIcon < TaskBarIcon def initialize(parent) super() @softPhone = parent # soft_phone_frame icon = Icon.new("icons/phone.ico", BITMAP_TYPE_ICO) set_icon(icon, "Valcom VIP Page") end def create_popup_menu menu = Menu.new close_item = menu.append(101, 'Close VIP-Page', 'Close VIP-Page') evt_menu(close_item, :on_close) # evt_menu(close_item) {|event| on_close(event)} rescue Exception => e puts "create_popup_menu #{e}" end def on_close(event) @softphone.exit end end Any suggestions? Eric Rubin -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Jul 30 10:53:05 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 30 Jul 2008 15:53:05 +0100 Subject: [wxruby-users] Crash in evt_menu In-Reply-To: <008901c8f250$eb2c65c0$a50ba8c0@valcom.com> References: <008901c8f250$eb2c65c0$a50ba8c0@valcom.com> Message-ID: <48908051.2060608@pressure.to> Eric Rubin wrote: > > I?m trying to create a TaskBarIcon with a right-click menu but I get a > crash (in the evt_menu call) as soon as I right-click on the icon. > > Here?s the error message: > > C:/Projects/SoftPhone1/lib/SoftPhone.rb:35:in `process_event': Swig > director type mismatch in output value of type 'wxMenu *' (TypeError) > I agree it's not the most clear error message. What's it telling you is that the method create_popup_menu is expected to return a value of type Wx::Menu, but you're not doing this. In SWIG's terminology, "director" methods are those, like create_popup_menu, where a ruby method is called on a certain event happening (in this case, right-clicking the icon) and you need to return a particular type (in this case, a Wx::Menu to be shown. > > (The rescue doesn?t catch the error). > > Here?s the code (it doesn?t matter which variant of the evt_menu call > I use): > > class SysTrayIcon < TaskBarIcon > > def initialize(parent) > > super() > > @softPhone = parent # soft_phone_frame > > icon = Icon.new("icons/phone.ico", BITMAP_TYPE_ICO) > > set_icon(icon, "Valcom VIP Page") > > end > > def create_popup_menu > > menu = Menu.new > > close_item = menu.append(101, 'Close VIP-Page', 'Close VIP-Page') > > evt_menu(close_item, :on_close) > # add this here, and delete the rescue clause return menu > > end > > def on_close(event) > > @softphone.exit > > end > > end > cheers alex From erubin at valcom.com Wed Jul 30 13:04:15 2008 From: erubin at valcom.com (Eric Rubin) Date: Wed, 30 Jul 2008 13:04:15 -0400 Subject: [wxruby-users] Crash in evt_menu In-Reply-To: <48908051.2060608@pressure.to> Message-ID: <009301c8f266$4bb8fe20$a50ba8c0@valcom.com> Thanks, That fixed it. Eric -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Wednesday, July 30, 2008 10:53 AM To: General discussion of wxRuby Subject: Re: [wxruby-users] Crash in evt_menu Eric Rubin wrote: > > I'm trying to create a TaskBarIcon with a right-click menu but I get a > crash (in the evt_menu call) as soon as I right-click on the icon. > > Here's the error message: > > C:/Projects/SoftPhone1/lib/SoftPhone.rb:35:in `process_event': Swig > director type mismatch in output value of type 'wxMenu *' (TypeError) > I agree it's not the most clear error message. What's it telling you is that the method create_popup_menu is expected to return a value of type Wx::Menu, but you're not doing this. In SWIG's terminology, "director" methods are those, like create_popup_menu, where a ruby method is called on a certain event happening (in this case, right-clicking the icon) and you need to return a particular type (in this case, a Wx::Menu to be shown. > > (The rescue doesn't catch the error). > > Here's the code (it doesn't matter which variant of the evt_menu call > I use): > > class SysTrayIcon < TaskBarIcon > > def initialize(parent) > > super() > > @softPhone = parent # soft_phone_frame > > icon = Icon.new("icons/phone.ico", BITMAP_TYPE_ICO) > > set_icon(icon, "Valcom VIP Page") > > end > > def create_popup_menu > > menu = Menu.new > > close_item = menu.append(101, 'Close VIP-Page', 'Close VIP-Page') > > evt_menu(close_item, :on_close) > # add this here, and delete the rescue clause return menu > > end > > def on_close(event) > > @softphone.exit > > end > > end > cheers alex _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users From damnbigman at gmail.com Wed Jul 30 15:56:10 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Wed, 30 Jul 2008 13:56:10 -0600 Subject: [wxruby-users] Icon issues Message-ID: <48800a90807301256p55fa39daw98b1eaaf617e6c03@mail.gmail.com> Hello all, I have another strange issue. I want to decorate the main window (frame) of my application with an icon. I have the icon in xpm format. With the following code: # Icon stuff!!! icon_file = File.join(File.dirname(__FILE__), 'circadian.xpm') icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_XPM) set_icon(icon) Things seem to run okay but I don't get an icon. If I use the same icon file for a TaskBarIcon it works perfectly. I don't get any errors but I don't get an icon either. Any suggestions? This appeared to be how it was being set in the big demo. -Glen -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Jul 30 18:14:13 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 30 Jul 2008 23:14:13 +0100 Subject: [wxruby-users] Icon issues In-Reply-To: <48800a90807301256p55fa39daw98b1eaaf617e6c03@mail.gmail.com> References: <48800a90807301256p55fa39daw98b1eaaf617e6c03@mail.gmail.com> Message-ID: <4890E7B5.9060903@pressure.to> Glen Holcomb wrote: > I want to decorate the main window (frame) of my application with an > icon. I have the icon in xpm format. With the following code: > > # Icon stuff!!! > icon_file = File.join(File.dirname(__FILE__), 'circadian.xpm') > icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_XPM) > set_icon(icon) > > Things seem to run okay but I don't get an icon. If I use the same > icon file for a TaskBarIcon it works perfectly. > > I don't get any errors but I don't get an icon either. Any > suggestions? This appeared to be how it was being set in the big demo. Your code looks fine. I'd check whether the icon is the right size for the OS (you don't say which). Windows XP expects 16x16 for the task bar & title bar corner icon, and 32x32 for the ALT-TAB task-list pane. Use IconBundle to get both. There are some sample icons in bigdemo.rb sample - do these icon files work? If so, it may be some other problem with your .xpm file; you could try using PNG as a cross-platform alternative. cheers alex From alex at pressure.to Wed Jul 30 18:41:20 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 30 Jul 2008 23:41:20 +0100 Subject: [wxruby-users] compileur In-Reply-To: <4B8B2E63D95D40D3855386B452666FDA@sebastien> References: <4B8B2E63D95D40D3855386B452666FDA@sebastien> Message-ID: <4890EE10.4060207@pressure.to> sebastien wrote: > Peut tu m'expliquer plus en d?tail ce qu'il faut faire avec > "rake_assemble.rb" et "NSIS"? [Could you explain in more detail what I should do with 'rake_assemble.rb' and NSIS?] rake_assemble.rb et assemble_libs.rb ramasser tout les fichiers dont on a besoin pour executer l'application - ruby, ses .dlls et les .rb - et les copier. NSIS faire un seul fichier executable qui vais installer ces fichiers ? un autre PC (un "setup.exe"). NSIS se serve d'un '.nsi' fichier, qui d?crit ce que contient le setup.exe.Voyez, par exemple: http://weft-qda.rubyforge.org/svn/trunk/weft-qda/qda.nsi [rake_assemble and assemble_libs.rb collect all the files which are needed to run the application - ruby, its dlls and the .rb files - and copies them. NSIS makes a single executable which will install these files on another PC (a "setup.exe"). NSIS uses a ".nsi" file, which describes what the setup.exe contains. See, for an example http://weft-qda.rubyforge.org/svn/trunk/weft-qda/qda.nsi] Tu pourrais tenter le r?sultat ici: [you can try the result here:] http://rubyforge.org/frs/download.php/35715/weft-qda-install-1.9.0.exe > Pour le moment j'ai installer "NSIS". > Par contre je n'ai pas encore eu le temps de lire l'aide de "NSIS", ce > que je vais faire d'ici peu. [I've installed NSIS, but I didn't have the time to read the "NSIS" help] Je regrette que ceci n'est pas une r?solution compl?te - tu devrais faire quelques t?ches pour l'adapter ? tes fins. Je n'ai pas de temps de t'aider en d?tail: si tu ?tais sur que rubyscript2exe ne te satisfait pas, tu devrais essayer l'adapter les exemples que je t'ai donn?s. [I'm afraid this isn't a complete solution - you will have to do several tasks to adapt it to your purposes. I don't have the time to help you in detail - if you're sure that rubyscript2exe isn't satisfactory, you will have to adapt the examples that i've offered]. cheers alex From damnbigman at gmail.com Thu Jul 31 18:00:48 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Thu, 31 Jul 2008 16:00:48 -0600 Subject: [wxruby-users] Icon issues In-Reply-To: <4890E7B5.9060903@pressure.to> References: <48800a90807301256p55fa39daw98b1eaaf617e6c03@mail.gmail.com> <4890E7B5.9060903@pressure.to> Message-ID: <48800a90807311500r3529d858ia87b1709b2327ce1@mail.gmail.com> On Wed, Jul 30, 2008 at 4:14 PM, Alex Fenton wrote: > Glen Holcomb wrote: > >> I want to decorate the main window (frame) of my application with an icon. >> I have the icon in xpm format. With the following code: >> >> # Icon stuff!!! >> icon_file = File.join(File.dirname(__FILE__), 'circadian.xpm') >> icon = Wx::Icon.new(icon_file, Wx::BITMAP_TYPE_XPM) >> set_icon(icon) >> >> Things seem to run okay but I don't get an icon. If I use the same icon >> file for a TaskBarIcon it works perfectly. >> >> I don't get any errors but I don't get an icon either. Any suggestions? >> This appeared to be how it was being set in the big demo. >> > Your code looks fine. I'd check whether the icon is the right size for the > OS (you don't say which). Windows XP expects 16x16 for the task bar & title > bar corner icon, and 32x32 for the ALT-TAB task-list pane. Use IconBundle to > get both. > > There are some sample icons in bigdemo.rb sample - do these icon files > work? If so, it may be some other problem with your .xpm file; you could try > using PNG as a cross-platform alternative. > > cheers > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > Thanks Alex, I was on Windows and using PNGs fixed my problem. I had assumed incorrectly that since the xpm worked for the taskbar it would work with the rest of the app. -Glen -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Thu Jul 31 22:24:04 2008 From: lists at ruby-forum.com (Bryan Ash) Date: Fri, 1 Aug 2008 04:24:04 +0200 Subject: [wxruby-users] Segmentation Fault (GC) Message-ID: <53a584f3e1cc7b61b876f7de657e98f2@ruby-forum.com> I've been ignoring a Garbage Collection Segmentation Fault for some time now with the help of GC.disable in my Wx::App. I'm running Windows XP with: ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] wxruby (1.9.7) activerecord (2.1.0) sqlite3-ruby (1.2.2) The application stores the time spent working on tasks in SQLite when the user starts and stops a task from the TaskBarIcon. It uses the following Wx components: Frame, Button, BoxSizer, Grid, GridTableBase, GridCellAttr, Panel, StaticText, TaskBarIcon, Image, Bitmap, Menu, MiniFrame, SystemSettings, TextCtrl The segfaults occur when I open and close the "Edit time entries" and "Timesheet" frames. I've attached a cut down version that doesn't interface to SQLite or ActiveRecord that still exhibits the problem. Please let me know what other information I can provide to help this investigation. Thanks in advance, Bryan Attachments: http://www.ruby-forum.com/attachment/2468/time_track.zip -- Posted via http://www.ruby-forum.com/.