From fabio.petrucci at gmail.com Mon Dec 1 12:31:26 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Mon, 1 Dec 2008 18:31:26 +0100 Subject: [wxruby-users] wxComboBox and wxTE_PROCESS_ENTER In-Reply-To: References: <4932C7FA.5050505@pressure.to> Message-ID: Ok i've found my way: Now my ComboBox consumes ENTER and TAB keys :) One more question: I use window#navigate() to simulate TAB. calling it by default param is fine even if it doesn't reconize the mapping constant Wx::NavigationKeyEvent::IsForward what about if i'd like to navigate backward? i supposed a constant like Wx::NavigationKeyEvent::IsBackward but i get an uninitialized constant Wxruby2::Wx::NavigationKeyEvent::IsBackward any suggestion? regards. bio On Mon, Dec 1, 2008 at 12:29 AM, Fabio Petrucci wrote: > Hi Alex & Mario, > > i am working on an invoice form, where the user should be able to fill > fields using mainly tab, numeric keys and confirm by enter on every field > he's working on. The basic reason for that, is the user should only type on > the keyboard avoiding as much as possible using mouse for speed reason. > > > On Sun, Nov 30, 2008 at 7:11 PM, Mario Steele wrote: > >> The problem lies in the fact, that Wx::ComboBox has a Drop down, and a >> Text Edit in it. > > > right. > > >> I believe that Fabio wants the Enter event, so that he can add what a >> person enters into the Drop Down, if I am understanding correctly. > > > Basically i use Enter to validate user input > > >> The best thing to do, is to monitor evt_keypress > > > Is ComboBox able to trigger keypress event?? > > On Sun, Nov 30, 2008 at 11:06 AM, Alex Fenton wrote: >> >>> Fabio Petrucc >>> The fact that setting this style when the control is created suggests to >>> me that it's not really meant to work like that, and I don't understand >>> what you're trying to do here. Why do you want a ComboBox that processes >>> ENTER? >>> >> > The above user inserts hundreds of products a day and he knows exactly > what vat code to use for that kind of product, without having to choose > from a dropdown menu. The ENTER is to confirm what he typed. > > ComboBox let you do that quite well standardizing behaviour between fields. > > >>> I don't know. I expect if the control is told to consume ENTER, it also >>> consumes TAB. >>> >>> > Unfortunately, on ComboBox, if you enable enter you loose the opportunity > to use the tab > > thank you both. > > bio. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Mon Dec 1 12:54:56 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 01 Dec 2008 17:54:56 +0000 Subject: [wxruby-users] wxComboBox and wxTE_PROCESS_ENTER In-Reply-To: References: <4932C7FA.5050505@pressure.to> Message-ID: <493424F0.2040400@pressure.to> Fabio Petrucci wrote: > Ok i've found my way: > > Now my ComboBox consumes ENTER and TAB keys :) > > One more question: > > I use window#navigate() to simulate TAB. > calling it by default param is fine even if it doesn't reconize the > mapping constant Wx::NavigationKeyEvent::IsForward > > what about if i'd like to navigate backward? > > i supposed a constant like Wx::NavigationKeyEvent::IsBackward > > but i get an uninitialized constant > Wxruby2::Wx::NavigationKeyEvent::IsBackward Try using the following values to indicate backwards and forwards to Window#navigate (never even knew about that method until today...) IsBackward = 0 IsForward = 1 alex From fabio.petrucci at gmail.com Mon Dec 1 15:01:55 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Mon, 1 Dec 2008 21:01:55 +0100 Subject: [wxruby-users] wxComboBox and wxTE_PROCESS_ENTER In-Reply-To: <493424F0.2040400@pressure.to> References: <4932C7FA.5050505@pressure.to> <493424F0.2040400@pressure.to> Message-ID: -1, 1, 2, 3... [?] 0.. obvious! thank you Alex. On Mon, Dec 1, 2008 at 6:54 PM, Alex Fenton wrote: > Fabio Petrucci wrote: > >> Ok i've found my way: >> >> Now my ComboBox consumes ENTER and TAB keys :) >> >> One more question: >> >> I use window#navigate() to simulate TAB. >> calling it by default param is fine even if it doesn't reconize the >> mapping constant Wx::NavigationKeyEvent::IsForward >> >> what about if i'd like to navigate backward? >> >> i supposed a constant like Wx::NavigationKeyEvent::IsBackward >> >> but i get an uninitialized constant >> Wxruby2::Wx::NavigationKeyEvent::IsBackward >> > > Try using the following values to indicate backwards and forwards to > Window#navigate (never even knew about that method until today...) > > IsBackward = 0 > IsForward = 1 > > > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 226 bytes Desc: not available URL: From lists at ruby-forum.com Wed Dec 3 16:52:55 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Wed, 3 Dec 2008 22:52:55 +0100 Subject: [wxruby-users] how do i refresh a window Message-ID: <1060ade8bf53da1210179f3bf9a183a5@ruby-forum.com> wel, I'm back with another newbee question. the problem i'm having and that i coldn't find it on the internet is how to refresh a window, but someting more explained, maybe a tutorial or some doc? when i put muy window behind another one the contents is 'deleted', still there but not visible until i click again (for example in a textbox), in most cases. ok, first i'll explain what I'm Doing (wrong) first i call class Minimalapp Minumalapp calls a Frame class Within the frame class, on process initialize, I declare the menus, tool bars, panels, and a book. After the book i call both update() and refresh() (in that order), but when i run the program and put the window behind another one it doesn't update. the code (abstract) is this: -class Aframe< WX::Frame --def initialize ---menu bars and toolbars ---NoteBook ----panel ----textbox ----combobox ----etc ---update() ---refresh() --end -end -class Minimalapp< wx::App -- on_init #calls Aframe -end #call minimallapp.main_loop any help for this newbee would be good. thanks -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Dec 3 16:56:41 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Wed, 3 Dec 2008 22:56:41 +0100 Subject: [wxruby-users] Static line is not drawn In-Reply-To: References: Message-ID: <2a2593d1073f1e0fd060ed133c8165f7@ruby-forum.com> Jn Jacob wrote: > > I think the size shouldnt be -1 , make it greater than 0 > > try setting border options on like DOUBLE_BORDER , i am not sure if it > would work. > well it worked, with some other small modifications to the code, but it worked in the end. thank you -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Thu Dec 4 01:13:04 2008 From: mario at ruby-im.net (Mario Steele) Date: Thu, 4 Dec 2008 00:13:04 -0600 Subject: [wxruby-users] how do i refresh a window In-Reply-To: <1060ade8bf53da1210179f3bf9a183a5@ruby-forum.com> References: <1060ade8bf53da1210179f3bf9a183a5@ruby-forum.com> Message-ID: Hello Omar, On Wed, Dec 3, 2008 at 3:52 PM, Omar Hernandez wrote: > wel, I'm back with another newbee question. Not a problem the problem i'm having and that i coldn't find it on the internet is how > to refresh a window, but someting more explained, maybe a tutorial or > some doc? > > when i put muy window behind another one the contents is 'deleted', > still there but not visible until i click again (for example in a > textbox), in most cases. > > ok, first i'll explain what I'm Doing (wrong) > > first i call class Minimalapp > > Minumalapp calls a Frame class > > Within the frame class, on process initialize, I declare the menus, tool > bars, panels, and a book. After the book i call both update() and > refresh() (in that order), but when i run the program and put the window > behind another one it doesn't update. > > the code (abstract) is this: > > -class Aframe< WX::Frame > --def initialize > ---menu bars and toolbars > ---NoteBook > ----panel > ----textbox > ----combobox > ----etc > ---update() > ---refresh() > --end > -end First off, update() and refresh() is only executed once, when you initialize your Frame. It doesn't do any subsiquent repainting, as initialize is never executed again in the lifetime of your Frame that you just created. To put it into simpler terms, you do this: myframe = Aframe.new myframe will call the initialize method on Aframe to get everything setup. Where your update() and refresh() are. After this point, initialize is never called again, nor should it be, least your creating a new instance of Aframe. Secondly, the frame should be doing it's own updates and refreshes, unless you are intercepting a evt_paint() on the frame itself. If your doing that, then it will not repaint the frame itself, till you pass along the ok for wxRuby to repaint the window itself. Unless your doing some specialized graphics, you shouldn't need to intercept the evt_paint(), and even then, if your doing specialized graphics, in a certian area of your frame, I would strongly suggest that you create an instance of panel, to do all of your drawing. -class Minimalapp< wx::App > -- on_init #calls Aframe > -end > > #call minimallapp.main_loop > > any help for this newbee would be good. > thanks > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > If you could, post an absolute minimal example of the app replicating this problem, full code, we can look at why this is occuring. Also, could you please state if your on Mac, Windows, or Linux? Thanks -- 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 fabio.petrucci at gmail.com Fri Dec 5 16:52:58 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 5 Dec 2008 22:52:58 +0100 Subject: [wxruby-users] wxDatePickerCtrl Message-ID: Ciao Alex, is there any chance to have wxDatePickerCtrl support in wxRuby? cheers, bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Fri Dec 5 17:00:23 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 05 Dec 2008 22:00:23 +0000 Subject: [wxruby-users] wxDatePickerCtrl In-Reply-To: References: Message-ID: <4939A477.1040507@pressure.to> Fabio Petrucci wrote: > is there any chance to have wxDatePickerCtrl support in wxRuby? Yeah, I can have a look at it; please file a Feature Request to track it. I've tried adding the class before and ran into problems. But classes that were previously difficult can often be solved now as the wrappings generally have improved. alex From fabio.petrucci at gmail.com Fri Dec 5 17:37:31 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 5 Dec 2008 23:37:31 +0100 Subject: [wxruby-users] wxDatePickerCtrl In-Reply-To: <4939A477.1040507@pressure.to> References: <4939A477.1040507@pressure.to> Message-ID: > Yeah, I can have a look at it; please file a Feature Request to track it. done! thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.traonmilin at gmail.com Tue Dec 9 15:37:50 2008 From: luc.traonmilin at gmail.com (Luc Traonmilin) Date: Tue, 09 Dec 2008 21:37:50 +0100 Subject: [wxruby-users] MenuBar doesn't show Message-ID: <493ED71E.1060907@gmail.com> Hi all, I am totally new to Ruby and Wx so i'd appreciate it if someone could tell me why my menubar doesn't show Here is the code (running on Vista...): class MinimalApp < App def on_init @frame = Frame.new(nil, -1, "Lister") @frame.set_client_size(600,400) @sizer = BoxSizer.new(VERTICAL) @menubar = MenuBar.new @file = Menu.new @open = @file.append("Open", "open") @menubar.append(@file, "File") @sizer.add(@menubar, 0, GROW|ALL, 2) @frame.set_sizer(@sizer) @frame.show end end Thanks From lists at ruby-forum.com Tue Dec 9 17:44:35 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Tue, 9 Dec 2008 23:44:35 +0100 Subject: [wxruby-users] MenuBar doesn't show In-Reply-To: <493ED71E.1060907@gmail.com> References: <493ED71E.1060907@gmail.com> Message-ID: <7397f428cd85be23b94acc028608cce1@ruby-forum.com> > class MinimalApp < App > def on_init > @frame = Frame.new(nil, -1, "Lister") > @frame.set_client_size(600,400) > > @sizer = BoxSizer.new(VERTICAL) > > @menubar = MenuBar.new > > @file = Menu.new > @open = @file.append("Open", "open") > @menubar.append(@file, "File") > > @sizer.add(@menubar, 0, GROW|ALL, 2) > > @frame.set_sizer(@sizer) > > @frame.show > end > end Well,I've not tryed the syntaxis but, apparently you need: to use set_menu_bar(@menubar). Maybe a @frame.set_menu_bar(@menubar) would do the job. -- Posted via http://www.ruby-forum.com/. From luc.traonmilin at gmail.com Tue Dec 9 17:56:51 2008 From: luc.traonmilin at gmail.com (Luc Traonmilin) Date: Tue, 09 Dec 2008 23:56:51 +0100 Subject: [wxruby-users] MenuBar doesn't show In-Reply-To: <7397f428cd85be23b94acc028608cce1@ruby-forum.com> References: <493ED71E.1060907@gmail.com> <7397f428cd85be23b94acc028608cce1@ruby-forum.com> Message-ID: <493EF7B3.5030803@gmail.com> Omar Hernandez a ?crit : >> class MinimalApp < App >> def on_init >> @frame = Frame.new(nil, -1, "Lister") >> @frame.set_client_size(600,400) >> >> @sizer = BoxSizer.new(VERTICAL) >> >> @menubar = MenuBar.new >> >> @file = Menu.new >> @open = @file.append("Open", "open") >> @menubar.append(@file, "File") >> >> @sizer.add(@menubar, 0, GROW|ALL, 2) >> >> @frame.set_sizer(@sizer) >> >> @frame.show >> end >> end >> > > Well,I've not tryed the syntaxis but, apparently you need: to use > set_menu_bar(@menubar). > > Maybe a @frame.set_menu_bar(@menubar) would do the job. > Yes it does the job, thanks. From lists at ruby-forum.com Thu Dec 11 14:51:28 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Thu, 11 Dec 2008 20:51:28 +0100 Subject: [wxruby-users] how do i refresh a window In-Reply-To: References: <1060ade8bf53da1210179f3bf9a183a5@ruby-forum.com> Message-ID: <2b2c871b44f117aad5849c55b5188e0c@ruby-forum.com> Hello well the time came when i have to fix this problem, I'll thank you for all your help. Mario Steele wrote: > ... the frame should be doing it's own updates and refreshes, > unless > you are intercepting a evt_paint() on the frame itself. > ... > Unless your doing some specialized graphics, you shouldn't need to > intercept I'm not doing specialized graphics, or I think so. > If you could, post an absolute minimal example of the app replicating > this > problem, full code, we can look at why this is occuring. Also, could > you I'm attaching a minimal example. The problems I found in my computer (windows)are: - The line is not drawn. - In report>person menu, If you select the combo, it errases a part of the grid (the part that was covered by the options) - In configuration> states menu, the TextCtrl has no borders. - When i minimize, restore, or cover the window with another window (the console window for example)the painting goes crazy, sometimes it dissapears, or the borders (when they had appeared) dissapear again. > please state if your on Mac, Windows, or Linux? We have tested it in two windows xp (media center and SP Professional) computers and is the same error. But in Mac it seems to be working fine. If you are trying to find the error, try anything you thing on the window (cover it, minimize, restore, etc.) so you can see what I mean Thanks for your help. Attachments: http://www.ruby-forum.com/attachment/3059/badpainting.rb -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Dec 11 15:17:24 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 11 Dec 2008 20:17:24 +0000 Subject: [wxruby-users] how do i refresh a window In-Reply-To: <2b2c871b44f117aad5849c55b5188e0c@ruby-forum.com> References: <1060ade8bf53da1210179f3bf9a183a5@ruby-forum.com> <2b2c871b44f117aad5849c55b5188e0c@ruby-forum.com> Message-ID: <49417554.5010205@pressure.to> Omar Hernandez wrote: > > I'm attaching a minimal example. The problems I found in my computer > (windows)are: > Pages within Notebooks must be children of the Notebook. So everywhere you have Panel.new(self) you should have Panel.new(@book). With that changed, and adding some labels to the notebook tabs, things look to be working fine. I've only tested on OS X but I'd be pretty sure that having the wrong parent would explain problems like: > - The line is not drawn. > - In report>person menu, If you select the combo, it errases a part of > the grid (the part that was covered by the options) > - In configuration> states menu, the TextCtrl has no borders. > - When i minimize, restore, or cover the window with another window (the > console window for example)the painting goes crazy, sometimes it > dissapears, or the borders (when they had appeared) dissapear again. > hth a From lists at ruby-forum.com Thu Dec 11 17:44:56 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Thu, 11 Dec 2008 23:44:56 +0100 Subject: [wxruby-users] how do i refresh a window In-Reply-To: <49417554.5010205@pressure.to> References: <1060ade8bf53da1210179f3bf9a183a5@ruby-forum.com> <2b2c871b44f117aad5849c55b5188e0c@ruby-forum.com> <49417554.5010205@pressure.to> Message-ID: <39cd1db9d8a2be9c9c74c63edea5b862@ruby-forum.com> Alex Fenton wrote: > Pages within Notebooks must be children of the Notebook. So everywhere > you have Panel.new(self) you should have Panel.new(@book). With that > changed, and adding some labels to the notebook tabs, things look to be > working fine. > yes, it's working!! I guess it was a noob error. thank you very much -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Mon Dec 15 04:32:10 2008 From: lists at ruby-forum.com (Robin Rogge) Date: Mon, 15 Dec 2008 10:32:10 +0100 Subject: [wxruby-users] StyledTextCtrl not receiving all entered keys Message-ID: Hi, i am working on a little editor based on the StyledTextCtrl. The problem: The keys "wrtzfy.-#+124780" are not being received by the control, so there is no output within the control and no events are being triggered. I've tested this on two different machines running (one running XP and the other one running Vista), but these keys do work with other controls within the same application. Any idea what might be the cause? Greetings from Hamburg / Germany - rojaro - -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Dec 15 06:37:29 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 15 Dec 2008 11:37:29 +0000 Subject: [wxruby-users] StyledTextCtrl not receiving all entered keys In-Reply-To: References: Message-ID: <49464179.9070201@pressure.to> Hi Robin Rogge wrote: > i am working on a little editor based on the StyledTextCtrl. The > problem: The keys "wrtzfy.-#+124780" are not being received by the > control, so there is no output within the control and no events are > being triggered. I've tested this on two different machines running (one > running XP and the other one running Vista), but these keys do work with > other controls within the same application. Any idea what might be the > cause? That's strange. I can't reproduce the error on XP using the wxRuby scintilla sample. Could you try running that sample please? If the sample problem occurs, then I guess it's a bug with Vista, otherwise there must be something in your app that's consuming those characters. Perhaps an evt_char handler that is not calling skip on the event? If this doesn't help, please send a minimal, runnable, self-contained sample that demonstrates the issue. a From sirgazil at gmail.com Mon Dec 15 19:05:17 2008 From: sirgazil at gmail.com (Luis Felipe Lopez Acevedo) Date: Mon, 15 Dec 2008 19:05:17 -0500 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) Message-ID: Hello, I installed wxRuby through rubygems but I can't use it. When I try the sample apps I get the following error: fla at nutabe:~/biblioteca/programaci?n/ruby/wxruby_doc/samples/minimal$ ruby minimal.rb /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: libGL.so.1: cannot open shared object file: No such file or directory - /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so (LoadError) from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `require' from /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wx.rb:12 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `require' from minimal.rb:8 This is the software I'm using: gNewSense 2.1 wxRuby 1.9.9-x86 Ruby 1.8.6 Thanks in advance, -- Luis Felipe L?pez Acevedo Medell?n, Colombia -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Tue Dec 16 05:21:14 2008 From: lists at ruby-forum.com (Robin Rogge) Date: Tue, 16 Dec 2008 11:21:14 +0100 Subject: [wxruby-users] StyledTextCtrl not receiving all entered keys In-Reply-To: <49464179.9070201@pressure.to> References: <49464179.9070201@pressure.to> Message-ID: <5ba82c81b643caeb0929e2fdbbff408a@ruby-forum.com> Hi Alex, Alex Fenton wrote: >> i am working on a little editor based on the StyledTextCtrl. The >> problem: The keys "wrtzfy.-#+124780" are not being received by the >> control, so there is no output within the control and no events are >> being triggered. I've tested this on two different machines running (one >> running XP and the other one running Vista), but these keys do work with >> other controls within the same application. Any idea what might be the >> cause? > > That's strange. I can't reproduce the error on XP using the wxRuby > scintilla sample. Could you try running that sample please? If the > sample problem occurs, then I guess it's a bug with Vista, otherwise > there must be something in your app that's consuming those characters. > Perhaps an evt_char handler that is not calling skip on the event? Thanks for your response. I actually never saw this demo before and it works perfectly. So, looking at it, i see the main difference between my code and the demo code is that i use an extended StyledTextCtrl, while the demo uses a direct instance of StyledTextCtrl. For testing, i trimmed my extended class as far as possible until the following code remained, while the problem still remained: class EditorPage < Wx::StyledTextCtrl end So the demo uses @sci = Wx::StyledTextControl.new(self) while i use @sci = EditorPage.new(self) Note that this problem occurs on both, Windows XP and Vista. Greetings from Hamburg / Germany - rojaro - -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Dec 16 07:24:04 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 16 Dec 2008 12:24:04 +0000 Subject: [wxruby-users] StyledTextCtrl not receiving all entered keys In-Reply-To: <5ba82c81b643caeb0929e2fdbbff408a@ruby-forum.com> References: <49464179.9070201@pressure.to> <5ba82c81b643caeb0929e2fdbbff408a@ruby-forum.com> Message-ID: <49479DE4.5050701@pressure.to> Robin Rogge wrote: > Thanks for your response. I actually never saw this demo before and it > works perfectly. So, looking at it, i see the main difference between my > code and the demo code is that i use an extended StyledTextCtrl, while > the demo uses a direct instance of StyledTextCtrl. For testing, i > trimmed my extended class as far as possible until the following code > remained, while the problem still remained: > > class EditorPage < Wx::StyledTextCtrl > end > > So the demo uses > > @sci = Wx::StyledTextControl.new(self) > > while i use > > @sci = EditorPage.new(self) I don't believe there is a problem with subclasses of StyledTextCtrl. If you put your subclass in the wxRuby demo it still works fine, and I've used complex subclasses of STC in real code without difficulty. So there is something else wrong in your program. Happy to try out a minimal runnable sample that demonstrates the issue - you may find that selectively removing elements from the frame may identify the source of the difficulty. My guess would be that some other widget (eg a Frame) or the App is being told to trap and not pass them on. alex From lists at ruby-forum.com Tue Dec 16 08:52:29 2008 From: lists at ruby-forum.com (Robin Rogge) Date: Tue, 16 Dec 2008 14:52:29 +0100 Subject: [wxruby-users] StyledTextCtrl not receiving all entered keys In-Reply-To: <49479DE4.5050701@pressure.to> References: <49464179.9070201@pressure.to> <5ba82c81b643caeb0929e2fdbbff408a@ruby-forum.com> <49479DE4.5050701@pressure.to> Message-ID: Hi Alex, Alex Fenton wrote: > I don't believe there is a problem with subclasses of StyledTextCtrl. If > you put your subclass in the wxRuby demo it still works fine, and I've > used complex subclasses of STC in real code without difficulty. > > So there is something else wrong in your program. Happy to try out a > minimal runnable sample that demonstrates the issue - you may find that > selectively removing elements from the frame may identify the source of > the difficulty. My guess would be that some other widget (eg a Frame) or > the App is being told to trap and not pass them on. Damn ... it just had to be something really stupid. The "CTRL" in front of some shortcuts for the dynamically created menu items in the menubar was missing. I just removed them from the item generating method for now and viola, StyledTextCtrl works. Thanks for your help :-) Greetings from Hamburg / Germany - rojaro - -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Dec 16 09:06:37 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 16 Dec 2008 14:06:37 +0000 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) In-Reply-To: References: Message-ID: <4947B5ED.3020407@pressure.to> Hi Luis Felipe Lopez Acevedo wrote: > I installed wxRuby through rubygems but I can't use it. When I try the > sample apps I get the following error: > > fla at nutabe:~/biblioteca/programaci?n/ruby/wxruby_doc/samples/minimal$ > ruby minimal.rb > /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: > libGL.so.1: cannot open shared object file: No such file or directory > - /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so (LoadError) > from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `require' > from /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wx.rb:12 > from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in > `gem_original_require' > from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `require' > from minimal.rb:8 > > This is the software I'm using: > > gNewSense 2.1 > wxRuby 1.9.9-x86 > Ruby 1.8.6 It looks like you need some additional libraries that wRuby depends on. Since Linux systems vary so widely, it's sometimes necessary to install some additional dependencies to get wxRuby to work. The missing library is libGL.so and I think on Debian-type systems you need to install a package called something like "libgl1-mesa" to get this. Searching for "mesa" should turn it up. hth alex From sirgazil at gmail.com Tue Dec 16 10:21:14 2008 From: sirgazil at gmail.com (Luis Felipe Lopez Acevedo) Date: Tue, 16 Dec 2008 10:21:14 -0500 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) In-Reply-To: <4947B5ED.3020407@pressure.to> References: <4947B5ED.3020407@pressure.to> Message-ID: Excuse my ignorance but does that mean that wxRuby depends on OpenGL? Because if it does, I won't be able to use it since my libre system has no support for OpenGL due to licensing issues ( http://www.fsf.org/news/thank-you-sgi). I was hopping to run wxRuby apps like I do with wxPython :( But I'll check if I'm able to install libgl1-mesa. Thanks for your help, Alex. 2008/12/16 Alex Fenton > Hi > > > Luis Felipe Lopez Acevedo wrote: > >> I installed wxRuby through rubygems but I can't use it. When I try the >> sample apps I get the following error: >> >> fla at nutabe:~/biblioteca/programaci?n/ruby/wxruby_doc/samples/minimal$ >> ruby minimal.rb >> /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: libGL.so.1: >> cannot open shared object file: No such file or directory - >> /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so (LoadError) >> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `require' >> from /var/lib/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wx.rb:12 >> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in >> `gem_original_require' >> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:32:in `require' >> from minimal.rb:8 >> >> This is the software I'm using: >> >> gNewSense 2.1 >> wxRuby 1.9.9-x86 >> Ruby 1.8.6 >> > > It looks like you need some additional libraries that wRuby depends on. > Since Linux systems vary so widely, it's sometimes necessary to install some > additional dependencies to get wxRuby to work. > > The missing library is libGL.so and I think on Debian-type systems you need > to install a package called something like "libgl1-mesa" to get this. > Searching for "mesa" should turn it up. > > hth > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Luis Felipe L?pez Acevedo Medell?n, Colombia -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Tue Dec 16 10:48:33 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 16 Dec 2008 15:48:33 +0000 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) In-Reply-To: References: <4947B5ED.3020407@pressure.to> Message-ID: <4947CDD1.1020700@pressure.to> Luis Felipe Lopez Acevedo wrote: > Excuse my ignorance but does that mean that wxRuby depends on OpenGL? > Because if it does, I won't be able to use it since my libre system > has no support for OpenGL due to licensing issues > (http://www.fsf.org/news/thank-you-sgi). wxRuby doesn't depend overall on OpenGL. It does include a GLCanvas widget, and this specific widget depends on the system's GL library. In the case of Ubuntu this is libmesa (http://www.mesa3d.org/), and from the link you posted it looks like after re-licensing, this is acceptable under a strict definition of 'free'/'libre'. > I was hopping to run wxRuby apps like I do with wxPython :( No reason you can't :). But if there isn't a system GL library available to you because of licensing, you will have to compile your own wxRuby without GL support. On Linux with a wxWidgets library installed, this is pretty simple - the only extra needed is SWIG. It should pick up that GL is not supported and not attempt to compile that - if not, you can force it to skip that widget by doing: rake WXRUBY_EXCLUDED=GLCanvas > But I'll check if I'm able to install libgl1-mesa. I would definitely try this first. The precompiled gems for all platforms are built with a maximum set of features, and so in some cases (mostly on Linux) some additional libraries are needed. On Linux in particular, the binary builds are more of a convenience, rather than something we expect to be right for all users on every possible distro. hth alex From jas.shelton at hotmail.com Tue Dec 16 11:02:19 2008 From: jas.shelton at hotmail.com (Jason Shelton) Date: Tue, 16 Dec 2008 11:02:19 -0500 Subject: [wxruby-users] Moving text on a window Message-ID: All, I am new to WxRuby, and I am reading the online WxRuby Documentation for help. I want to add a control to my application that can move text between two text controls on a window. For example, let's say that I have a text/list control with 3 text strings in it, 'one', 'two', and 'three'. I want to be able to highlight 'one', click a button, and have 'one' appear in another text/list control on the window, and the original window should only have 'two' and 'three' displayed in it now. I can elaborate if this is not clear. Thank you in advance for any help. - Shelton _________________________________________________________________ Suspicious message? There?s an alert for that. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Tue Dec 16 11:15:51 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 16 Dec 2008 16:15:51 +0000 Subject: [wxruby-users] Moving text on a window In-Reply-To: References: Message-ID: <4947D437.9020608@pressure.to> Jason Shelton wrote: > I am new to WxRuby, and I am reading the online WxRuby Documentation > for help. I want to add a control to my application that can move > text between two text controls on a window. For example, let's say > that I have a text/list control with 3 text strings in it, 'one', > 'two', and 'three'. I want to be able to highlight 'one', click a > button, and have 'one' appear in another text/list control on the > window, and the original window should only have 'two' and 'three' > displayed in it now. I can elaborate if this is not clear. Thank you > in advance for any help. Exactly how to do this depends on the type of control you're copying from and to. Assuming you're using Wx::ListBox, which is nice and simple, something like (untested): # assuming the_button is the Wx::Button evt_button(the_button) do # get the selected text from the original window sel_text = list_1.string_selection # add it to the other window list_2.append (sel_text) # delete the selection in the old window list_1.delete( list_1.selection ) end a From jas.shelton at hotmail.com Tue Dec 16 14:00:07 2008 From: jas.shelton at hotmail.com (Jason Shelton) Date: Tue, 16 Dec 2008 14:00:07 -0500 Subject: [wxruby-users] Moving text on a window In-Reply-To: <4947D437.9020608@pressure.to> References: <4947D437.9020608@pressure.to> Message-ID: Thank you for your response, it was very helpful. I have another question concerning this issue. Once I have appended the selections from 'list1' to 'list2', is there some sort of 'getValue' method that will return the contents of the 'list2' list box, maybe into an array? I have used the 'getValue' method to get the value of a combo box, but what is the method for a list box. Thanks in advance for any help. - Shelton> Date: Tue, 16 Dec 2008 16:15:51 +0000> From: alex at pressure.to> To: wxruby-users at rubyforge.org> Subject: Re: [wxruby-users] Moving text on a window> > Jason Shelton wrote:> > I am new to WxRuby, and I am reading the online WxRuby Documentation > > for help. I want to add a control to my application that can move > > text between two text controls on a window. For example, let's say > > that I have a text/list control with 3 text strings in it, 'one', > > 'two', and 'three'. I want to be able to highlight 'one', click a > > button, and have 'one' appear in another text/list control on the > > window, and the original window should only have 'two' and 'three' > > displayed in it now. I can elaborate if this is not clear. Thank you > > in advance for any help.> > Exactly how to do this depends on the type of control you're copying > from and to. Assuming you're using Wx::ListBox, which is nice and > simple, something like (untested):> > # assuming the_button is the Wx::Button> evt_button(the_button) do> # get the selected text from the original window> sel_text = list_1.string_selection> # add it to the other window> list_2.append (sel_text)> # delete the selection in the old window> list_1.delete( list_1.selection )> end> > > a> _______________________________________________> wxruby-users mailing list> wxruby-users at rubyforge.org> http://rubyforge.org/mailman/listinfo/wxruby-users _________________________________________________________________ Send e-mail anywhere. No map, no compass. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhere_122008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Tue Dec 16 14:48:17 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 16 Dec 2008 19:48:17 +0000 Subject: [wxruby-users] Moving text on a window In-Reply-To: References: <4947D437.9020608@pressure.to> Message-ID: <49480601.7030200@pressure.to> Jason Shelton wrote: > Thank you for your response, it was very helpful. I have another > question concerning this issue. Once I have appended the selections > from 'list1' to 'list2', is there some sort of 'getValue' method that > will return the contents of the 'list2' list box, maybe into an array? If you want every text item in the listbox: listbox.map { | i | listbox.string(i) } If you want the text for selected items only: listbox.selections.map { | i | listbox.string(i) } a From rakaur at malkier.net Tue Dec 16 15:31:40 2008 From: rakaur at malkier.net (Eric Will) Date: Tue, 16 Dec 2008 15:31:40 -0500 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) In-Reply-To: <4947CDD1.1020700@pressure.to> References: <4947B5ED.3020407@pressure.to> <4947CDD1.1020700@pressure.to> Message-ID: On a similar note, I get "undefined symbol: rb_intern2" when I try to use the 'wxruby-ruby19' gem. Using the regular 'wxruby' gem causes it to core as soon as I load it. Any ideas? -- Eric Will From rakaur at malkier.net Tue Dec 16 15:52:52 2008 From: rakaur at malkier.net (Eric Will) Date: Tue, 16 Dec 2008 15:52:52 -0500 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) In-Reply-To: References: <4947B5ED.3020407@pressure.to> <4947CDD1.1020700@pressure.to> Message-ID: <8354D97A-1EC8-4AC9-AC53-6937220E497F@malkier.net> On Dec 16, 2008, at 3:31 PM, Eric Will wrote: > On a similar note, I get "undefined symbol: rb_intern2" when I try > to use the 'wxruby-ruby19' gem. Using the regular 'wxruby' gem > causes it to core as soon as I load it. Sometimes it says "undefined symbol: rb_str_new_cstr" also. No idea. > Any ideas? > > -- Eric Will From alex at pressure.to Tue Dec 16 19:17:48 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 17 Dec 2008 00:17:48 +0000 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) In-Reply-To: References: <4947B5ED.3020407@pressure.to> <4947CDD1.1020700@pressure.to> Message-ID: <4948452C.3020100@pressure.to> Hi Eric Eric Will wrote: > On a similar note, I get "undefined symbol: rb_intern2" when I try to > use the 'wxruby-ruby19' gem. Using the regular 'wxruby' gem causes it > to core as soon as I load it. Which platform & ruby version are you using please? a From rakaur at malkier.net Wed Dec 17 07:40:15 2008 From: rakaur at malkier.net (Eric Will) Date: Wed, 17 Dec 2008 07:40:15 -0500 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) In-Reply-To: <4948452C.3020100@pressure.to> References: <4947B5ED.3020407@pressure.to> <4947CDD1.1020700@pressure.to> <4948452C.3020100@pressure.to> Message-ID: <376324F6-A003-494B-B08C-71824BE3C3D2@malkier.net> On Dec 16, 2008, at 7:17 PM, Alex Fenton wrote: > Hi Eric > > Eric Will wrote: >> On a similar note, I get "undefined symbol: rb_intern2" when I try >> to use the 'wxruby-ruby19' gem. Using the regular 'wxruby' gem >> causes it to core as soon as I load it. > > Which platform & ruby version are you using please? 1.9.0 on Linux-2.6.27. > a > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From alex at pressure.to Wed Dec 17 11:15:07 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 17 Dec 2008 16:15:07 +0000 Subject: [wxruby-users] ruby19-linux gem In-Reply-To: <376324F6-A003-494B-B08C-71824BE3C3D2@malkier.net> References: <4947B5ED.3020407@pressure.to> <4947CDD1.1020700@pressure.to> <4948452C.3020100@pressure.to> <376324F6-A003-494B-B08C-71824BE3C3D2@malkier.net> Message-ID: <4949258B.1020506@pressure.to> Eric Will wrote: >>> On a similar note, I get "undefined symbol: rb_intern2" when I try >>> to use the 'wxruby-ruby19' gem. Using the regular 'wxruby' gem >>> causes it to core as soon as I load it. >> >> Which platform & ruby version are you using please? > > 1.9.0 on Linux-2.6.27. Thanks. I didn't know we even had a ruby19-linux gem available? Anyway, I'll try compiling one for 1.9.9 and releasing as I'd be interested to get this working for 2.0 cheers a From jas.shelton at hotmail.com Wed Dec 17 11:31:26 2008 From: jas.shelton at hotmail.com (Jason Shelton) Date: Wed, 17 Dec 2008 11:31:26 -0500 Subject: [wxruby-users] Ruby and Excel Issue Message-ID: All, It seems that Ruby has a problem with using variables in certain scenarios. Previously, I was passing a parameter to a class named 'Test' with a function in it named 'go'. This is the syntax that I used, Test.new.go('hello') The function 'go' would open a .xls file with the parameter in the path, such as C:\hello\data.xls. Everything was working fine then. Now, instead of using the actual string 'hello' as the parameter, I am using an array element variable, so the syntax is Test.new.go(array[x]). Now the 'go' function throws the ''File not found' error. In the error message, both the path and file are correct, so I do not understand why the file cannot be found. Does anyone have any idea about what could be going on? Thanks in advance for any help. - Shelton _________________________________________________________________ You live life online. So we put Windows on the web. http://clk.atdmt.com/MRT/go/127032869/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sirgazil at gmail.com Wed Dec 17 12:32:07 2008 From: sirgazil at gmail.com (Luis Felipe Lopez Acevedo) Date: Wed, 17 Dec 2008 12:32:07 -0500 Subject: [wxruby-users] wxRuby 1.9.9 apps don't work (gNewSense 2.1) In-Reply-To: <4947CDD1.1020700@pressure.to> References: <4947B5ED.3020407@pressure.to> <4947CDD1.1020700@pressure.to> Message-ID: 2008/12/16 Alex Fenton > Luis Felipe Lopez Acevedo wrote: > > But I'll check if I'm able to install libgl1-mesa. >> > > I would definitely try this first. The precompiled gems for all platforms > are built with a maximum set of features, and so in some cases (mostly on > Linux) some additional libraries are needed. On Linux in particular, the > binary builds are more of a convenience, rather than something we expect to > be right for all users on every possible distro. Just to let other people know, the package that contains libGL.so.1 in gNewSense 2.1 is libgl1-mesa-swx11. But currently, this package won't install libGL.so.1 because it got removed from the distribution when the GLX licensing issues appeared. I'll use wxRuby later, when OpenGL functionality returns to gNewSense. Alex, thanks again for your help :) -- Luis Felipe L?pez Acevedo Medell?n, Colombia -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Dec 17 12:39:18 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 17 Dec 2008 17:39:18 +0000 Subject: [wxruby-users] Ruby and Excel Issue In-Reply-To: References: Message-ID: <49493946.9050909@pressure.to> Hi I wasn't clear this was a question about wxRuby, or just a general Ruby question. If it's the latter, it's better directed to comp.lang.ruby newsgroup / ruby-talk mailing list. Jason Shelton wrote: > It seems that Ruby has a problem with using variables in certain > scenarios. Don't take this the wrong way - but if Ruby had a defect by which it randomly changed the value of variables under your nose, someone would probably have run into it before and reported it... > Previously, I was passing a parameter to a class named 'Test' with a > function in it named 'go'. This is the syntax that I used, > Test.new.go('hello') The function 'go' would open a .xls file with > the parameter in the path, such as C:\hello\data.xls. Everything was > working fine then. Now, instead of using the actual string 'hello' as > the parameter, I am using an array element variable, so the syntax is > Test.new.go(array[x]). Now the 'go' function throws the ''File not > found' error. In the error message, both the path and file are > correct, so I do not understand why the file cannot be found. Hard to know what might be going on without sight of the code. There *must* be some difference between the literal string 'hello' and the array element. Things to suspect are: the array index 'x' doesn't point to a valid member; the input value array[x] is not what you expect - perhaps it contains spaces or newlines or wrong-case characters so that it doesn't stand out as wrong; the 'go' method is altering the parameter in some unanticipated way. I would recommend writing some tests for your class, so you can verify your assumptions about how that class works with different input. Give it both correct and incorrect input parameters, to check that it works in the first case and fails gracefully in the second. Writing tests can also help structure your code better; specifically to GUI code, it can help identify where too much application logic is being moved into the GUI layer. There are numerous testing frameworks for ruby; personally I find 'test/unit', included by default with Ruby, does everything I need, but you may wish to explore other options (eg rspec). hth a From rakaur at malkier.net Wed Dec 17 13:35:02 2008 From: rakaur at malkier.net (Eric Will) Date: Wed, 17 Dec 2008 13:35:02 -0500 Subject: [wxruby-users] ruby19-linux gem In-Reply-To: <4949258B.1020506@pressure.to> References: <4947B5ED.3020407@pressure.to> <4947CDD1.1020700@pressure.to> <4948452C.3020100@pressure.to> <376324F6-A003-494B-B08C-71824BE3C3D2@malkier.net> <4949258B.1020506@pressure.to> Message-ID: <009198CC-80C6-4C82-AE84-DFD7C731AA86@malkier.net> On Dec 17, 2008, at 11:15 AM, Alex Fenton wrote: > Thanks. I didn't know we even had a ruby19-linux gem available? > Anyway, I'll try compiling one for 1.9.9 and releasing as I'd be > interested to get this working for 2.0 It doesn't tell me what platform it's for. I just see it in gem list and install it. Seems to mostly work in OS X 10.5.5, just has lots of warnings. > cheers > a -- Eric From schmickcl at gmail.com Mon Dec 29 02:26:31 2008 From: schmickcl at gmail.com (Carlos Troncoso Phillips) Date: Mon, 29 Dec 2008 04:26:31 -0300 Subject: [wxruby-users] CalendarCtrl - Weekdays names - Month names Message-ID: <1230535591.20241.6.camel@alpha.thinkmint> Hi there! I've been using wxRuby for some days, and already done some quite neat apps, but (there is always a but) even though I thought WeekDays names and month names where governed by the OS (and local localization), my calendar shows up with english names. I haven't been able to find a method or attr on the calendarctrl to override this. So, is it possible to use custom names (Mon-Tue-Wed-Thu-Fri-Sat-Sun) -> (Lu-Ma-Mi-Ju-Vi-Sa-Do) as well as month names for use in foreign apps? Best regards Carlos Troncoso Phillips From alex at pressure.to Wed Dec 31 11:05:26 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 31 Dec 2008 16:05:26 +0000 Subject: [wxruby-users] CalendarCtrl - Weekdays names - Month names In-Reply-To: <1230535591.20241.6.camel@alpha.thinkmint> References: <1230535591.20241.6.camel@alpha.thinkmint> Message-ID: <495B9846.9080207@pressure.to> Hi Carlos Troncoso Phillips wrote: > I've been using wxRuby for some days, and already done some quite neat > apps, but (there is always a but) even though I thought WeekDays names > and month names where governed by the OS (and local localization), my > calendar shows up with english names. > I haven't been able to find a method or attr on the calendarctrl to > override this. > So, is it possible to use custom names (Mon-Tue-Wed-Thu-Fri-Sat-Sun) -> > (Lu-Ma-Mi-Ju-Vi-Sa-Do) as well as month names for use in foreign apps? > My native locale is en_GB, but when I added this to the top of the calendar sample: Wx::Locale.new(Wx::LANGUAGE_FRENCH) the calendar control correctly displays the weekdays as "Lun Mar Mer Jeu..." and with the french month names. This is on OS X. I had a look at the wxWidgets code that handles this, and it should be using the same locale-sensitive system calls as Ruby itself. Could you say a) what operating system you're using and b) whether a ruby call like Time.now.strftime("%A") returns the correct local name? You could try adding a call like the above Wx::Locale.new(Wx::LANGUAGE_XXX) for the correct language to see if that sets what you want. alex