From alex at pressure.to Sat Nov 1 13:32:43 2008 From: alex at pressure.to (Alex Fenton) Date: Sat, 01 Nov 2008 17:32:43 +0000 Subject: [wxruby-users] wxRuby 1.9.9 released Message-ID: <490C92BB.6000106@pressure.to> Hello I'm happy to announce that wxRuby version 1.9.9 is now available for download and gem installation: http://rubyforge.org/frs/?group_id=35&release_id=27842 gem install wxruby On Linux, the default binary gem is now dynamically linked to wxWidgets. This means you'll need to install wxWidgets from your package manager. See below for more info. == CHANGES == This recommended upgrade includes a substantial number of new GUI features, as well as fixing a number of bugs: * Added the RichText framework, providing word-processor like editing of styled/formatted text and inline images * Added a number of other useful GUI classes, such as VScrolledWindow, VListBox and HtmlListBox * Added the StandardPaths and NavigationKeyEvent classes * Fixed a number of bugs and warnings * Binary builds for Windows and OS X are based on the latest stable wxWidgets, 2.8.9, so benefitting from upstream fixes It had been planned that 1.9.8 was the last release before 2.0. 1.9.9 is a chance to give some new classes some testing time and get some fixes out there whilst finishing up the last few 2.0 blocker bugs (eg Clipboard probs on GTK, ScrolledWindow X errors). == LINUX BINARY GEMS == Previous binary builds for Linux were, like those for Windows and OS X, statically linked - meaning the wxRuby library included all the relevant wxWidgets code. With this release I've switched to offering a Linux gem that is dynamically linked - meaning it makes use of the wxWidgets library on your system - which should be easily installable from your package manager - eg apt-get install wxwidgets The reasoning here: * Because Linux systems vary a lot in what's installed by default, using the static build generally still required messing around installing new packages * Package managers make it trivially easy to install a recent version of wxWidgets on major distros * The shared builds are substantially smaller and may perform better I'm open to discussion on this based on experiences on different distros (I've only tested on Ubuntu). == ACKNOWLEDGEMENTS == Thanks to all those who contributed bug reports and feature requests to this release, as well as those who keep the project ticking over in other ways such as keeping the wiki up to date and taking part on the mailing list. cheers alex From lists at ruby-forum.com Mon Nov 3 11:35:17 2008 From: lists at ruby-forum.com (=?utf-8?Q?Anton_H=c3=b6rnquist?=) Date: Mon, 3 Nov 2008 17:35:17 +0100 Subject: [wxruby-users] paint_buffered Message-ID: <5ddda770eb0c149c683c34d8f4413087@ruby-forum.com> Hello, In order to reduce flicker in my paint-intense app I've switched from paint |dc| to paint_buffered |dc|. Unfortunately, there is no difference after switching. Does anyone know why? Are there any other workarounds for this? I'm on winxp, ruby 1.8.4, wxruby 1.9.9 (i've tried wxruby 1.9.8 but the result is the same) /Anton -- Posted via http://www.ruby-forum.com/. From johnnyk3 at gmail.com Mon Nov 3 11:56:01 2008 From: johnnyk3 at gmail.com (John Kennedy) Date: Mon, 3 Nov 2008 11:56:01 -0500 Subject: [wxruby-users] paint_buffered In-Reply-To: <5ddda770eb0c149c683c34d8f4413087@ruby-forum.com> References: <5ddda770eb0c149c683c34d8f4413087@ruby-forum.com> Message-ID: This is something that I've spent *many* days ripping my hair out over. Eventually, I found that I was calling 'paint' when I should have used 'refresh'. Could you supply us with some code so we could take a look? On Mon, Nov 3, 2008 at 11:35 AM, Anton H?rnquist wrote: > Hello, > > In order to reduce flicker in my paint-intense app I've switched from > paint |dc| to paint_buffered |dc|. Unfortunately, there is no difference > after switching. Does anyone know why? Are there any other workarounds > for this? > > I'm on winxp, ruby 1.8.4, wxruby 1.9.9 (i've tried wxruby 1.9.8 but the > result is the same) > > /Anton > -- > 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 alex at pressure.to Mon Nov 3 12:51:26 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 03 Nov 2008 17:51:26 +0000 Subject: [wxruby-users] paint_buffered In-Reply-To: <5ddda770eb0c149c683c34d8f4413087@ruby-forum.com> References: <5ddda770eb0c149c683c34d8f4413087@ruby-forum.com> Message-ID: <490F3A1E.9030209@pressure.to> Anton H?rnquist wrote: > In order to reduce flicker in my paint-intense app I've switched from > paint |dc| to paint_buffered |dc|. Unfortunately, there is no difference > after switching. Does anyone know why? Are there any other workarounds > for this? > > I'm on winxp, ruby 1.8.4, wxruby 1.9.9 (i've tried wxruby 1.9.8 but the > result is the same) > Avoiding flicker in GUI apps is unfortunately not as easy as using paint_buffered, although it helps in a lot of cases. It would be good to see some code that we can actually run, and more information about the app - eg is the refreshing event-driven (the user doees something, the display changes) or time-driven? To what extent can future drawing be predicted? Is the drawing itself complex, or is there a lot of computationally intensive non-drawing code in paint? Does everything change at once? Depending on this different things might help - eg preparing drawing in idle time, only updating voided parts of the canvas, etc alex From damnbigman at gmail.com Mon Nov 3 14:44:04 2008 From: damnbigman at gmail.com (Glen Holcomb) Date: Mon, 3 Nov 2008 12:44:04 -0700 Subject: [wxruby-users] Sorting Grid by column In-Reply-To: <49065886.2040804@pressure.to> References: <48800a90810271343j67f7db05u10b0eec14b8e886b@mail.gmail.com> <49065886.2040804@pressure.to> Message-ID: <48800a90811031144x2463dd66sd27ad441fceaaa2c@mail.gmail.com> On Mon, Oct 27, 2008 at 5:10 PM, Alex Fenton wrote: > Glen Holcomb wrote: > >> What would be the best way to sort a grid by the column the user clicks >> on? I have a bunch of database info being represented in grids (via >> GridTableBase) that I would like to be sortable by different columns. I >> didn't see anything in the Grid or GridTableBase about a column select >> event. >> > There is an event evt_grid_label_left_click which is fired when a row or > column header is clicked on. You can call get_col on the event object to > find out which column was clicked. There are also similar events for right > clicks and double clicks. > > To re-order a column, I think it should be enough to change what > GridTableBase is returning in your case, and then calling refresh on the > Grid. > > To select a whole column just use Grid#select_col method. > > cheers > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > Thanks Alex! It works beautifully. -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 Mon Nov 3 18:38:03 2008 From: lists at ruby-forum.com (=?utf-8?Q?Anton_H=c3=b6rnquist?=) Date: Tue, 4 Nov 2008 00:38:03 +0100 Subject: [wxruby-users] paint_buffered In-Reply-To: <490F3A1E.9030209@pressure.to> References: <5ddda770eb0c149c683c34d8f4413087@ruby-forum.com> <490F3A1E.9030209@pressure.to> Message-ID: Alex Fenton wrote: > It would be good to see some code that we can actually run, and more > information about the app - eg is the refreshing event-driven (the user > doees something, the display changes) or time-driven? To what extent can > future drawing be predicted? Is the drawing itself complex, or is there > a lot of computationally intensive non-drawing code in paint? Does > everything change at once? > > Depending on this different things might help - eg preparing drawing in > idle time, only updating voided parts of the canvas, etc Sure! Find memu.rb attached. It's a little hack, a monome emulator. You will need rosc by hans fugal for it to work - hans.fugal.net/src/rosc/. See www.monome.org for details about the actual device. The MemuWindow is refreshed when a user presses or releases one of the buttons on the virtual device (mouse cursor and evt_left_down/evt_left_up). The box around the button is thickened. Also, when certain osc parameters are received, the leds within the buttons are lit up! There is really no complex drawing going on, just a bunch of rectangles :), but it's rather important that the stuff is updated in realtime. Perhaps Ruby aint the ideal language for this. /Anton Attachments: http://www.ruby-forum.com/attachment/2890/memu.rb -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Nov 3 19:52:02 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 04 Nov 2008 00:52:02 +0000 Subject: [wxruby-users] paint_buffered In-Reply-To: References: <5ddda770eb0c149c683c34d8f4413087@ruby-forum.com> <490F3A1E.9030209@pressure.to> Message-ID: <490F9CB2.6030800@pressure.to> Anton H?rnquist wrote: > Alex Fenton wrote: > >> It would be good to see some code that we can actually run, and more >> information about the app - eg is the refreshing event-driven (the user >> doees something, the display changes) or time-driven? > Sure! Find memu.rb attached. It's a little hack, a monome emulator. You > will need rosc by hans fugal for it to work - hans.fugal.net/src/rosc/. > See www.monome.org for details about the actual device. Thanks, looks interesting although I have only a hazy idea what it's about. Please don't take this the wrong way, but if you're sending in code for advice it's much preferred that the code is self-contained (as yours is) and doesn't have external dependencies that need to be installed (as yours does). I and others on this list are really happy to try things out and advise, but it's too much to expect people to download, compile and install third-party libs to do that. >> Depending on this different things might help - eg preparing drawing in >> idle time, only updating voided parts of the canvas, etc > > > The MemuWindow is refreshed when a user presses or releases one of the > buttons on the virtual device (mouse cursor and > evt_left_down/evt_left_up). The box around the button is thickened. > Also, when certain osc parameters are received, the leds within the > buttons are lit up! > I haven't tried it out, but from reviewing your script perhaps I can make a few suggestions: First, and most important, it looks like you're repainting the whole 64 buttons when, for any given event, only one has changed state. An alternate and more efficient approach might be to make each LED a separate widget, an instance of a class inheriting from Wx::Window. It knows its state, and draws its own rectangle. The TargetControl class in the events.rb sample would be an example to look at for this. You could then layout the buttons using a 8x8 Wx::GridSizer, store them in a two dimensional array (faster lookup than your buttons.detect method), then when an event is received, change the state of the relevant button and call refresh (or update) on it alone. This means that a much smaller amount of drawing has to be done for each change. It would also make your handling of left-down and left-up simpler as you wouldn't have to test which LED might have been hit. Second, you might see whether, if each LED has only an on and off state and these look the same, whether it is faster to cache an image for each state and do draw_bitmap for each button. It may or may not be faster than drawing each one with primitives like draw_rectangle. Third, you could try playing around with, instead of having the server in a different ruby thread, polling it for messages in evt_idle or directly in a timer (Wx::Timer.every(20) { server.serve }). Also, is it possible to have update the UI based only on server messages - ie evt_left_down only notifies the server of change of state, and the server notifies back to update the GUI? This design is generally more scalable, in my experience, than having the state-changing event handler also update the UI. > There is really no complex drawing going on, just a bunch of rectangles > :), but it's rather important that the stuff is updated in realtime. > Perhaps Ruby aint the ideal language for this. Ruby's certainly slow, and while wxRuby's a decently fast GUI toolkit, the SWIG wrapping has significant overhead to each method call. That said, I used Jay McGavren's Zyps library, which draws a lot of primitives from scratch on a timed basis, and was able to get pretty smooth animation (definitely more than 20fps I think). You might find those wxruby-users threads in Dec 2007 / Jan 2008 of interest. hth alex From kirill.likhodedov at gmail.com Wed Nov 5 05:10:24 2008 From: kirill.likhodedov at gmail.com (=?UTF-8?B?0JrQuNGA0LjQu9C7INCb0LjRhdC+0LTQtdC00L7Qsg==?=) Date: Wed, 5 Nov 2008 13:10:24 +0300 Subject: [wxruby-users] How to deselect the text Message-ID: <236e49df0811050210g1286db8bq9f5d834a39b0d7d3@mail.gmail.com> Hi, I'm using TextCtrl and initially set some text in it. And all the text is selected by default. How can I deselect it? By the way, TextCtrl#set_selection() doesn't work... What am I doing wrong? Thanks a lot, Kirill. Here's the sample: ====================== wxtest.rb =========================== require 'wx' class TestFrame < Wx::Frame def initialize super(nil, -1, "Test") text = Wx::TextCtrl.new(self, -1, "first_line\n", :style => Wx::TE_RICH|Wx::TE_RICH2|Wx::TE_MULTILINE) text.append_text "second line" text.set_selection(3, 4) end end class TestApp < Wx::App def on_init TestFrame.new.show end end TestApp.new.main_loop -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirill.likhodedov at gmail.com Wed Nov 5 05:11:44 2008 From: kirill.likhodedov at gmail.com (=?UTF-8?B?0JrQuNGA0LjQu9C7INCb0LjRhdC+0LTQtdC00L7Qsg==?=) Date: Wed, 5 Nov 2008 13:11:44 +0300 Subject: [wxruby-users] wxRuby 1.9.9 released In-Reply-To: <490C92BB.6000106@pressure.to> References: <490C92BB.6000106@pressure.to> Message-ID: <236e49df0811050211w7ef57c42x251179bf46081d69@mail.gmail.com> Great work, Alex! By the way, the Windows version now seems to be much more verbose on errors. This is very helpful, thanks a lot. Kirill. 2008/11/1 Alex Fenton > Hello > > I'm happy to announce that wxRuby version 1.9.9 is now available for > download and gem installation: > > http://rubyforge.org/frs/?group_id=35&release_id=27842 > gem install wxruby > > On Linux, the default binary gem is now dynamically linked to wxWidgets. > This means you'll need to install wxWidgets from your package manager. See > below for more info. > > == CHANGES == > > This recommended upgrade includes a substantial number of new GUI features, > as well as fixing a number of bugs: > > * Added the RichText framework, providing word-processor like editing of > styled/formatted text and inline images > * Added a number of other useful GUI classes, such as VScrolledWindow, > VListBox and HtmlListBox > * Added the StandardPaths and NavigationKeyEvent classes > * Fixed a number of bugs and warnings > * Binary builds for Windows and OS X are based on the latest stable > wxWidgets, 2.8.9, so benefitting from upstream fixes > > It had been planned that 1.9.8 was the last release before 2.0. 1.9.9 is a > chance to give some new classes some testing time and get some fixes out > there whilst finishing up the last few 2.0 blocker bugs (eg Clipboard probs > on GTK, ScrolledWindow X errors). > > == LINUX BINARY GEMS == > > Previous binary builds for Linux were, like those for Windows and OS X, > statically linked - meaning the wxRuby library included all the relevant > wxWidgets code. With this release I've switched to offering a Linux gem that > is dynamically linked - meaning it makes use of the wxWidgets library on > your system - which should be easily installable from your package manager - > eg apt-get install wxwidgets > > The reasoning here: > * Because Linux systems vary a lot in what's installed by default, using > the static build generally still required messing around installing new > packages > * Package managers make it trivially easy to install a recent version of > wxWidgets on major distros > * The shared builds are substantially smaller and may perform better > > I'm open to discussion on this based on experiences on different distros > (I've only tested on Ubuntu). > > == ACKNOWLEDGEMENTS == > > Thanks to all those who contributed bug reports and feature requests to > this release, as well as those who keep the project ticking over in other > ways such as keeping the wiki up to date and taking part on the mailing > list. > > cheers > alex _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Nov 5 06:28:45 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 05 Nov 2008 11:28:45 +0000 Subject: [wxruby-users] wxRuby 1.9.9 released In-Reply-To: <236e49df0811050211w7ef57c42x251179bf46081d69@mail.gmail.com> References: <490C92BB.6000106@pressure.to> <236e49df0811050211w7ef57c42x251179bf46081d69@mail.gmail.com> Message-ID: <4911836D.4070701@pressure.to> ?????? ????????? wrote: > Great work, Alex! > :) > By the way, the Windows version now seems to be much more verbose on > errors. That's useful to know, thanks for following this up. I think the difference is that I compiled the new version of wxWidgets for wxRuby 1.9.9 with wxUSE_EXCEPTIONS set 0 instead of 1. I'm guessing what was happening was that C++ exceptions were leaking through to Ruby, which is a bad thing and caused the uninformative crashes you reported. I'll make this part of the official build instructions from now on. alex From alex at pressure.to Wed Nov 5 06:35:29 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 05 Nov 2008 11:35:29 +0000 Subject: [wxruby-users] How to deselect the text In-Reply-To: <236e49df0811050210g1286db8bq9f5d834a39b0d7d3@mail.gmail.com> References: <236e49df0811050210g1286db8bq9f5d834a39b0d7d3@mail.gmail.com> Message-ID: <49118501.2020107@pressure.to> ?????? ????????? wrote > I'm using TextCtrl and initially set some text in it. And all the text > is selected by default. > How can I deselect it? > By the way, TextCtrl#set_selection() doesn't work... What am I doing > wrong? Thanks for reporting this and providing a clear test case. I've tried it out and it seems to be a bug, specific to Windows. I was a bit surprised as I'm fairly sure this used to work. If you're able, please could you file this on the bug tracker and attach your example as a test case. This will be a MUSTFIX for 2.0. By the way, if you're using RICH and RICH2 for formatting, you might see if RichTextCtrl works better for you. TextCtrl + RICH2 has some cross-platform quirks, although it will be better for accessibility I guess. thanks alex From kirill.likhodedov at gmail.com Wed Nov 5 07:07:18 2008 From: kirill.likhodedov at gmail.com (Kirill Likhodedov) Date: Wed, 5 Nov 2008 15:07:18 +0300 Subject: [wxruby-users] How to deselect the text In-Reply-To: <49118501.2020107@pressure.to> References: <236e49df0811050210g1286db8bq9f5d834a39b0d7d3@mail.gmail.com> <49118501.2020107@pressure.to> Message-ID: <236e49df0811050407l16c6e7b7yab0a926f94dc1a98@mail.gmail.com> > > >> Thanks for reporting this and providing a clear test case. I've tried it > out and it seems to be a bug, specific to Windows. I was a bit surprised as > I'm fairly sure this used to work. > > If you're able, please could you file this on the bug tracker and attach > your example as a test case. This will be a MUSTFIX for 2.0. Done: http://rubyforge.org/tracker/index.php?func=detail&aid=22686&group_id=35&atid=218 And it also didn't work in 1.9.8, I just didn't pay attention to it at that time. By the way, is it also a bug that the whole text is selected by default? By the way, if you're using RICH and RICH2 for formatting, you might see if > RichTextCtrl works better for you. TextCtrl + RICH2 has some cross-platform > quirks, although it will be better for accessibility I guess. I'm not sure that I need all the power provided by RichTextCtrl, it looks that for my task simple TextCtrl is just fine. But I'll try, thanks for pointing to it. Regards, Kirill. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirill.likhodedov at gmail.com Wed Nov 5 07:38:47 2008 From: kirill.likhodedov at gmail.com (Kirill Likhodedov) Date: Wed, 5 Nov 2008 15:38:47 +0300 Subject: [wxruby-users] More rubish API Message-ID: <236e49df0811050438x55e91c18v636e4250e82e304a@mail.gmail.com> Hi, Sometimes I find places in WxRuby API which seem to me not quite Ruby way compatible. :) I know (it's written somewhere on the wxruby site), that there is an acvity to make WxRuby more Rubish. I don't feel enough confident in Ruby or WxRuby to fully participate, but I'd like to point to some places which could be improved. Where is the best place to do it? This mailing list or bug tracker or somewhere else? :) For example, that's what I've noticed while examining RichTextAttr#apply: "Applies the attributes in style to the original object, but not those attributes from style that are the same as those in compareWith (if passed). See also RichTextAttr#combine for a function that does almost the same but returns a new object instead of modifying the original object." I'd mark combine as deprecated and use apply! instead, because that's what exclamation mark is for. What do you think? Best regards, Kirill. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kirill.likhodedov at gmail.com Wed Nov 5 08:22:17 2008 From: kirill.likhodedov at gmail.com (Kirill Likhodedov) Date: Wed, 5 Nov 2008 16:22:17 +0300 Subject: [wxruby-users] More rubish API In-Reply-To: <236e49df0811050438x55e91c18v636e4250e82e304a@mail.gmail.com> References: <236e49df0811050438x55e91c18v636e4250e82e304a@mail.gmail.com> Message-ID: <236e49df0811050522i55405e1fj4c1f0518d47996b4@mail.gmail.com> What I also would like to propose is to make set-methods "chainable".Currently I have to do the following: style = Wx::RichTextAttr.new style.set_font_face_name("Verdana") style.set_font_size(10) I would like to do: style = Wx::RichTextAttr.new style.set_font_face_name("Verdana").set_font_size(10) etc. This can be easily done by returning self object after modifying it. I also would like to point that set_text_colour and set_background_colour are named in a british manner (OUR), which is fine for language, but is not traditional for IT, which uses color (OR). It looks reasonable to change or at least alias this. Thanks, Kirill 2008/11/5 Kirill Likhodedov > Hi, > Sometimes I find places in WxRuby API which seem to me not quite Ruby way > compatible. :) > I know (it's written somewhere on the wxruby site), that there is an acvity > to make WxRuby more Rubish. > I don't feel enough confident in Ruby or WxRuby to fully participate, but > I'd like to point to some places which could be improved. > Where is the best place to do it? This mailing list or bug tracker or > somewhere else? :) > > For example, that's what I've noticed while examining RichTextAttr#apply: > "Applies the attributes in style to the original object, but not those > attributes from style that are the same as those in compareWith (if passed). > See also RichTextAttr#combine for a function that does almost the same but > returns a new object instead of modifying the original object." > > I'd mark combine as deprecated and use apply! instead, because that's what > exclamation mark is for. What do you think? > > Best regards, > Kirill. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Nov 5 12:06:05 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 05 Nov 2008 17:06:05 +0000 Subject: [wxruby-users] How to deselect the text In-Reply-To: <236e49df0811050407l16c6e7b7yab0a926f94dc1a98@mail.gmail.com> References: <236e49df0811050210g1286db8bq9f5d834a39b0d7d3@mail.gmail.com> <49118501.2020107@pressure.to> <236e49df0811050407l16c6e7b7yab0a926f94dc1a98@mail.gmail.com> Message-ID: <4911D27D.1000509@pressure.to> Kirill Likhodedov wrote: > Done: > http://rubyforge.org/tracker/index.php?func=detail&aid=22686&group_id=35&atid=218 > Thanks > And it also didn't work in 1.9.8, I just didn't pay attention to it at > that time. > > By the way, is it also a bug that the whole text is selected by default? Yes, I think so. It doesn't do this on other platforms. a From alex at pressure.to Wed Nov 5 12:29:33 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 05 Nov 2008 17:29:33 +0000 Subject: [wxruby-users] More rubish API In-Reply-To: <236e49df0811050438x55e91c18v636e4250e82e304a@mail.gmail.com> References: <236e49df0811050438x55e91c18v636e4250e82e304a@mail.gmail.com> Message-ID: <4911D7FD.7070303@pressure.to> Kirill Likhodedov wrote: > Sometimes I find places in WxRuby API which seem to me not quite Ruby > way compatible. :) Yes, me too. It's pretty much a straight port of the C++ wxWidgets API, with a few additions to make it more comfortable in ruby (eg accessor-like method names, using symbols to name event handlers, keyword constructors for Windows). And the wxWidgets API itself is not especially consistent across classes in the way that similar methods work. > I know (it's written somewhere on the wxruby site), that there is an > acvity to make WxRuby more Rubish. This activity - which was under the project 'wxSugar' has kind of been in abeyance. Basically my time has been focussed on extending and correcting the SWIG wrapping. This stuff is pretty hard for newcomers to do - things like dealing with cross-language memory handling and wrapping virtual classes. But much of the syntax enhancement work can be done - or at least prototyped - in ruby. We've also tried to keep the API stable since around version 1.9.2, so this has limited scope for big changes. But I would see wxRuby 3.0 as the place to be more radical and ruby-ify the API. I think then we also have a better view of all the places where changes might be desirable, to increase consistency. > I don't feel enough confident in Ruby or WxRuby to fully participate, > but I'd like to point to some places which could be improved. Any contributions and discussions on these topics are very welcome. > Where is the best place to do it? This mailing list or bug tracker or > somewhere else? :) Probably the wxruby-development mailing list for detailed syntax discussions. > For example, that's what I've noticed while examining RichTextAttr#apply: > "Applies the attributes in style to the original object, but not those > attributes from style that are the same as those in compareWith (if > passed). > See also RichTextAttr#combine for a function that does almost the same > but returns a new object instead of modifying the original object." > > I'd mark combine as deprecated and use apply! instead, because that's > what exclamation mark is for. What do you think? I'd agree - but at the same time, I'd say it's important to make this change across all places it's relevant at the same time. There are a few other methods I think that have this pattern. alex From alex at pressure.to Wed Nov 5 12:41:50 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 05 Nov 2008 17:41:50 +0000 Subject: [wxruby-users] More rubish API In-Reply-To: <236e49df0811050522i55405e1fj4c1f0518d47996b4@mail.gmail.com> References: <236e49df0811050438x55e91c18v636e4250e82e304a@mail.gmail.com> <236e49df0811050522i55405e1fj4c1f0518d47996b4@mail.gmail.com> Message-ID: <4911DADE.1080903@pressure.to> Kirill Thanks for the discussion. Kirill Likhodedov wrote: > What I also would like to propose is to make set-methods "chainable". > Currently I have to do the following: > style = Wx::RichTextAttr.new > style.set_font_face_name("Verdana") > style.set_font_size(10) > I would like to do: > style = Wx::RichTextAttr.new > style.set_font_face_name("Verdana").set_font_size(10) > etc. I'm not generally a fan of method chaining - to me your second example is less clear than your first. It's 40 or 50 characters without any white space. I'd use a keyword constructor here, or a more declarative set of statements: attr = Wx::RichTextAttr.new( :font_face_name => 'Verdana', :font_size => 10 ) or attr = Wx::RichAttr.new attr.font_face_name = 'Verdana' attr.font_size = 10 The second should already work. > > This can be easily done by returning self object after modifying it. Sure, if you would like this change, you can implement it yourself right away. Add something like this to your personal wx_additions library: class Wx::RichTextAttr instance_methods.grep(/^set/) do | method_name | old_method = instance_method(method_name) define_method(method_name) do | *args | old_method.bind(self).call(*args) self end end end > I also would like to point that set_text_colour and > set_background_colour are named in a british manner (OUR), which is > fine for > language, but is not traditional for IT, which uses color (OR). It > looks reasonable to change or at least alias this. Hehe. I'm British and this is my single favo_u_rite feature of wxWidgets and wxRuby. To replace them in the core lib with nasty US mis-spellings, you'll have to prise them from my cold dead fingers. :) Again, ruby makes it easy to change if it bothers you: Wx::Color = Wx::Colour alias :get_background_color :get_background_colour etc cheers alex From chauk.mean at gmail.com Thu Nov 6 06:08:05 2008 From: chauk.mean at gmail.com (Chauk-Mean P) Date: Thu, 6 Nov 2008 12:08:05 +0100 Subject: [wxruby-users] Enter key issue with RichTextCtrl Message-ID: Hi, I'm trying to use RichTextCtrl available with wxRuby 1.9.9 instead of TextCtrl and the Enter key does not work (as what I expect). With TextCtrl (with Wx::TE_MULTILINE), the Enter key creates a new line of text. With RichTextCtrl, the Enter key changes the focus to another widget. I saw a workaround for wxPython with the style WANTS_CHARS but there is no such constant in wxRuby. Thanks in advance. Chauk-Mean. From alex at pressure.to Thu Nov 6 06:36:04 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 06 Nov 2008 11:36:04 +0000 Subject: [wxruby-users] Enter key issue with RichTextCtrl In-Reply-To: References: Message-ID: <4912D6A4.8090404@pressure.to> Hi Chauk-Mean Chauk-Mean P wrote: > I'm trying to use RichTextCtrl available with wxRuby 1.9.9 instead of > TextCtrl and the Enter key does not work (as what I expect). > With TextCtrl (with Wx::TE_MULTILINE), the Enter key creates a new line of text. > With RichTextCtrl, the Enter key changes the focus to another widget. > Thanks for reporting this. I tried it out on OS X with my little RichText sample, where the widget is created with the default style and has no special event handling. The Enter key works as I'd expect - i.e. inserts a new line. Do you perhaps have an event handler defined that you need to call skip on the event so that it's passed for normal processing? > I saw a workaround for wxPython with the style WANTS_CHARS but there > is no such constant in wxRuby. Are you sure? It definitely seems to be available as Wx::WANTS_CHARS, with the value 262144. If not, please report as a bug. cheers alex From Franz.Irlweg.ZNT at wacker.com Thu Nov 6 06:39:06 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Thu, 6 Nov 2008 12:39:06 +0100 Subject: [wxruby-users] wxRuby 1.9.9 released In-Reply-To: <490C92BB.6000106@pressure.to> References: <490C92BB.6000106@pressure.to> Message-ID: Hello together, I tried to install wxruby 1.9.9 () on a SLES10 Linux server. - First I installed the wxWidgets rpm. - then the wxruby gem When trying to start an example I get the following error: /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: libwx_gtk2u_gl-2.8.so.0: cannot open shared object file: No such file or directory - /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib /wxruby2.so (LoadError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wx.rb:12 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from grid.rb:8 I made the following check: ldd wxruby2.so ./wxruby2.so: /usr/lib/libwx_gtk2u_stc-2.8.so.0: no version information available (required by ./wxruby2.so) linux-gate.so.1 => (0xffffe000) libwx_gtk2u_stc-2.8.so.0 => /usr/lib/libwx_gtk2u_stc-2.8.so.0 (0xb761c000) libwx_gtk2u_gl-2.8.so.0 => not found libwx_gtk2u_media-2.8.so.0 => not found libwx_gtk2u_richtext-2.8.so.0 => not found libwx_gtk2u_aui-2.8.so.0 => not found libwx_gtk2u_xrc-2.8.so.0 => not found libwx_gtk2u_qa-2.8.so.0 => not found libwx_gtk2u_html-2.8.so.0 => not found libwx_gtk2u_adv-2.8.so.0 => not found libwx_gtk2u_core-2.8.so.0 => not found libwx_baseu_xml-2.8.so.0 => not found libwx_baseu_net-2.8.so.0 => not found libwx_baseu-2.8.so.0 => not found libdl.so.2 => /lib/libdl.so.2 (0xb7616000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xb75e2000) libgtk-x11-2.0.so.0 => /opt/gnome/lib/libgtk-x11-2.0.so.0 (0xb72ee000) ... then next are available I also installed all the available gtk libraries on the server. Thanks for any help! Franz -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Saturday, November 01, 2008 6:33 PM To: General discussion of wxRuby Subject: [wxruby-users] wxRuby 1.9.9 released Hello I'm happy to announce that wxRuby version 1.9.9 is now available for download and gem installation: http://rubyforge.org/frs/?group_id=35&release_id=27842 gem install wxruby On Linux, the default binary gem is now dynamically linked to wxWidgets. This means you'll need to install wxWidgets from your package manager. See below for more info. == CHANGES == This recommended upgrade includes a substantial number of new GUI features, as well as fixing a number of bugs: * Added the RichText framework, providing word-processor like editing of styled/formatted text and inline images * Added a number of other useful GUI classes, such as VScrolledWindow, VListBox and HtmlListBox * Added the StandardPaths and NavigationKeyEvent classes * Fixed a number of bugs and warnings * Binary builds for Windows and OS X are based on the latest stable wxWidgets, 2.8.9, so benefitting from upstream fixes It had been planned that 1.9.8 was the last release before 2.0. 1.9.9 is a chance to give some new classes some testing time and get some fixes out there whilst finishing up the last few 2.0 blocker bugs (eg Clipboard probs on GTK, ScrolledWindow X errors). == LINUX BINARY GEMS == Previous binary builds for Linux were, like those for Windows and OS X, statically linked - meaning the wxRuby library included all the relevant wxWidgets code. With this release I've switched to offering a Linux gem that is dynamically linked - meaning it makes use of the wxWidgets library on your system - which should be easily installable from your package manager - eg apt-get install wxwidgets The reasoning here: * Because Linux systems vary a lot in what's installed by default, using the static build generally still required messing around installing new packages * Package managers make it trivially easy to install a recent version of wxWidgets on major distros * The shared builds are substantially smaller and may perform better I'm open to discussion on this based on experiences on different distros (I've only tested on Ubuntu). == ACKNOWLEDGEMENTS == Thanks to all those who contributed bug reports and feature requests to this release, as well as those who keep the project ticking over in other ways such as keeping the wiki up to date and taking part on the mailing list. cheers 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: Rudolf Staudigl From chauk.mean at gmail.com Thu Nov 6 07:47:10 2008 From: chauk.mean at gmail.com (Chauk-Mean P) Date: Thu, 6 Nov 2008 13:47:10 +0100 Subject: [wxruby-users] Enter key issue with RichTextCtrl In-Reply-To: <4912D6A4.8090404@pressure.to> References: <4912D6A4.8090404@pressure.to> Message-ID: Hi Alex, 2008/11/6 Alex Fenton : > > Chauk-Mean P wrote: >> >> I'm trying to use RichTextCtrl available with wxRuby 1.9.9 instead of >> TextCtrl and the Enter key does not work (as what I expect). >> With TextCtrl (with Wx::TE_MULTILINE), the Enter key creates a new line of >> text. >> With RichTextCtrl, the Enter key changes the focus to another widget. >> > > Thanks for reporting this. I tried it out on OS X with my little RichText > sample, where the widget is created with the default style and has no > special event handling. The Enter key works as I'd expect - i.e. inserts a > new line. I forgot to mention that I'm using Windows XP. > Do you perhaps have an event handler defined that you need to call skip on > the event so that it's passed for normal processing? I don't have any event handler on the RichTextCtrl. >> I saw a workaround for wxPython with the style WANTS_CHARS but there >> is no such constant in wxRuby. > > Are you sure? It definitely seems to be available as Wx::WANTS_CHARS, with > the value 262144. Oups ! I wrote the constant correctly in this message but in my code I wrote Wx::ACCEPTS_CHARS !! Now, with a style set to Wx::WANTS_CHARS, RichTextCtrl works as expected. So the workaround is actually applicable. This may be defined as the default style at the the wxRuby level if this does not harm on OSX and Linux. Also, do you have / intend to add a RichTextCtrl sample ? Cheers. Chauk-Mean. From alex at pressure.to Thu Nov 6 09:37:39 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 06 Nov 2008 14:37:39 +0000 Subject: [wxruby-users] wxRuby 1.9.9 released In-Reply-To: References: <490C92BB.6000106@pressure.to> Message-ID: <49130133.8020507@pressure.to> Hi Franz Irlweg, Franz (ZNT) wrote: > Hello together, > > I tried to install wxruby 1.9.9 () on a SLES10 Linux server. > > - First I installed the wxWidgets rpm. > - then the wxruby gem > > When trying to start an example I get the following error: > /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: > libwx_gtk2u_gl-2.8.so.0: cannot open shared object file: No such > file or directory - ... > > ldd wxruby2.so > > ./wxruby2.so: /usr/lib/libwx_gtk2u_stc-2.8.so.0: no version information > available (required by ./wxruby2.so) > linux-gate.so.1 => (0xffffe000) > libwx_gtk2u_stc-2.8.so.0 => /usr/lib/libwx_gtk2u_stc-2.8.so.0 > (0xb761c000) > libwx_gtk2u_gl-2.8.so.0 => not found > libwx_gtk2u_media-2.8.so.0 => not found > libwx_gtk2u_richtext-2.8.so.0 => not found ... etc Thanks for the report. I think the problem is that the Ubuntu wxWidgets that the gem was built against was compiled in 'multilib' form - ie with each group of features in a separate .so. It looks like the .rpm you have was built 'monolithic' - ie with everything stuffed into a single .so. Could you see what "wx-config --libs" returns please? I'm not sure how we get around this if different distros build in different ways. How did you get on previously with the statically-linked gems? cheers alex From alex at pressure.to Thu Nov 6 09:43:15 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 06 Nov 2008 14:43:15 +0000 Subject: [wxruby-users] Enter key issue with RichTextCtrl In-Reply-To: References: <4912D6A4.8090404@pressure.to> Message-ID: <49130283.4030000@pressure.to> Chauk-Mean P wrote: > Oups ! I wrote the constant correctly in this message but in my code I > wrote Wx::ACCEPTS_CHARS !! > Now, with a style set to Wx::WANTS_CHARS, RichTextCtrl works as expected. > So the workaround is actually applicable. > This may be defined as the default style at the the wxRuby level if > this does not harm on OSX and Linux. > I'm a bit surprised that it behaves like this by default on Windows. I would have thought that the standard desirable behaviour for this kind of text editing widget would be to always consume Enter strokes. I'll check that it's not something introduced by the wrapping, and if not, will do as you suggest. > Also, do you have / intend to add a RichTextCtrl sample ? > I don't have one in a good enough state to be added, just a mishmash of stuff I used to test the various features as I added them. It would be very good to have a sample - I don't think it has to be as complex as the wxWidgets one - but at the moment writing samples is for me less of a priority than finishing the core lib. Contributions welcome. cheers alex From Franz.Irlweg.ZNT at wacker.com Thu Nov 6 10:36:25 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Thu, 6 Nov 2008 16:36:25 +0100 Subject: [wxruby-users] wxRuby 1.9.9 released In-Reply-To: <49130133.8020507@pressure.to> References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> Message-ID: Hi Alex, thanks for the rapid answer! 1. wx-config --libs -L/usr/local/lib -pthread -L/usr/X11R6/lib -lwx_gtk2_richtext-2.8 -lwx_gtk2_aui-2.8 -lwx_gtk2_xrc-2.8 -lwx_gtk2_qa-2.8 -lwx_gtk2_html-2.8 -lwx_gtk2_adv-2.8 -lwx_gtk2_core-2.8 -lwx_base_xml-2.8 -lwx_base_net-2.8 -lwx_base-2.8 2. this is my first try to run wxruby on linux. Until now I used it only on Windows. cheers, Franz -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Thursday, November 06, 2008 3:38 PM To: General discussion of wxRuby Subject: Re: [wxruby-users] wxRuby 1.9.9 released Hi Franz Irlweg, Franz (ZNT) wrote: > Hello together, > > I tried to install wxruby 1.9.9 () on a SLES10 Linux server. > > - First I installed the wxWidgets rpm. > - then the wxruby gem > > When trying to start an example I get the following error: > /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: > libwx_gtk2u_gl-2.8.so.0: cannot open shared object file: No such > file or directory - ... > > ldd wxruby2.so > > ./wxruby2.so: /usr/lib/libwx_gtk2u_stc-2.8.so.0: no version > information available (required by ./wxruby2.so) > linux-gate.so.1 => (0xffffe000) > libwx_gtk2u_stc-2.8.so.0 => /usr/lib/libwx_gtk2u_stc-2.8.so.0 > (0xb761c000) > libwx_gtk2u_gl-2.8.so.0 => not found > libwx_gtk2u_media-2.8.so.0 => not found > libwx_gtk2u_richtext-2.8.so.0 => not found ... etc Thanks for the report. I think the problem is that the Ubuntu wxWidgets that the gem was built against was compiled in 'multilib' form - ie with each group of features in a separate .so. It looks like the .rpm you have was built 'monolithic' - ie with everything stuffed into a single .so. Could you see what "wx-config --libs" returns please? I'm not sure how we get around this if different distros build in different ways. How did you get on previously with the statically-linked gems? cheers 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: Rudolf Staudigl From alex at pressure.to Thu Nov 6 12:26:20 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 06 Nov 2008 17:26:20 +0000 Subject: [wxruby-users] wxRuby 1.9.9 on SLES 10 In-Reply-To: References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> Message-ID: <491328BC.9040804@pressure.to> Irlweg, Franz (ZNT) wrote: > wx-config --libs > -L/usr/local/lib -pthread -L/usr/X11R6/lib -lwx_gtk2_richtext-2.8 > -lwx_gtk2_aui-2.8 -lwx_gtk2_xrc-2.8 -lwx_gtk2_qa-2.8 -lwx_gtk2_html-2.8 > -lwx_gtk2_adv-2.8 -lwx_gtk2_core-2.8 -lwx_base_xml-2.8 -lwx_base_net-2.8 > -lwx_base-2.8 > Thanks. I think the problem is that the rpm version you have is a non-unicode build of wxWidgets, whereas I've built it against a unicode version. See that the libs it's looking for have a u in the name, eg libwx_gtk2u_aui, whereas the ones on your system don't. I would suggest having a look in your repository to see if a "unicode" build of wxWidgets 2.8 is available, and installing that. wxRuby hasn't ever supported ascii-only builds of wxWidgets, and probably won't. wxWidgets 3.0 will make this easier by having a single utf8 build only. cheers alex From fabio.petrucci at gmail.com Fri Nov 7 07:14:59 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Fri, 7 Nov 2008 13:14:59 +0100 Subject: [wxruby-users] HtmlEasyPrinting Message-ID: Hi all, in HtmlEasyPrinting how can i use PAGENUM and PAGESCNT macros? I've tried to use them into an html text: Wx::PAGENUM and Wx::PAGESCNT using set_header and set_footer but i get them undefined. Any suggestion would be appreciated. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Fri Nov 7 07:26:52 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 07 Nov 2008 12:26:52 +0000 Subject: [wxruby-users] HtmlEasyPrinting In-Reply-To: References: Message-ID: <4914340C.4000803@pressure.to> Fabio Petrucci wrote: > in HtmlEasyPrinting how can i use PAGENUM and PAGESCNT macros? > > I've tried to use them into an html text: Wx::PAGENUM and Wx::PAGESCNT > using set_header and set_footer They're not constants but placeholders. Use them wrapped in the @ sign, like this: htp = Wx::HtmlEasyPrinting.new('printing') htp.header = "Page @PAGENUM@ of @PAGESCNT@" I realised after your message that the textile docs have mangled the formatting of this, so it's not at all clear. I'll correct it now, thanks for reporting it. alex From Franz.Irlweg.ZNT at wacker.com Mon Nov 10 08:13:14 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Mon, 10 Nov 2008 14:13:14 +0100 Subject: [wxruby-users] wxRuby 1.9.9 on SLES 10 In-Reply-To: <491328BC.9040804@pressure.to> References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> <491328BC.9040804@pressure.to> Message-ID: Hi Alex, couldn't find a unicode build of wxwidgets. After installing - wxWidgets-2.8.9 rpm - wxWidgets-gl-2.8.9 rpm - wxGTK-2.8.9 with ( config --enable-unicode) , make, make installthe the libraries can be found, but some version information is wrong: ldd wxruby2.so ./wxruby2.so: /usr/lib/libwx_gtk2u_gl-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_html-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_aui-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_aui-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_media-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_stc-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_baseu-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_adv-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_adv-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_xrc-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_richtext-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_core-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_core-2.8.so.0: no version information available (required by ./wxruby2.so) ./wxruby2.so: /usr/lib/libwx_gtk2u_core-2.8.so.0: no version information available (required by ./wxruby2.so) - executing a example ... ruby /data/install/grid.rb /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: symbol _ZTI6wxGCDC, version WXU_2.8 not defined in file libwx_gtk2u_core-2.8.so.0 with link time reference - /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so (LoadError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wx.rb:12 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /data/install/grid.rb:8 ..... Hello everybody, if has somebody has running a wxruby on a SLES10 system please let me know. Thanks for any help, Franz Irlweg -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Thursday, November 06, 2008 6:26 PM To: General discussion of wxRuby Subject: Re: [wxruby-users] wxRuby 1.9.9 on SLES 10 Irlweg, Franz (ZNT) wrote: > wx-config --libs > -L/usr/local/lib -pthread -L/usr/X11R6/lib -lwx_gtk2_richtext-2.8 > -lwx_gtk2_aui-2.8 -lwx_gtk2_xrc-2.8 -lwx_gtk2_qa-2.8 > -lwx_gtk2_html-2.8 > -lwx_gtk2_adv-2.8 -lwx_gtk2_core-2.8 -lwx_base_xml-2.8 > -lwx_base_net-2.8 > -lwx_base-2.8 > Thanks. I think the problem is that the rpm version you have is a non-unicode build of wxWidgets, whereas I've built it against a unicode version. See that the libs it's looking for have a u in the name, eg libwx_gtk2u_aui, whereas the ones on your system don't. I would suggest having a look in your repository to see if a "unicode" build of wxWidgets 2.8 is available, and installing that. wxRuby hasn't ever supported ascii-only builds of wxWidgets, and probably won't. wxWidgets 3.0 will make this easier by having a single utf8 build only. cheers 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: Rudolf Staudigl From alex at pressure.to Mon Nov 10 08:51:42 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 10 Nov 2008 13:51:42 +0000 Subject: [wxruby-users] wxRuby 1.9.9 on SLES 10 In-Reply-To: References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> <491328BC.9040804@pressure.to> Message-ID: <49183C6E.3030108@pressure.to> Hi Franz Irlweg, Franz (ZNT) wrote: > couldn't find a unicode build of wxwidgets. > I don't know about compatibility between SLES and OpenSuse or whether you're able to install 3rd party rpms, but: http://software.opensuse.org/search?baseproject=openSUSE%3A10.3&p=1&q=wxWidgets > After installing > - wxWidgets-2.8.9 rpm > - wxWidgets-gl-2.8.9 rpm > I don't think you need these packages if you're compiling and installing wxWidgets yourself. wxGTK should have everything you need in it. > - wxGTK-2.8.9 with ( config --enable-unicode) , make, make installthe > > the libraries can be found, but some version information is wrong: > > ldd wxruby2.so > ./wxruby2.so: /usr/lib/libwx_gtk2u_gl-2.8.so.0: no version information > available (required by ./wxruby2.so) > Sorry, this error isn't familiar to me. But I was a bit surprised that your self-built version looks to be in /usr/lib - I would have expected it to be in /usr/local/lib or /opt/lib. Might be worth checking again what wx-config --libs returns, and that the wxRuby build is pointing to the right libs. Perhaps you might post the first few lines returned when running 'rake' to build wxRuby, summarising the kind of build to be done and the classes that will be excluded (eg PrinterDC is always skipped on Linux). > - executing a example ... > ruby /data/install/grid.rb > /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: > /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: > symbol _ZTI6wxGCDC, version WXU_2.8 not defined in file > I can find a few references to this error message on the web with wxWidgets and various other packages and software, but no decisive solution. The fact that the error is occurring with GCDC makes me wonder if the problem is specific to that class. Did you build wxWidgets with --enable-graphics_ctx? If you didn't, you might try this - especially if rake is not reporting that support for GCDC, GraphicsContext etc is going to be skipped. See also the recommended Linux options at http://wxruby.rubyforge.org/wiki/wiki.pl?HowToBuildWxWidgets cheers alex From mathias.bruce at gmail.com Mon Nov 10 18:59:40 2008 From: mathias.bruce at gmail.com (Mathias Bruce) Date: Tue, 11 Nov 2008 00:59:40 +0100 Subject: [wxruby-users] GenericDirCtrl Bus Error crash on OSX Message-ID: <674e40dd0811101559s62eaf564o13ce73b7bc59f749@mail.gmail.com> Hi all and thanks to everyone working on this project =o) I have a problem, and I suspect it has its origins in WxRuby... In my program I use a GenericDirCtrl and handle its corresponding TreeCtrl item selection event with evt_tree_sel_changed. In the method handling this event, I try to get at the data of the selected item, but I run into this: ./my_xrcise_frames.rb:43: [BUG] Bus Error ruby 1.8.6 (2008-03-03) [universal-darwin9.0] Abort trap The code for the event handling method is as follows, where gdc_browse_tree is the GenericDirCtrl instance: def on_browse_tree_sel_changed(tree_event) item_id = tree_event.get_item raise 'item_id was zero' if item_id == 0 tc = gdc_browse_tree.get_tree_ctrl item_data = tc.get_item_data(item_id) raise 'item_data was nil' if item_data == nil end The line number referenced in the crash bus error (43) is the "item_data == nil" comparison. The exception doesn't get raised - the application just crashes. I tried to reproduce it by catching the same event by modifying the treectrl.rb sample, so I could send you code you were already very familiar with, but the error didn't appear then. It seems to require a GenericDirCtrl. I'm running: OSX 10.5 ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0] wx_sugar (0.1.20) wxruby (1.9.9) Any help is greatly appreciated! If I have omitted any important information from this mail, tell me and I will do my best to provide it. I have used wxruby with great results on linux, and I hope to be doing the same on OSX in the future. Best regards, Mathias From alex at pressure.to Mon Nov 10 19:36:47 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 11 Nov 2008 00:36:47 +0000 Subject: [wxruby-users] GenericDirCtrl Bus Error crash on OSX In-Reply-To: <674e40dd0811101559s62eaf564o13ce73b7bc59f749@mail.gmail.com> References: <674e40dd0811101559s62eaf564o13ce73b7bc59f749@mail.gmail.com> Message-ID: <4918D39F.4020802@pressure.to> Mathias Bruce wrote: > In my program I use a GenericDirCtrl and handle its corresponding > TreeCtrl item selection event with evt_tree_sel_changed. > In the method handling this event, I try to get at the data of the > selected item, but I run into this: > > ./my_xrcise_frames.rb:43: [BUG] Bus Error > ruby 1.8.6 (2008-03-03) [universal-darwin9.0] > > Abort trap > > The code for the event handling method is as follows, where > gdc_browse_tree is the GenericDirCtrl instance: > > def on_browse_tree_sel_changed(tree_event) > item_id = tree_event.get_item > raise 'item_id was zero' if item_id == 0 > tc = gdc_browse_tree.get_tree_ctrl > item_data = tc.get_item_data(item_id) > raise 'item_data was nil' if item_data == nil > end > Thanks for reporting this. I think it's a bug. In a normal Wx::TreeCtrl get_item_data works fine, but the item data held by a TreeCtrl associated with a GenericDirCtrl isn't a valid ruby object. We can fix this, and it would be helpful to understand what you were trying to do here. Could you say what you expected to get from calling get_item_data here please? The GenericDirCtrl already has methods (eg get_path, get_file_path) that will return the value of the currently selected directory. BTW, it's very much appreciated if you can demonstrate a problem in a minimal, self-contained, runnable sample, rather than just a isolated snippet. That saves those looking into it having to guess how to reproduce the context of the problem. thanks alex From mathias.bruce at gmail.com Mon Nov 10 20:06:04 2008 From: mathias.bruce at gmail.com (Mathias Bruce) Date: Tue, 11 Nov 2008 02:06:04 +0100 Subject: [wxruby-users] GenericDirCtrl Bus Error crash on OSX In-Reply-To: <4918D39F.4020802@pressure.to> References: <674e40dd0811101559s62eaf564o13ce73b7bc59f749@mail.gmail.com> <4918D39F.4020802@pressure.to> Message-ID: <674e40dd0811101706k7ca535ddk9234c6fe07291495@mail.gmail.com> On Tue, Nov 11, 2008 at 1:36 AM, Alex Fenton wrote: > Mathias Bruce wrote: >> >> In my program I use a GenericDirCtrl and handle its corresponding >> TreeCtrl item selection event with evt_tree_sel_changed. >> In the method handling this event, I try to get at the data of the >> selected item, but I run into this: >> >> ./my_xrcise_frames.rb:43: [BUG] Bus Error >> ruby 1.8.6 (2008-03-03) [universal-darwin9.0] >> >> Abort trap >> >> The code for the event handling method is as follows, where >> gdc_browse_tree is the GenericDirCtrl instance: >> >> def on_browse_tree_sel_changed(tree_event) >> item_id = tree_event.get_item >> raise 'item_id was zero' if item_id == 0 >> tc = gdc_browse_tree.get_tree_ctrl >> item_data = tc.get_item_data(item_id) >> raise 'item_data was nil' if item_data == nil >> end >> > > Thanks for reporting this. I think it's a bug. In a normal Wx::TreeCtrl > get_item_data works fine, but the item data held by a TreeCtrl associated > with a GenericDirCtrl isn't a valid ruby object. We can fix this, and it > would be helpful to understand what you were trying to do here. > > Could you say what you expected to get from calling get_item_data here > please? The GenericDirCtrl already has methods (eg get_path, get_file_path) > that will return the value of the currently selected directory. > > BTW, it's very much appreciated if you can demonstrate a problem in a > minimal, self-contained, runnable sample, rather than just a isolated > snippet. That saves those looking into it having to guess how to reproduce > the context of the problem. > > thanks > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > Thanks for the quick reply! I apparently misread the docs gravely, and got the impression that I had to pick the selected path from the item itself. GenericDirCtrl.get_path does exactly what I needed... Sorry for wasting your time =o) I read on the website about you preferring self-contained error reproduction code, and I completely understand that. The only reason I didn't do that was because I'm using XRC and xrcise, so (I think) it would have been 2-3 separate files, in which case it would be easier to file a bug in the tracker and put them there. I just thought I'd find out if the problem was wxruby-related or not, first. If you still want a little package of code reproducing the error, then I'll absolutely cook it up, but you don't need to extend the bindings for my sake anymore, since as you correctly suspected I didn't really need the item data - and maybe no one else will either... =o) Thanks again, Mathias From alex at pressure.to Mon Nov 10 21:42:47 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 11 Nov 2008 02:42:47 +0000 Subject: [wxruby-users] GenericDirCtrl Bus Error crash on OSX In-Reply-To: <674e40dd0811101706k7ca535ddk9234c6fe07291495@mail.gmail.com> References: <674e40dd0811101559s62eaf564o13ce73b7bc59f749@mail.gmail.com> <4918D39F.4020802@pressure.to> <674e40dd0811101706k7ca535ddk9234c6fe07291495@mail.gmail.com> Message-ID: <4918F127.2090904@pressure.to> Mathias Bruce wrote: > On Tue, Nov 11, 2008 at 1:36 AM, Alex Fenton wrote: > >> Thanks for reporting this. I think it's a bug. In a normal Wx::TreeCtrl >> get_item_data works fine, but the item data held by a TreeCtrl associated >> with a GenericDirCtrl isn't a valid ruby object. We can fix this, and it >> would be helpful to understand what you were trying to do here. >> > Thanks for the quick reply! I apparently misread the docs gravely, and > got the impression that I had to pick the selected path from the item > itself. GenericDirCtrl.get_path does exactly what I needed... Sorry > for wasting your time =o) > NP, you haven't wasted my time at all. It helps the dev team understand where the docs could be clearer. As I said, thanks for reporting the issue; we can look into making wxRuby give more helpful error messages than crashing with a "bus error". > I read on the website about you preferring self-contained error > reproduction code, and I completely understand that. The only reason I > didn't do that was because I'm using XRC and xrcise, so (I think) it > would have been 2-3 separate files, in which case it would be easier > to file a bug in the tracker and put them there. I just thought I'd > find out if the problem was wxruby-related or not, first. > Simply from experience, taking a problem down to a minimal example is often a good way to figure out where the error is coming from. cheers alex From lists at ruby-forum.com Tue Nov 11 04:11:41 2008 From: lists at ruby-forum.com (Pascal Hurni) Date: Tue, 11 Nov 2008 10:11:41 +0100 Subject: [wxruby-users] can't subclass AuiDockArt Message-ID: <19213b336c59649dff710d9375d7bdcd@ruby-forum.com> Hi, I'm using wxRuby with the Aui classes. Everything is fine (Manager, ToolBars, Panes, ...) and now i want to override the default drawing for the manager. Thus I want to use #set_art_provider to give my implementation. When doing that I receive a SWIG exceptions: Expected argument 1 of type wxAuiDockArt *, but got DockArtProvider # in SWIG method 'SetArtProvider' The DockArtProvider class (ruby class) inherits from AuiDockArt like so: class DockArtProvider < Wx::AuiDockArt ... end Is something wrong on my side or on SWIG's one? -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Nov 11 04:55:56 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 11 Nov 2008 09:55:56 +0000 Subject: [wxruby-users] can't subclass AuiDockArt In-Reply-To: <19213b336c59649dff710d9375d7bdcd@ruby-forum.com> References: <19213b336c59649dff710d9375d7bdcd@ruby-forum.com> Message-ID: <491956AC.2080408@pressure.to> Hi Pascal Pascal Hurni wrote: > I'm using wxRuby with the Aui classes. Everything is fine (Manager, > ToolBars, Panes, ...) and now i want to override the default drawing for > the manager. > > Thus I want to use #set_art_provider to give my implementation. When > doing that I receive a SWIG exceptions: > > Expected argument 1 of type wxAuiDockArt *, but got DockArtProvider > # > in SWIG method 'SetArtProvider' > > The DockArtProvider class (ruby class) inherits from AuiDockArt like so: > class DockArtProvider < Wx::AuiDockArt > ... > end > > Is something wrong on my side or on SWIG's one? > Hehe. It was a long time ago that I added the AUI classes, and in those days I wasn't very good at classes with virtual methods called from C++ into Ruby. And I thought "who would ever bother to define their own DockArt drawing in wxRuby?". It's really nice to hear about people pushing the library and wanting to use these advanced features. If you could file a bug please, and attach a minimal sample with an AuiManager and AuiDockArt subclass with the needed methods defined, I'm happy to have a go at fixing it. By the way, I think I took the same attitude to AuiTabArt, so if you would define your own AuiNoteBook drawing methods, please file that as a separate bug. alex From lists at ruby-forum.com Tue Nov 11 05:05:32 2008 From: lists at ruby-forum.com (Pascal Hurni) Date: Tue, 11 Nov 2008 11:05:32 +0100 Subject: [wxruby-users] can't subclass AuiDockArt In-Reply-To: <491956AC.2080408@pressure.to> References: <19213b336c59649dff710d9375d7bdcd@ruby-forum.com> <491956AC.2080408@pressure.to> Message-ID: Alex Fenton wrote: > > It's really nice to hear about people pushing the library and wanting to > use these advanced features. If you could file a bug please, and attach > a minimal sample with an AuiManager and AuiDockArt subclass with the > needed methods defined, I'm happy to have a go at fixing it. Great, I'll prepare that and submit a ticket. > By the way, I think I took the same attitude to AuiTabArt, so if you > would define your own AuiNoteBook drawing methods, please file that as a > separate bug. Yes, AuiTabArt will be the next one, but just before I have AuiToolBarArt! For the latter, I'm currently creating SWIG files for wxRuby because AuiToolBar and its AuiToolBarItem were not yet defined. I'll also submit them in a separate ticket (enhancement or the like) Thanx for your support Alex. Pascal. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Nov 11 19:31:36 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Wed, 12 Nov 2008 01:31:36 +0100 Subject: [wxruby-users] A grid without row labels? Message-ID: Hello there I'm working on a grid of many rows and one column For example: if I want to show the name of the states, I only need their names and nothing more, so the grid will be a many rows(number of states) and one column(name). The point is that I dont want the lavels of the rows on my left, I only want the cell but no row names. I don't know if i'm explaining myself so i'll paste some images (from google) this is the grid with both row and column lavels: http://phenix.developpez.com/Tutoriel_wxWindows/Tutoriel%20WxWindows_8_clip_image013.jpg end this is a grid with only the column lavel (no row lavels): http://www.gnuenterprise.org/~johannes/zipgrid-gtk.png i hope you can help me and i'm sorry for troubling you every time -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Nov 11 19:35:38 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Wed, 12 Nov 2008 01:35:38 +0100 Subject: [wxruby-users] wxRuby error: Image file is not of type 9 In-Reply-To: <48F9F6A6.3050506@pressure.to> References: <48F9F6A6.3050506@pressure.to> Message-ID: <197b659fd634b94b67923d7401fc5ec4@ruby-forum.com> > Try adding the type argument to tell wxRuby what type of image file > you're loading from > > Wx::Bitmap.new("/path/to/icon.ico", Wx::BITMAP_TYPE_ICO) > > See the Wx::Bitmap documentation for a list of supported types. For > cross-platform use, I'd recommend using PNG over ICO or BMP > > hth > alex Thanks, it's working fine. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Nov 11 19:39:03 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 12 Nov 2008 00:39:03 +0000 Subject: [wxruby-users] A grid without row labels? In-Reply-To: References: Message-ID: <491A25A7.7040806@pressure.to> Hi Omar Omar Hernandez wrote: > I'm working on a grid of many rows and one column > For example: if I want to show the name of the states, I only need their > names and nothing more, so the grid will be a many rows(number of > states) and one column(name). > > > The point is that I dont want the lavels of the rows on my left, I only > want the cell but no row names. Simply, with a Wx::Grid grid.set_row_label_size( 0 ) # or grid.row_label_size = 0 But I wonder if Wx::Grid is the best control for this. Have you looked into Wx::ListCtrl (especially with the Wx::LC_REPORT style)? It will display a list of items with multiple text columns per item. a From lists at ruby-forum.com Wed Nov 12 07:16:59 2008 From: lists at ruby-forum.com (Pascal Hurni) Date: Wed, 12 Nov 2008 13:16:59 +0100 Subject: [wxruby-users] can't subclass AuiDockArt In-Reply-To: References: <19213b336c59649dff710d9375d7bdcd@ruby-forum.com> <491956AC.2080408@pressure.to> Message-ID: <4a434c075f8f710118c6fb7f676e7ed7@ruby-forum.com> Alex, You did right with SWIG AuiDockArt. My sample application was changing the constructor signature by having an argument in the ruby initialize method. When this happens, SWIG generated code detects it and throws an "type mismatch" exception (the one reported in the initial message). I've learned something today (that sounds very coherent!). I'll still fill a ticket to have AuiDefaultDockArt available so we can simply subclass it to customize only one or two methods. Best Regards, Pascal. -- Posted via http://www.ruby-forum.com/. From erubin at valcom.com Wed Nov 12 08:49:22 2008 From: erubin at valcom.com (Eric Rubin) Date: Wed, 12 Nov 2008 08:49:22 -0500 Subject: [wxruby-users] TE_CENTRE not defined in Windows Message-ID: <4E79DA1C73544E99BF44C9DB7321A607@valcom.com> When I try to create a TextCtrl with the TE_CENTRE style I get the message "uninitialized constant Wxruby2::TE_CENTRE". I have the same problem with TE_RIGHT, but TE_LEFT and all the other TE_* styles seem to work fine. I am running Windows XP, Ruby 1.8.6 and WxRuby 1.9.9. Has anyone else seen this? Eric Rubin -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Wed Nov 12 09:46:08 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 12 Nov 2008 14:46:08 +0000 Subject: [wxruby-users] TE_CENTRE not defined in Windows In-Reply-To: <4E79DA1C73544E99BF44C9DB7321A607@valcom.com> References: <4E79DA1C73544E99BF44C9DB7321A607@valcom.com> Message-ID: <491AEC30.8050707@pressure.to> Hi Eric Rubin wrote: > > When I try to create a TextCtrl with the TE_CENTRE style I get the > message ?uninitialized constant Wxruby2::TE_CENTRE?. I have the same > problem with TE_RIGHT, but TE_LEFT and all the other TE_* styles seem > to work fine. I am running Windows XP, Ruby 1.8.6 and WxRuby 1.9.9. > Thanks for the report. It's strange. The constants are definitely there in the source files, but I also find TE_RIGHT and TE_CENTRE to be undefined (1.9.9, SVN HEAD on OS X). To work round it for now, you can use the following constants which have the same value (in the C++ source, the TE_ constants are just aliases for these). Wx::TE_RIGHT = Wx::ALIGN_RIGHT Wx::TE_CENTRE = Wx::ALIGN_CENTER_HORIZONTAL alex From lists at ruby-forum.com Wed Nov 12 16:39:25 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Wed, 12 Nov 2008 22:39:25 +0100 Subject: [wxruby-users] A grid without row labels? In-Reply-To: <491A25A7.7040806@pressure.to> References: <491A25A7.7040806@pressure.to> Message-ID: <337fe4eee4e2ad85bc6ae8c3820cd98f@ruby-forum.com> Hi there > Simply, with a Wx::Grid > > grid.set_row_label_size( 0 ) # or > grid.row_label_size = 0 Thanks! it's working fine, you saved me again -- Posted via http://www.ruby-forum.com/. From Franz.Irlweg.ZNT at wacker.com Thu Nov 13 06:08:52 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Thu, 13 Nov 2008 12:08:52 +0100 Subject: [wxruby-users] wxRuby 1.9.9 on SLES 10 In-Reply-To: <49183C6E.3030108@pressure.to> References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> <491328BC.9040804@pressure.to> <49183C6E.3030108@pressure.to> Message-ID: Hi Alex, not yet done the install .. After compiling and installing wxruby1.9.9 - ldd wxruby2.so is ok !!! but: require 'wx' LoadError: /usr/local/lib/ruby/site_ruby/1.8/i686-linux/wxruby2.so: undefined symbol: mspack_destroy_chm_decompressor - /usr/local/lib/ruby/site_ruby/1.8/i686-linux/wxruby2.so from /usr/local/lib/ruby/site_ruby/1.8/i686-linux/wxruby2.so from /usr/local/lib/ruby/site_ruby/1.8/wx.rb:12 from (irb):4:in `require' from (irb):4 from :0 Best regards, Franz -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Monday, November 10, 2008 2:52 PM To: General discussion of wxRuby Subject: Re: [wxruby-users] wxRuby 1.9.9 on SLES 10 Hi Franz Irlweg, Franz (ZNT) wrote: > couldn't find a unicode build of wxwidgets. > I don't know about compatibility between SLES and OpenSuse or whether you're able to install 3rd party rpms, but: http://software.opensuse.org/search?baseproject=openSUSE%3A10.3&p=1&q=wx Widgets > After installing > - wxWidgets-2.8.9 rpm > - wxWidgets-gl-2.8.9 rpm > I don't think you need these packages if you're compiling and installing wxWidgets yourself. wxGTK should have everything you need in it. > - wxGTK-2.8.9 with ( config --enable-unicode) , make, make installthe > > the libraries can be found, but some version information is wrong: > > ldd wxruby2.so > ./wxruby2.so: /usr/lib/libwx_gtk2u_gl-2.8.so.0: no version information > available (required by ./wxruby2.so) > Sorry, this error isn't familiar to me. But I was a bit surprised that your self-built version looks to be in /usr/lib - I would have expected it to be in /usr/local/lib or /opt/lib. Might be worth checking again what wx-config --libs returns, and that the wxRuby build is pointing to the right libs. Perhaps you might post the first few lines returned when running 'rake' to build wxRuby, summarising the kind of build to be done and the classes that will be excluded (eg PrinterDC is always skipped on Linux). > - executing a example ... > ruby /data/install/grid.rb > /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: > /usr/local/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-linux/lib/wxruby2.so: > symbol _ZTI6wxGCDC, version WXU_2.8 not defined in file > I can find a few references to this error message on the web with wxWidgets and various other packages and software, but no decisive solution. The fact that the error is occurring with GCDC makes me wonder if the problem is specific to that class. Did you build wxWidgets with --enable-graphics_ctx? If you didn't, you might try this - especially if rake is not reporting that support for GCDC, GraphicsContext etc is going to be skipped. See also the recommended Linux options at http://wxruby.rubyforge.org/wiki/wiki.pl?HowToBuildWxWidgets cheers 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: Rudolf Staudigl From alex at pressure.to Thu Nov 13 09:04:52 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 13 Nov 2008 14:04:52 +0000 Subject: [wxruby-users] wxRuby 1.9.9 on SLES 10 In-Reply-To: References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> <491328BC.9040804@pressure.to> <49183C6E.3030108@pressure.to> Message-ID: <491C3404.6090204@pressure.to> Irlweg, Franz (ZNT) wrote: > require 'wx' > LoadError: /usr/local/lib/ruby/site_ruby/1.8/i686-linux/wxruby2.so: > undefined symbol: mspack_destroy_chm_decompressor - > /usr/local/lib/ruby/site_ruby/1.8/i686-linux/wxruby2.so Seems this symbol comes from libmspack, which wxWidgets uses to support reading CHM help files. I don't know why this problem is occurring, but you could perhaps try excluding the feature. Could you have a look at your setup.h file (somewhere like /usr/local/lib/wx/include/gtk-unicode-release-2.8/wx/setup.h ) and see if it has a line wxUSE_LIBMSPACK. If the value of this is 1, you could try compiling wxWidgets again (sorry) configured with the additional option --without-libmspack a From lists at ruby-forum.com Thu Nov 13 11:43:13 2008 From: lists at ruby-forum.com (Cyrill Jakovlev) Date: Thu, 13 Nov 2008 17:43:13 +0100 Subject: [wxruby-users] text color Message-ID: Hello. I can't change text color (on vista). How can I do this? http://pastie.org/313982 I try mingw too.. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Nov 13 11:47:25 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 13 Nov 2008 16:47:25 +0000 Subject: [wxruby-users] text color In-Reply-To: References: Message-ID: <491C5A1D.5040007@pressure.to> Cyrill Jakovlev wrote: > I can't change text color (on vista). How can I do this? > http://pastie.org/313982 > If you want to have coloured, styled text using TextAttr, you must create your TextCtrl with the styles Wx::TE_RICH|Wx::TE_RICH2|Wx::TE_MULTILINE A normal multiline TextCtrl is just plain text, in system standard colours. hth a From lists at ruby-forum.com Thu Nov 13 19:22:43 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Fri, 14 Nov 2008 01:22:43 +0100 Subject: [wxruby-users] How to refresh a panel? Message-ID: <1e8335b08efebdd25e71d7bbde583e6d@ruby-forum.com> Hello again This time i have a problem with this code Well, what i'm trying to do is, through a menu, to change panels. The problem is that i can't find a way to change the panel, or refresh or delete, or whatever should be done. i've attached the the zip file with the runable code the code is: ##on 'def initialize' of a Wx::Frame class #@Panel=Panel.new(self)##If i initialize @panel here, it doesn't refresh when the event is called ###end initialize ###event functions## def cState(menu)##the function called from the event #@panel.destroy ## Error: undefined method `destroy' for nil:NilClass (NoMethodError) @panel=Test.new(self)##a WX::Panel class. end ##the other function is similar to this one ###end event functions if i'm doing the wrong way, please tellme, and if possible, post a link to an example, tutorial or explanation. I'd be very thankful Ramo Attachments: http://www.ruby-forum.com/attachment/2928/testPrincipal.zip -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 13 19:33:10 2008 From: lists at ruby-forum.com (Cyrill Jakovlev) Date: Fri, 14 Nov 2008 01:33:10 +0100 Subject: [wxruby-users] text color In-Reply-To: <491C5A1D.5040007@pressure.to> References: <491C5A1D.5040007@pressure.to> Message-ID: <9b4570f44d6446af9ccbd9dbae6cb758@ruby-forum.com> Now text is coloured, tnx) -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Nov 13 19:56:37 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Nov 2008 00:56:37 +0000 Subject: [wxruby-users] How to refresh a panel? In-Reply-To: <1e8335b08efebdd25e71d7bbde583e6d@ruby-forum.com> References: <1e8335b08efebdd25e71d7bbde583e6d@ruby-forum.com> Message-ID: <491CCCC5.1010905@pressure.to> Omar Hernandez wrote: > Well, what i'm trying to do is, through a menu, to change panels. > The problem is that i can't find a way to change the panel, or refresh > or delete, or whatever should be done. > First off, have a look at whether a Wx::Notebook might suit your requirements. It's intended for combining different panels. It has methods for switching easily between pages. If you want to swap panels, you probably just need to destroy the old panel and add in the new (see below) I'm more used to doing this within a sizer-based layout, when it goes something like: new_window = MyWindow.new(old_window.parent, ...) old_window.containing_sizer.replace(old_window, new_window) old_window.destroy This keeps the layout consistent > i've attached the the zip file with the runable code > > the code is: > ##on 'def initialize' of a Wx::Frame class > #@Panel=Panel.new(self)##If i initialize @panel here, it doesn't refresh > Well one problem you have is that you call it @Panel here (with a capital "P") and @panel later. alex From mathias.bruce at gmail.com Thu Nov 13 20:50:26 2008 From: mathias.bruce at gmail.com (Mathias Bruce) Date: Fri, 14 Nov 2008 02:50:26 +0100 Subject: [wxruby-users] GenericDirCtrl#re_create_tree behaviour Message-ID: <674e40dd0811131750g72ece416i56878cd0849f455f@mail.gmail.com> Hi When GenericDirCtrl#re_create_tree is called in order to refresh the tree with any possible changes made to the file system since it was loaded, it doesn't re-expand all the tree items that were expanded prior to calling re_create_tree. I'm working on a solution to note all open tree items and after re_create_tree manually expand the items that are still present in the tree. My question: Is there a nice way that I've overlooked to make it automagically re-expand previously expanded nodes after recreating the tree? I'm on my way towards doing it manually, but since the GenericDirCtrl's TreeCtrl actually re-numbers the items in the tree during the recreation process, I'll have to do it by matching TreeItem text strings, and it's starting to feel like a hack (in the ugly sense). Thanks in advance, and best regards! /Mathias From alex at pressure.to Fri Nov 14 06:25:31 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Nov 2008 11:25:31 +0000 Subject: [wxruby-users] GenericDirCtrl#re_create_tree behaviour In-Reply-To: <674e40dd0811131750g72ece416i56878cd0849f455f@mail.gmail.com> References: <674e40dd0811131750g72ece416i56878cd0849f455f@mail.gmail.com> Message-ID: <491D602B.1060603@pressure.to> Mathias Bruce wrote: > When GenericDirCtrl#re_create_tree is called in order to refresh the > tree with any possible changes made to the file system since it was > loaded, it doesn't re-expand all the tree items that were expanded > prior to calling re_create_tree. I'm working on a solution to note all > open tree items and after re_create_tree manually expand the items > that are still present in the tree. > > My question: Is there a nice way that I've overlooked to make it > automagically re-expand previously expanded nodes after recreating the > tree? Sorry, but wxWidgets doesn't provide a magic way to do this. As the name suggests it's a generic control (ie written from the ground up) so it doesn't benefit from the way that modern OSes update file dialogs etc as new files and directories are created. However it's not hard to get a list of the currently open folder names: tree = dir.tree_ctrl open = tree.select { | item | tree.expanded?(item) } open.map! { | item | tree.item_text(item) } Note that wxRuby creates the tree items as their parent is expanded, so this will only traverse whatever folders have been shown, not every possible folder. I expect you'd also want to use the full paths as the unique keys: def tree.item_path(item) return "" if item == root_item path = item_text(item) while item = item_parent(item) and item != root_item path = "#{item_text(item)}/#{path}" end path end I need to fix TreeCtrl#get_item_data for the trees from GenericDirCtrl as it currently crashes. It would seem sensible for the item_data to be or include the paths. So I'd be grateful if you could follow-up with any problems you encounter in this. Doing the re-opening is left to you - you'll need to work hierarchically down the tree. thanks alex From lists at ruby-forum.com Fri Nov 14 13:07:04 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Fri, 14 Nov 2008 19:07:04 +0100 Subject: [wxruby-users] xrcise question Message-ID: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> Hi all, where can I find a tutorial like "How to use wxFormbuilder with ruby"? I want to transform xrcise code into ruby code and don't know how to do this. Thanks! bye Henry -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Nov 14 13:12:18 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Nov 2008 18:12:18 +0000 Subject: [wxruby-users] xrcise question In-Reply-To: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> Message-ID: <491DBF82.2080604@pressure.to> Heinrich Piard wrote: > where can I find a tutorial like "How to use wxFormbuilder with ruby"? > > I want to transform xrcise code into ruby code and don't know how to do > this. http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise Note that XRCise doesn't generate ruby code for the layout - but it writes all the boring code that loads your layout from XML. This means your handwritten classes can concentrate on event handling without having to write heaps of layout code. Any probs, feel free to ask alex From lists at ruby-forum.com Fri Nov 14 13:39:41 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Fri, 14 Nov 2008 19:39:41 +0100 Subject: [wxruby-users] xrcise question In-Reply-To: <491DBF82.2080604@pressure.to> References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> Message-ID: Alex Fenton wrote: > Heinrich Piard wrote: >> where can I find a tutorial like "How to use wxFormbuilder with ruby"? >> >> I want to transform xrcise code into ruby code and don't know how to do >> this. > > http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise > > Note that XRCise doesn't generate ruby code for the layout - but it > writes all the boring code that loads your layout from XML. This means > your handwritten classes can concentrate on event handling without > having to write heaps of layout code. > > Any probs, feel free to ask > alex Hi Alex, thanks! I prepared everything and started a test but it didn't work. I created a xrc file and no used xrcise -o test.rm nonam.xrc and get the following error message: Cannot create wrapper for class without 'subclass' attribute Here the xrc xml: 554,553 500 3 0 0 1 1 5 enter ticker 0 -1,-1 0 0 -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Fri Nov 14 13:49:49 2008 From: mario at ruby-im.net (Mario Steele) Date: Fri, 14 Nov 2008 12:49:49 -0600 Subject: [wxruby-users] xrcise question In-Reply-To: References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> Message-ID: Hello Heinrich, What you will need to do, is goto your main Window form, and scroll down on the properties page, you will see a field that says Subclass, and have a semi-colon in it, with a + next to the field name. You need to click that plus, and put what name you want your ruby class to be named as. EG: MyFrame This will tell XRCise when it generates the wrapper, that the class to use, will be MyFrame. hth, Mario On Fri, Nov 14, 2008 at 12:39 PM, Heinrich Piard wrote: > Alex Fenton wrote: > > Heinrich Piard wrote: > >> where can I find a tutorial like "How to use wxFormbuilder with ruby"? > >> > >> I want to transform xrcise code into ruby code and don't know how to do > >> this. > > > > http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise > > > > Note that XRCise doesn't generate ruby code for the layout - but it > > writes all the boring code that loads your layout from XML. This means > > your handwritten classes can concentrate on event handling without > > having to write heaps of layout code. > > > > Any probs, feel free to ask > > alex > > > Hi Alex, > > thanks! > > I prepared everything and started a test but it didn't work. > I created a xrc file and no used xrcise -o test.rm nonam.xrc and get the > following error message: > Cannot create wrapper for class without 'subclass' attribute > > Here the xrc xml: > > > > > 554,553 > > > 500 > 3 > 0 > 0 > > > > 1 > > > > > > 1 > 5 > > enter ticker > 0 > > > -1,-1 > > 0 > > > > 0 > > > > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Fri Nov 14 14:08:46 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Fri, 14 Nov 2008 20:08:46 +0100 Subject: [wxruby-users] xrcise question In-Reply-To: References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> Message-ID: <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> Mario Steele wrote: > Hello Heinrich, > > What you will need to do, is goto your main Window form, and scroll down > on > the properties page, you will see a field that says Subclass, and have a > semi-colon in it, with a + next to the field name. You need to click > that > plus, and put what name you want your ruby class to be named as. > > EG: > MyFrame > > This will tell XRCise when it generates the wrapper, that the class to > use, > will be MyFrame. > > hth, > > Mario Great! Thanks Mario! bye Henry -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Nov 14 14:40:02 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Fri, 14 Nov 2008 20:40:02 +0100 Subject: [wxruby-users] xrcise question In-Reply-To: <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> Message-ID: Heinrich Piard wrote: > Mario Steele wrote: >> Hello Heinrich, >> >> What you will need to do, is goto your main Window form, and scroll down >> on >> the properties page, you will see a field that says Subclass, and have a >> semi-colon in it, with a + next to the field name. You need to click >> that >> plus, and put what name you want your ruby class to be named as. >> >> EG: >> MyFrame >> >> This will tell XRCise when it generates the wrapper, that the class to >> use, >> will be MyFrame. >> >> hth, >> >> Mario > > > Great! Thanks Mario! > > > bye > Henry Hi all, one more question popped up: 14:37:40: Error: Cannot load resources from file 'file:/C%3A/ruby/ruby_scripts/wxFormBuilder/nonam.xrc'. c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-mswin32-60/lib/wx/classes/xmlresource.rb:31:in `load': Failed to load XRC from 'nonam.xrc'; check the file exists and is valid XML (RuntimeError) from test.rb:20:in `initialize' from test.rb:47:in `new' from test.rb:47:in `initialize' from test.rb:50:in `new' from test.rb:50 The file is in that directory. bye Henry -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Nov 14 15:48:18 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Nov 2008 20:48:18 +0000 Subject: [wxruby-users] xrcise question In-Reply-To: References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> Message-ID: <491DE412.8060809@pressure.to> Heinrich Piard wrote: > one more question popped up: > > 14:37:40: Error: Cannot load resources from file > 'file:/C%3A/ruby/ruby_scripts/wxFormBuilder/nonam.xrc'. > c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-mswin32-60/lib/wx/classes/xmlresource.rb:31:in > `load': Failed to load XRC from 'nonam.xrc'; check the file exists and > is valid XML (RuntimeError) The filename looks a bit suspicious to me. I would expect it to be a valid path rather than a mangled-looking URL. Hard to know where this came from without knowing more about your project layout. I would check that you call xrcise with a relative path, in a typical project structure. Eg I have app.rb lib/*.*/rb share/xrc.xrc I call "xrcise share/xrc.xrc" from the base directory and that means that the paths resolve fine. a From lists at ruby-forum.com Sat Nov 15 16:11:55 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Sat, 15 Nov 2008 22:11:55 +0100 Subject: [wxruby-users] xrcise question In-Reply-To: <491DE412.8060809@pressure.to> References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> <491DE412.8060809@pressure.to> Message-ID: <0665ba0e43d0f9564b382f93d9eaadcb@ruby-forum.com> Alex Fenton wrote: > Heinrich Piard wrote: >> one more question popped up: >> >> 14:37:40: Error: Cannot load resources from file >> 'file:/C%3A/ruby/ruby_scripts/wxFormBuilder/nonam.xrc'. >> c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-mswin32-60/lib/wx/classes/xmlresource.rb:31:in >> `load': Failed to load XRC from 'nonam.xrc'; check the file exists and >> is valid XML (RuntimeError) > The filename looks a bit suspicious to me. I would expect it to be a > valid path rather than a mangled-looking URL. Hard to know where this > came from without knowing more about your project layout. > > I would check that you call xrcise with a relative path, in a typical > project structure. Eg I have > > app.rb > lib/*.*/rb > share/xrc.xrc > > I call "xrcise share/xrc.xrc" from the base directory and that means > that the paths resolve fine. > > a Hello, here is my code. Is still can't get it to work. # This class was automatically generated from XRC source. It is not # recommended that this file is edited directly; instead, inherit from # this class and extend its behaviour there. # # Source file: wxFormBuilder\nonam.xrc # Generated at: Fri Nov 14 17:16:34 -0500 2008 require 'wx' include Wx class CometApplication < Wx::Frame attr_reader :m_statusbar1, :m_toolbar1, :m_textctrl1, :m_button2, :m_button3 def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("wxFormBuilder\nonam.xrc") xml.load_frame_subclass(self, parent, "MyFrame1") 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 @m_statusbar1 = finder.call("m_statusBar1") @m_toolbar1 = finder.call("m_toolBar1") @m_textctrl1 = finder.call("m_textCtrl1") @m_button2 = finder.call("m_button2") @m_button3 = finder.call("m_button3") if self.class.method_defined? "on_init" self.on_init() end end end class MyApp < App def initialize() CometApplication.new end end MyApp.new.main_loop() I start the code from C:\ruby\ruby_scripts\test.rb and the xrc file is in C:\ruby\ruby_scripts\wxFormBuilder\nonam.xrc -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sat Nov 15 21:47:44 2008 From: lists at ruby-forum.com (Cyrill Jakovlev) Date: Sun, 16 Nov 2008 03:47:44 +0100 Subject: [wxruby-users] StaticBitmap Message-ID: <1892f268dcdd931fcdbf5f220ac4a764@ruby-forum.com> How can I take image from Rmagick object? I try image.set_data(blob), but this wrong.. Is possible make scrollable StaticBitmap? -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Sat Nov 15 23:57:30 2008 From: mario at ruby-im.net (Mario Steele) Date: Sat, 15 Nov 2008 22:57:30 -0600 Subject: [wxruby-users] xrcise question In-Reply-To: <0665ba0e43d0f9564b382f93d9eaadcb@ruby-forum.com> References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> <491DE412.8060809@pressure.to> <0665ba0e43d0f9564b382f93d9eaadcb@ruby-forum.com> Message-ID: Try changing the line for the loading of the XML resource file from: xml.load("wxFormBuilder\noname.xrc") To: xml.load("wxFormBuilder/noname.xrc") Thankfully, to Ruby and wxWidgets, it doesn't really need you to use the \ slash to access a file path. Often times, it's better to run xrcise as such: xrcise -o noname.rb wxFormBuilder/noname.xrc This way, doesn't matter if it's on Windows, or Linux, it will be able to find the resources just fine. On Sat, Nov 15, 2008 at 3:11 PM, Heinrich Piard wrote: > Hello, > > here is my code. Is still can't get it to work. > > > # This class was automatically generated from XRC source. It is not > # recommended that this file is edited directly; instead, inherit from > # this class and extend its behaviour there. > # > # Source file: wxFormBuilder\nonam.xrc > # Generated at: Fri Nov 14 17:16:34 -0500 2008 > > require 'wx' > include Wx > > class CometApplication < Wx::Frame > > attr_reader :m_statusbar1, :m_toolbar1, :m_textctrl1, :m_button2, > :m_button3 > > def initialize(parent = nil) > super() > xml = Wx::XmlResource.get > xml.flags = 2 # Wx::XRC_NO_SUBCLASSING > xml.init_all_handlers > xml.load("wxFormBuilder\nonam.xrc") > xml.load_frame_subclass(self, parent, "MyFrame1") > > 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 > > @m_statusbar1 = finder.call("m_statusBar1") > @m_toolbar1 = finder.call("m_toolBar1") > @m_textctrl1 = finder.call("m_textCtrl1") > @m_button2 = finder.call("m_button2") > @m_button3 = finder.call("m_button3") > if self.class.method_defined? "on_init" > self.on_init() > end > end > end > > class MyApp < App > def initialize() > CometApplication.new > end > end > MyApp.new.main_loop() > > I start the code from C:\ruby\ruby_scripts\test.rb and the xrc file is > in C:\ruby\ruby_scripts\wxFormBuilder\nonam.xrc > > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mario at ruby-im.net Sun Nov 16 00:01:38 2008 From: mario at ruby-im.net (Mario Steele) Date: Sat, 15 Nov 2008 23:01:38 -0600 Subject: [wxruby-users] StaticBitmap In-Reply-To: <1892f268dcdd931fcdbf5f220ac4a764@ruby-forum.com> References: <1892f268dcdd931fcdbf5f220ac4a764@ruby-forum.com> Message-ID: You will need to convert the data over from Rmagick format to wxRuby format. You have the basic idea, in which you need to retrieve the RGB Pixel data from the RMagick object, and then apply that to a wxRuby Image object. However, you will also need to grab the Palette from RMagick, to apply to the wxRuby Image Object, through Wx::Image#set_palette(). I believe this is the method in which you need to go about this, however, I've never worked with Rmagick, and wxRuby personally. But you definately need to go through Image#set_data() and Image#set_palette to make it work. I think Alex may have a bit more experience with this, so he may be able to give you a clearer answer to this question. On Sat, Nov 15, 2008 at 8:47 PM, Cyrill Jakovlev wrote: > How can I take image from Rmagick object? > I try image.set_data(blob), but this wrong.. > Is possible make scrollable StaticBitmap? > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Sun Nov 16 10:36:35 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Sun, 16 Nov 2008 16:36:35 +0100 Subject: [wxruby-users] xrcise question In-Reply-To: References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> <491DE412.8060809@pressure.to> <0665ba0e43d0f9564b382f93d9eaadcb@ruby-forum.com> Message-ID: Mario Steele wrote: > Try changing the line for the loading of the XML resource file from: > > xml.load("wxFormBuilder\noname.xrc") > > To: > > xml.load("wxFormBuilder/noname.xrc") > > Thankfully, to Ruby and wxWidgets, it doesn't really need you to use the > \ > slash to access a file path. > > Often times, it's better to run xrcise as such: > > xrcise -o noname.rb wxFormBuilder/noname.xrc > > This way, doesn't matter if it's on Windows, or Linux, it will be able > to > find the resources just fine. Hi Mario, changed it but still get this message. 10:33:15: Error: Cannot load resources from file 'file:/C%3A/ruby/ruby_scripts/wxFormBuilder/nonam.xrc'. c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-mswin32-60/lib/wx/classes/xmlresource.rb:31:in `load': Failed to load XRC from 'wxFormBuilder/nonam.xrc'; check the file exists and is valid XML (RuntimeError) from test.rb:23:in `initialize' from test.rb:51:in `new' from test.rb:51:in `initialize' from test.rb:54:in `new' from test.rb:54 Thanks! bye Henry -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Nov 16 21:24:34 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Mon, 17 Nov 2008 03:24:34 +0100 Subject: [wxruby-users] xrcise question In-Reply-To: References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> <491DE412.8060809@pressure.to> <0665ba0e43d0f9564b382f93d9eaadcb@ruby-forum.com> Message-ID: <53bfb69b59809c92799a2f684a48c5cf@ruby-forum.com> Heinrich Piard wrote: > Mario Steele wrote: >> Try changing the line for the loading of the XML resource file from: >> >> xml.load("wxFormBuilder\noname.xrc") >> >> To: >> >> xml.load("wxFormBuilder/noname.xrc") >> >> Thankfully, to Ruby and wxWidgets, it doesn't really need you to use the >> \ >> slash to access a file path. >> >> Often times, it's better to run xrcise as such: >> >> xrcise -o noname.rb wxFormBuilder/noname.xrc >> >> This way, doesn't matter if it's on Windows, or Linux, it will be able >> to >> find the resources just fine. > > > Hi Mario, > > changed it but still get this message. > > 10:33:15: Error: Cannot load resources from file > 'file:/C%3A/ruby/ruby_scripts/wxFormBuilder/nonam.xrc'. > c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-mswin32-60/lib/wx/classes/xmlresource.rb:31:in > `load': Failed to load XRC from 'wxFormBuilder/nonam.xrc'; check the > file exists and is valid XML (RuntimeError) > from test.rb:23:in `initialize' > from test.rb:51:in `new' > from test.rb:51:in `initialize' > from test.rb:54:in `new' > from test.rb:54 > > Thanks! > > > bye > Henry Hi all, could the above errors be caused by a bug? bye Henry -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Nov 17 04:48:58 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 17 Nov 2008 09:48:58 +0000 Subject: [wxruby-users] xrcise question In-Reply-To: <53bfb69b59809c92799a2f684a48c5cf@ruby-forum.com> References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> <491DE412.8060809@pressure.to> <0665ba0e43d0f9564b382f93d9eaadcb@ruby-forum.com> <53bfb69b59809c92799a2f684a48c5cf@ruby-forum.com> Message-ID: <49213E0A.5050407@pressure.to> Heinrich Piard wrote: > Heinrich Piard wrote: > >> Mario Steele wrote: >> >>> Try changing the line for the loading of the XML resource file from: >>> >>> xml.load("wxFormBuilder\noname.xrc") >>> >>> To: >>> >>> xml.load("wxFormBuilder/noname.xrc") >>> >>> >>> >> >> changed it but still get this message. >> >> 10:33:15: Error: Cannot load resources from file >> 'file:/C%3A/ruby/ruby_scripts/wxFormBuilder/nonam.xrc'. >> c:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-mswin32-60/lib/wx/classes/xmlresource.rb:31:in >> `load': Failed to load XRC from 'wxFormBuilder/nonam.xrc'; check the >> file exists and is valid XML (RuntimeError) >> > > > > could the above errors be caused by a bug? > It's possible, but I can't tell without seeing the XRC file as well as the generated code. Please could you post your own script, the XRC-generated ruby file and the XML source file in a zip attachment, or file it as a bug with attachments on the website bug tracker. thanks alex From alex at pressure.to Mon Nov 17 05:25:04 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 17 Nov 2008 10:25:04 +0000 Subject: [wxruby-users] StaticBitmap In-Reply-To: <1892f268dcdd931fcdbf5f220ac4a764@ruby-forum.com> References: <1892f268dcdd931fcdbf5f220ac4a764@ruby-forum.com> Message-ID: <49214680.4020005@pressure.to> Cyrill Jakovlev wrote: > How can I take image from Rmagick object? > I try image.set_data(blob), but this wrong.. > set_data uses a raw, uncompressed format, but it looks like RMagick's to_blob method exports in known image formats. I would use ruby's stdlib StringIO to create an in-memory representation that Wx::Image can read from. require 'stringio' str_io = StringIO( rmagick_img.to_blob ) # with whatever arguments are needed for to_blob img = Wx::Image.read(str_io, Wx::BITMAP_TYPE_PNG) # or other image format Then use Wx::Bitmap.from_image to get an object suitable for drawing on the screen. > Is possible make scrollable StaticBitmap? > Use Wx::ScrolledWindow to create a scrollable viewing for any contents, including Wx::StaticBitmap. There's different ways to use ScrolledWindow for which see the docs, but probably you could just use scroll_win = Wx::ScrolledWindow.new(parent) image = Wx::StaticBitmap.new( scroll_win, :label => bmp) scroll_win.virtual_size = [ bmp.width, bmp.height ] # tell the window how big the whole canvas is scroll_win.set_scroll_rate(5, 5) # scroll 5 pixels at a time, change as desired alex From lists at ruby-forum.com Mon Nov 17 07:59:28 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Mon, 17 Nov 2008 13:59:28 +0100 Subject: [wxruby-users] xrcise question In-Reply-To: <49213E0A.5050407@pressure.to> References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> <491DE412.8060809@pressure.to> <0665ba0e43d0f9564b382f93d9eaadcb@ruby-forum.com> <53bfb69b59809c92799a2f684a48c5cf@ruby-forum.com> <49213E0A.5050407@pressure.to> Message-ID: <4a7fe0bf10abb93e5f904c3efc520381@ruby-forum.com> Alex Fenton wrote: > Heinrich Piard wrote: >>>> xml.load("wxFormBuilder/noname.xrc") >>> file exists and is valid XML (RuntimeError) >>> >> >> >> >> could the above errors be caused by a bug? >> > > It's possible, but I can't tell without seeing the XRC file as well as > the generated code. Please could you post your own script, the > XRC-generated ruby file and the XML source file in a zip attachment, or > file it as a bug with attachments on the website bug tracker. > > thanks > alex Hi Alex, I have attached the file in zip format. noname.zip Attachments: http://www.ruby-forum.com/attachment/2935/noname.zip -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Tue Nov 18 10:37:36 2008 From: lists at ruby-forum.com (Heinrich Piard) Date: Tue, 18 Nov 2008 16:37:36 +0100 Subject: [wxruby-users] xrcise question In-Reply-To: <4a7fe0bf10abb93e5f904c3efc520381@ruby-forum.com> References: <14c04e56ee2ff3e60ef5556ca655f93d@ruby-forum.com> <491DBF82.2080604@pressure.to> <46b2939378a9e2dabcb47d1dbf51c99c@ruby-forum.com> <491DE412.8060809@pressure.to> <0665ba0e43d0f9564b382f93d9eaadcb@ruby-forum.com> <53bfb69b59809c92799a2f684a48c5cf@ruby-forum.com> <49213E0A.5050407@pressure.to> <4a7fe0bf10abb93e5f904c3efc520381@ruby-forum.com> Message-ID: <2bfd76aa65ab333265a5caed27aaece5@ruby-forum.com> Heinrich Piard wrote: > Alex Fenton wrote: >> Heinrich Piard wrote: >>>>> xml.load("wxFormBuilder/noname.xrc") >>>> file exists and is valid XML (RuntimeError) >>>> >>> >>> >>> >>> could the above errors be caused by a bug? >>> >> >> It's possible, but I can't tell without seeing the XRC file as well as >> the generated code. Please could you post your own script, the >> XRC-generated ruby file and the XML source file in a zip attachment, or >> file it as a bug with attachments on the website bug tracker. >> >> thanks >> alex > > Hi Alex, > > I have attached the file in zip format. > > noname.zip Hi all, I was able to solve the issue my self. It was a code issue in class MyApp this is how it should look: class MyApp < Wx::App def on_init() Test.new.show() end end MyApp.new.main_loop() Thanks to all! bye Henry -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Wed Nov 19 15:32:14 2008 From: lists at ruby-forum.com (Jn Jn) Date: Wed, 19 Nov 2008 21:32:14 +0100 Subject: [wxruby-users] Xrc Q ; using mulitple layouts(Frames , dialogs , panels) Message-ID: Hi , I am developing a simple GUI with wxruby. I am using wxFormbuilder to get the xrc file. I need a simple Frame with menu item file and submenu open,save and exit. And when I click on open(submenu) it should launch an panel(dialog) which has filepicker. I believe I would be able to develop a dailog also under the same project in wxFormbuilder(which it allowed without any warnings or errors) ,when I run xrcise I get 2 classes under same xrc file. but when try to load it when I click on open the applicaiton crashes. Can someone point to any sample program which uses multiple layouts with xrc. What is the sequence of loading the objects . Thanks Jn ======================================================================== # This class was automatically generated from XRC source. It is not # recommended that this file is edited directly; instead, inherit from # this class and extend its behaviour there. # # Source file: TestXrc.xrc # Generated at: Wed Nov 19 12:00:04 -0800 2008 class TextXrc < Wx::Frame attr_reader :m_menubar2, :m_menu4, :m_menuitem5, :m_menuitem6, :m_menu5 def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("TestXrc.xrc") xml.load_frame_subclass(self, parent, "MyFrame2") 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 @m_menubar2 = finder.call("m_menubar2") @m_menu4 = finder.call("m_menu4") @m_menuitem5 = finder.call("m_menuItem5") @m_menuitem6 = finder.call("m_menuItem6") @m_menu5 = finder.call("m_menu5") if self.class.method_defined? "on_init" self.on_init() end end end # This class was automatically generated from XRC source. It is not # recommended that this file is edited directly; instead, inherit from # this class and extend its behaviour there. # # Source file: TestXrc.xrc # Generated at: Wed Nov 19 12:00:04 -0800 2008 class BrowseFile < Wx::Dialog attr_reader :m_filepicker2 def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("TestXrc.xrc") xml.load_dialog_subclass(self, parent, "MyDialog2") 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 @m_filepicker2 = finder.call("m_filePicker2") if self.class.method_defined? "on_init" self.on_init() end end end ====================================================================== -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Nov 19 17:45:29 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 19 Nov 2008 22:45:29 +0000 Subject: [wxruby-users] [Fwd: Survey Invitation : Ruby + GUI] Message-ID: <49249709.90008@pressure.to> Hi I'm running a short survey on GUI programming in Ruby. If you have a few spare minutes, please consider filling it out. I'm not suggesting you all vote for wxRuby, but all the better if you have nice things to say ;) alex -------- Original Message -------- Subject: Survey Invitation : Ruby + GUI Date: Wed, 19 Nov 2008 22:43:29 +0000 From: Alex Fenton Newsgroups: comp.lang.ruby Everyone's invited to take part in a short survey on using Ruby for GUI programming; I'd be grateful for 5 or 10 minutes of your time at: http://www.surveymonkey.com/s.aspx?sm=o2UwH3KcrOyLxKsh8mOJMg_3d_3d Even if you never do GUI programming in Ruby, please take a minute to respond, as it's interesting to know why people aren't using Ruby for this as well as why people are. Non-GUI programmers get a very quick version of the survey. The survey should take no more than 5-10 minutes to complete. That's unless you have a lot of things you want to get off your chest in the comment boxes - which you're welcome to do too. All the answers are anonymous. The survey will run for two weeks, after which the results will be posted on the web, with a notice here. The anonymised raw data will also be made available to those who are interested. The background to this is that there are sporadic threads on GUI programming on this group, but little overall picture of Ruby GUI usage emerges. New options for GUI development have emerged in recent year. I'm interested to know who's doing what, and how Ruby could be a better language for these kind of applications. Thank you to Rubyists who commented on earlier drafts of the survey. Please feel free to forward the survey link to relevant mailing lists etc. Thanks for your support. alex From alex at pressure.to Wed Nov 19 18:50:52 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 19 Nov 2008 23:50:52 +0000 Subject: [wxruby-users] Xrc Q ; using mulitple layouts(Frames , dialogs , panels) In-Reply-To: References: Message-ID: <4924A65C.4050109@pressure.to> Jn Jn wrote: > I am developing a simple GUI with wxruby. I am using wxFormbuilder to > get the xrc file. > I need a simple Frame with menu item file and submenu open,save and > exit. And when I click on open(submenu) it should launch an > panel(dialog) which has filepicker. > > I believe I would be able to develop a dailog also under the same > project in wxFormbuilder(which it allowed without any warnings or > errors) ,when I run xrcise I get 2 classes under same xrc file. but when > try to load it when I click on open the applicaiton crashes. > Could you please post the error message that you get when you click on 'open'? It's hard to know what's happening otherwise. Also please say what platform (eg Win XP) and version of wxRuby you're using. Lastly, please show the code you've written to open the initial window from Ruby. > Can someone point to any sample program which uses multiple layouts > with xrc. What is the sequence of loading the objects . > There shouldn't be any problem having any number of different dialogs and frames in a single project. I have one (using DialogBlocks) which has at least 10 separate top-level windows. alex From lists at ruby-forum.com Wed Nov 19 23:19:43 2008 From: lists at ruby-forum.com (Jn Jn) Date: Thu, 20 Nov 2008 05:19:43 +0100 Subject: [wxruby-users] Xrc Q ; using mulitple layouts(Frames , dialogs , panels) In-Reply-To: <4924A65C.4050109@pressure.to> References: <4924A65C.4050109@pressure.to> Message-ID: Problem 1 I had overlooked the error, my bad. ./TestXrc.rb:69:in `find_window_by_id': Error wrapping object; class `wxFilePickerCtrl' is not supported in wxRuby (NotImplementedError) from ./TestXrc.rb:69:in `initialize' from ./TestXrc.rb:77:in `call' from ./TestXrc.rb:77:in `initialize' from ./TestWrapperClass.rb:7:in `new' from ./TestWrapperClass.rb:7:in `initialize' from TestApp.rb:12:in `call' from TestApp.rb:12:in `process_event' from TestApp.rb:12:in `main_loop' from TestApp.rb:12 As wxruby does not support wxFilePicker, is there an alternative ( and FileDialog (Which I suppose I could have used, is not there on wxFormbuilder) is there any other alternative? Problem 2. I put a textbox+button combo to work around the unavailablity of filepickerctrl. but now I am in a sort of design issue due lack understanding on how I can make the dialog a child of frame and from there I can catch its events Here is the design TestXrcWrapperClass << TestXrc(BaseFrame) and BrowseFileWrapperClass << Browsefile(OpenfileDialog) TestApp creats TestXrcWrapperClass which create BrowsefilewarraperClass. Q. How will I get the close events from dialog to the Frame? Q. How do I put it into a parent child framework(the Dialog and Base Frame). ?Is that a better way to go? Code attached : ================================================================== TestApp.rb ================================================================= require 'wx' require 'TestWrapperClass' class TestApp < Wx::App def on_init TestWrapperClass.new().show end end app = TestApp.new app.main_loop ================================================================== TestXrc.rb ================================================================= # This class was automatically generated from XRC source. It is not # recommended that this file is edited directly; instead, inherit from # this class and extend its behaviour there. # # Source file: TestXrc.xrc # Generated at: Wed Nov 19 19:29:39 -0800 2008 class TestXrc < Wx::Frame attr_reader :m_menubar2, :m_file, :m_open, :m_exit, :m_help, :m_notebook1 def initialize(parent = nil) super() xml = Wx::XmlResource.get xml.flags = 2 # Wx::XRC_NO_SUBCLASSING xml.init_all_handlers xml.load("TestXrc.xrc") xml.load_frame_subclass(self, parent, "TestFrame") 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 @m_menubar2 = finder.call("m_menubar2") @m_file = finder.call("m_file") @m_open = finder.call("m_open") @m_exit = finder.call("m_exit") @m_help = finder.call("m_help") @m_notebook1 = finder.call("m_notebook1") if self.class.method_defined? "on_init" self.on_init() end end end ==================================================================== TestWrapperClass.rb ================================================================== require 'TestXrc' require 'BrowseFileWrapperClass' class TestWrapperClass < TestXrc def initialize() super() evt_menu(@m_open){ @dialog=BrowseFileWrapperClass.new @dialog.show() } evt_menu(@m_exit){exit} end end ================================================================ BrowseFileWrapperClass.rb ================================================================ require 'TestXrc' class BrowseFileWrapperClass < BrowseFile attr_accessor :filename def initialize super() evt_button(@m_browsefile_button){ @filename=@m_browsefile_text.value close } end end -- Posted via http://www.ruby-forum.com/. From erubin at valcom.com Thu Nov 20 09:37:11 2008 From: erubin at valcom.com (Eric Rubin) Date: Thu, 20 Nov 2008 09:37:11 -0500 Subject: [wxruby-users] Making a frame stay on top sometimes Message-ID: <00C99D2D058646EEB5F8F7239CB13125@valcom.com> I'm using STAY_ON_TOP in the style when I create my Frame app so it is always on top, and it works fine. What I want, though, is for the Frame to stay on top under some conditions, but behave normally under other conditions. I don't see any set_style method for Frame that would let me turn the STAY_ON_TOP behavior on and off dynamically. Is there any way to do this? Eric Rubin -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Thu Nov 20 09:48:59 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 20 Nov 2008 14:48:59 +0000 Subject: [wxruby-users] Making a frame stay on top sometimes In-Reply-To: <00C99D2D058646EEB5F8F7239CB13125@valcom.com> References: <00C99D2D058646EEB5F8F7239CB13125@valcom.com> Message-ID: <492578DB.5050505@pressure.to> Hi Eric Eric Rubin wrote: > > I?m using STAY_ON_TOP in the style when I create my Frame app so it is > always on top, and it works fine. What I want, though, is for the > Frame to stay on top under some conditions, but behave normally under > other conditions. I don?t see any set_style method for Frame that > would let me turn the STAY_ON_TOP behavior on and off dynamically. Is > there any way to do this? > From my reading of wxWidgets discussions, there's no way to change the style flags of a Window (inc Frame) after it's been created. This is because changes are not guaranteed to be honoured on all platforms. The way round this in your circumstance might be to have two frames, with one hidden and one shown at any time. One has the STAY_ON_TOP style, the other not. When you want to change the STAY_ON_TOP behaviour: 1) hide the currently shown frame 2) reparent that frame's top-level content (eg Panel) to the other frame 3) move the frame you're about to show to the same size and position 4) show the previously hidden frame hth alex From erubin at valcom.com Thu Nov 20 10:02:53 2008 From: erubin at valcom.com (Eric Rubin) Date: Thu, 20 Nov 2008 10:02:53 -0500 Subject: [wxruby-users] Making a frame stay on top sometimes In-Reply-To: <492578DB.5050505@pressure.to> Message-ID: <1335DC138ED34483BCE2A5F9E1E482A3@valcom.com> Thanks, but I just noticed that there is a Window#set_window_style_flag which seems like it would do what I want. I think I'll give that a try. If it doesn't work I might try your two frames solution. Eric -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Thursday, November 20, 2008 9:49 AM To: General discussion of wxRuby Subject: Re: [wxruby-users] Making a frame stay on top sometimes Hi Eric Eric Rubin wrote: > > I'm using STAY_ON_TOP in the style when I create my Frame app so it is > always on top, and it works fine. What I want, though, is for the > Frame to stay on top under some conditions, but behave normally under > other conditions. I don't see any set_style method for Frame that > would let me turn the STAY_ON_TOP behavior on and off dynamically. Is > there any way to do this? > From my reading of wxWidgets discussions, there's no way to change the style flags of a Window (inc Frame) after it's been created. This is because changes are not guaranteed to be honoured on all platforms. The way round this in your circumstance might be to have two frames, with one hidden and one shown at any time. One has the STAY_ON_TOP style, the other not. When you want to change the STAY_ON_TOP behaviour: 1) hide the currently shown frame 2) reparent that frame's top-level content (eg Panel) to the other frame 3) move the frame you're about to show to the same size and position 4) show the previously hidden frame hth alex _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users From erubin at valcom.com Thu Nov 20 10:14:08 2008 From: erubin at valcom.com (Eric Rubin) Date: Thu, 20 Nov 2008 10:14:08 -0500 Subject: [wxruby-users] Making a frame stay on top sometimes In-Reply-To: <1335DC138ED34483BCE2A5F9E1E482A3@valcom.com> Message-ID: <05E4C303888E44C09AF1C0B012237DEB@valcom.com> Looks like Window#set_window_style_flag allows me to turn STAY_ON_TOP on and off (in MS Windows). Eric -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Eric Rubin Sent: Thursday, November 20, 2008 10:03 AM To: 'General discussion of wxRuby' Subject: Re: [wxruby-users] Making a frame stay on top sometimes Thanks, but I just noticed that there is a Window#set_window_style_flag which seems like it would do what I want. I think I'll give that a try. If it doesn't work I might try your two frames solution. Eric -----Original Message----- From: wxruby-users-bounces at rubyforge.org [mailto:wxruby-users-bounces at rubyforge.org] On Behalf Of Alex Fenton Sent: Thursday, November 20, 2008 9:49 AM To: General discussion of wxRuby Subject: Re: [wxruby-users] Making a frame stay on top sometimes Hi Eric Eric Rubin wrote: > > I'm using STAY_ON_TOP in the style when I create my Frame app so it is > always on top, and it works fine. What I want, though, is for the > Frame to stay on top under some conditions, but behave normally under > other conditions. I don't see any set_style method for Frame that > would let me turn the STAY_ON_TOP behavior on and off dynamically. Is > there any way to do this? > From my reading of wxWidgets discussions, there's no way to change the style flags of a Window (inc Frame) after it's been created. This is because changes are not guaranteed to be honoured on all platforms. The way round this in your circumstance might be to have two frames, with one hidden and one shown at any time. One has the STAY_ON_TOP style, the other not. When you want to change the STAY_ON_TOP behaviour: 1) hide the currently shown frame 2) reparent that frame's top-level content (eg Panel) to the other frame 3) move the frame you're about to show to the same size and position 4) show the previously hidden frame hth alex _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users _______________________________________________ wxruby-users mailing list wxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users From alex at pressure.to Thu Nov 20 10:37:38 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 20 Nov 2008 15:37:38 +0000 Subject: [wxruby-users] Making a frame stay on top sometimes In-Reply-To: <05E4C303888E44C09AF1C0B012237DEB@valcom.com> References: <05E4C303888E44C09AF1C0B012237DEB@valcom.com> Message-ID: <49258442.3040505@pressure.to> Eric Rubin wrote: > Looks like Window#set_window_style_flag allows me to turn STAY_ON_TOP on and > off (in MS Windows). > Ah, thanks, I thought there was some method that did this but couched in warnings about changes to some flags on some platforms not being honoured. Useful to know that this one is - much neater solution. alex From lists at ruby-forum.com Thu Nov 20 16:45:55 2008 From: lists at ruby-forum.com (Cyrill Jakovlev) Date: Thu, 20 Nov 2008 22:45:55 +0100 Subject: [wxruby-users] StaticBitmap In-Reply-To: <49214680.4020005@pressure.to> References: <1892f268dcdd931fcdbf5f220ac4a764@ruby-forum.com> <49214680.4020005@pressure.to> Message-ID: <7efb9e3d618ee599de5560f662f29a67@ruby-forum.com> Thanks you, it's work)) -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 20 18:58:22 2008 From: lists at ruby-forum.com (Omar Hernandez) Date: Fri, 21 Nov 2008 00:58:22 +0100 Subject: [wxruby-users] Static line is not drawn Message-ID: Hello there, My next problem is with a wx::StaticLine ok, in the code, i'm using a notebook and i'm putting a panel in it. I declare and initialize comboboxes, grids, lavels (static texts), textctrl, buttons, etc, and a StaticLine. Everything appears on the window, but not the line. If I call the line outside the notebook in an independen panel (on other program) the line is drwan. So I think I missed something. Another problem is that the TextCtrl is drawn in a strange way: just a white rectangle whithout borders and it looks bad. I'm attaching the code, please run it and check what I mean. Any help would be great! I'm using Windows, and I've olny tried the code on windows. Attachments: http://www.ruby-forum.com/attachment/2954/testPrincipal.rb -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Nov 20 22:04:34 2008 From: lists at ruby-forum.com (Jn Jacob) Date: Fri, 21 Nov 2008 04:04:34 +0100 Subject: [wxruby-users] Xrc Q ; using mulitple layouts(Frames , dialogs , panels) In-Reply-To: References: <4924A65C.4050109@pressure.to> Message-ID: <994d4c6ba01eff8c93d73359fe7cb6fc@ruby-forum.com> I forgot to add , I am using windows xp -- Posted via http://www.ruby-forum.com/. From Franz.Irlweg.ZNT at wacker.com Fri Nov 21 08:35:17 2008 From: Franz.Irlweg.ZNT at wacker.com (Irlweg, Franz (ZNT)) Date: Fri, 21 Nov 2008 14:35:17 +0100 Subject: [wxruby-users] error in grid In-Reply-To: <491C3404.6090204@pressure.to> References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> <491328BC.9040804@pressure.to> <49183C6E.3030108@pressure.to> <491C3404.6090204@pressure.to> Message-ID: Hello, after installing wxruby-1.9.9-x86-mswin32-60.gem i tried the grid.rb sample: after changing the value in the checkbox and clicking on another row, the following error is raised: C:/Programme/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-mswin32-60/sam ples/grid/grid.rb:81:in `initialize': undefined method 'get_row' for # References: <4924A65C.4050109@pressure.to> Message-ID: <49268884.4090206@pressure.to> Jn Jn wrote: > ./TestXrc.rb:69:in `find_window_by_id': Error wrapping object; class > `wxFilePickerCtrl' is not supported in wxRuby (NotImplementedError) > from ./TestXrc.rb:69:in `initialize' > > ... > As wxruby does not support wxFilePicker, is there an alternative ( > and FileDialog (Which I suppose I could have used, is not there on > wxFormbuilder) is there any other alternative? > The alternative is to do what you've done below. In fact, this is what wxWidgets does anyway on Windows and OS X; the "wxFilePicker" is only a native control on GTK. This is the main reason the class isn't ported. > Problem 2. > I put a textbox+button combo to work around the unavailablity of > filepickerctrl. but now I am in a sort of design issue due lack > understanding on how I can make the dialog a child of frame and from > there I can catch its events > I'm not clear which dialog you mean, or where the FilePicker goes. If all you want to do is allow the user to choose a file to open (like an "Open" item in a menu), you don't need FilePicker. The simplest way is just to use Wx::file_selector function evt_menu(Wx::ID_OPEN) do file_to_open = Wx::file_selector('Choose a file') # .... note that file_to_open will be an empty string if the user chose Cancel end For more control, use Wx::FileDialog - see the docs and the dialog sample. > Here is the design > TestXrcWrapperClass << TestXrc(BaseFrame) and > BrowseFileWrapperClass << Browsefile(OpenfileDialog) > TestApp creats TestXrcWrapperClass which create > BrowsefilewarraperClass. > > Q. How will I get the close events from dialog to the Frame? dlg = MyDialog.new(self, ...) dlg.evt_close { | evt | puts 'my child dialog has closed'; evt.skip } But conventionally, modal (blocking) dialogs communicate the user's selection back to the calling frame through the return value of show_modal, eg: dlg = Wx::FileDialog.newl(self, ...) result = dlg.show_modal if result = Wx::ID_OK puts 'you chose' + dlg.file else puts 'you cancelled' end end > Q. How do I put it into a parent child framework(the Dialog and Base > Frame). ?Is that a better way to go? You should definitely make a modal dialog a child of the calling frame. I'd suggest you have a look at the dialogs.rb sample to see how it's done. alex From lists at ruby-forum.com Fri Nov 21 14:10:54 2008 From: lists at ruby-forum.com (Jn Jacob) Date: Fri, 21 Nov 2008 20:10:54 +0100 Subject: [wxruby-users] Static line is not drawn In-Reply-To: References: Message-ID: Omar Hernandez wrote: > Hello there, > > My next problem is with a wx::StaticLine > > ok, in the code, i'm using a notebook and i'm putting a panel in it. I > declare and initialize comboboxes, grids, lavels (static texts), > textctrl, buttons, etc, and a StaticLine. > > Everything appears on the window, but not the line. If I call the line > outside the notebook in an independen panel (on other program) the line > is drwan. So I think I missed something. > I think the size shouldnt be -1 , make it greater than 0 > Another problem is that the TextCtrl is drawn in a strange way: just a > white rectangle whithout borders and it looks bad. > try setting border options on like DOUBLE_BORDER , i am not sure if it would work. > I'm attaching the code, please run it and check what I mean. > Any help would be great! > > I'm using Windows, and I've olny tried the code on windows. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Nov 24 07:33:03 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 24 Nov 2008 12:33:03 +0000 Subject: [wxruby-users] error in grid In-Reply-To: References: <490C92BB.6000106@pressure.to> <49130133.8020507@pressure.to> <491328BC.9040804@pressure.to> <49183C6E.3030108@pressure.to> <491C3404.6090204@pressure.to> Message-ID: <492A9EFF.8000104@pressure.to> Hi Franz Irlweg, Franz (ZNT) wrote: > Hello, > > after installing wxruby-1.9.9-x86-mswin32-60.gem > i tried the grid.rb sample: > > after changing the value in the checkbox and clicking on another row, > the following error is raised: > > > C:/Programme/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.9-x86-mswin32-60/sam > ples/grid/grid.rb:81:in `initialize': undefined method 'get_row' for > # Thanks for the report. I think this must be the same bug as this: http://rubyforge.org/tracker/index.php?func=detail&aid=21985&group_id=35&atid=218 I have a fix in the works but it will need recompilation. > So i can not integrate this version in my production environment. My > actual version is wxruby-1.9.5 If there is something critical you need from teh current release, you should be able to work around this by checking the class of the object coming into the event handler. return unless event.kind_of?(Wx::GridEvent) a From lists at ruby-forum.com Mon Nov 24 23:09:29 2008 From: lists at ruby-forum.com (Zhimin Zhan) Date: Tue, 25 Nov 2008 05:09:29 +0100 Subject: [wxruby-users] Tooltip (help text) on toobar button not showing Message-ID: <4c8daacc0900c847483b69d912fe22cb@ruby-forum.com> Hi, In BigDemo\wxToolBar.rbw tb.add_tool(10, "New", xpm_bitmap('new.xpm'), "Long help for New") The text "Long help for New" is not shown when mouse hover over toolbar buttons. Env: WinXP, Ruby 1.8.6, wxRuby 1.9.9 mswin32 Thanks, Zhimin -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Nov 28 06:07:17 2008 From: lists at ruby-forum.com (Pascal Hurni) Date: Fri, 28 Nov 2008 12:07:17 +0100 Subject: [wxruby-users] RFC on cleaning Wx::App Message-ID: <1a113b726a84525f19d87aee84c9c9bf@ruby-forum.com> Hi, I added a missing feature in Wx::App that let's you handle in one place exceptions raised in any event handler (without exiting the main_loop, so that these exceptions may be not fatal to the app). At that time I found that the docs of Wx::App and the code itself are not in sync. I'm in the process of creating a ticket with a patch for this. Before I complete the patch, I request some comments on these methods: #on_fatal_exception #on_unhandled_exception #on_exception_in_main_loop As these methods are designed to deal with C++ exceptions, shouldn't we simply %ignore them in wxRuby? (That's my proposal) Additionnaly, I found that App.i doesn't %include "wxApp.h" at all, the class definition is inlined in App.i directly (at the end of file). So should we get rid of "wxApp.i" ? Regards, Pascal -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Sat Nov 29 10:19:47 2008 From: alex at pressure.to (Alex Fenton) Date: Sat, 29 Nov 2008 15:19:47 +0000 Subject: [wxruby-users] RFC on cleaning Wx::App In-Reply-To: <1a113b726a84525f19d87aee84c9c9bf@ruby-forum.com> References: <1a113b726a84525f19d87aee84c9c9bf@ruby-forum.com> Message-ID: <49315D93.7070000@pressure.to> Pascal Hurni wrote: > I added a missing feature in Wx::App that let's you handle in one place > exceptions raised in any event handler (without exiting the main_loop, > so that these exceptions may be not fatal to the app). > That would be good. Ideally something that would work ruby-ishly - eg rescue. This discussion is probably better on wxruby-dev. > At that time I found that the docs of Wx::App and the code itself are > not in sync. I'm in the process of creating a ticket with a patch for > this. > > Before I complete the patch, I request some comments on these methods: > #on_fatal_exception > #on_unhandled_exception > #on_exception_in_main_loop > > As these methods are designed to deal with C++ exceptions, shouldn't we > simply %ignore them in wxRuby? (That's my proposal) > Yes. > Additionnaly, I found that App.i doesn't %include "wxApp.h" at all, the > class definition is inlined in App.i directly (at the end of file). So > should we get rid of "wxApp.i" ? Probably not - the header files in swig/classes/include work as a list of the classes available, even if some of them aren't used in building the wxruby library. thanks alex From fabio.petrucci at gmail.com Sun Nov 30 04:27:08 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Sun, 30 Nov 2008 10:27:08 +0100 Subject: [wxruby-users] wxComboBox and wxTE_PROCESS_ENTER Message-ID: Hi all, i am trying to use wxComboBox (instead of wxChoice) to capture wxTE_PROCESS_ENTER event. If i enable TE_PROCESS_ENTER flag on the resulting xrc file, i get an 'Unknown style flag wxTE_PROCESS_ENTER' on app loading. Probably wxComboBox doesn't reconize this kind of event. How do i catch this event for the wxComboBox widget? Thank you all. bio. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fabio.petrucci at gmail.com Sun Nov 30 12:00:09 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Sun, 30 Nov 2008 18:00:09 +0100 Subject: [wxruby-users] wxComboBox and wxTE_PROCESS_ENTER In-Reply-To: References: Message-ID: On Sun, Nov 30, 2008 at 10:27 AM, Fabio Petrucci wrote: > Hi all, > > i am trying to use wxComboBox (instead of wxChoice) to capture > wxTE_PROCESS_ENTER event. > > If i enable TE_PROCESS_ENTER flag on the resulting xrc file, i get an > 'Unknown style flag wxTE_PROCESS_ENTER' on app loading. > > Probably wxComboBox doesn't reconize this kind of event. > How do i catch this event for the wxComboBox widget? > > Thank you all. > > bio. > Wx::TE_PROCESS_ENTER can be set programmatically by window#toggle_window_style(Wx::TE_PROCESS_ENTER) ...now it works, but enabling this flag, the widget loose TAB controls (TAB / SHIFT+TAB) To try it out, on the 'BigDemo -> wxComboBox' example if i add this flag on line 23: cb = Wx::ComboBox.new(self, 500, "default value", Wx::Point.new(90,50), Wx::DEFAULT_SIZE, sampleList, Wx::CB_DROPDOWN|Wx::TE_PROCESS_ENTER) i get the enter event but no tabbing is possible. Is it a bug? Thank you for your help. bio -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Sun Nov 30 12:06:02 2008 From: alex at pressure.to (Alex Fenton) Date: Sun, 30 Nov 2008 17:06:02 +0000 Subject: [wxruby-users] wxComboBox and wxTE_PROCESS_ENTER In-Reply-To: References: Message-ID: <4932C7FA.5050505@pressure.to> Fabio Petrucci wrote: > > Wx::TE_PROCESS_ENTER can be set programmatically by > window#toggle_window_style(Wx::TE_PROCESS_ENTER) > > ...now it works, but enabling this flag, the widget loose TAB controls > (TAB / SHIFT+TAB) 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? > cb = Wx::ComboBox.new(self, 500, "default value", > Wx::Point.new(90,50), Wx::DEFAULT_SIZE, > sampleList, > Wx::CB_DROPDOWN|Wx::TE_PROCESS_ENTER) > > i get the enter event but no tabbing is possible. > > Is it a bug? I don't know. I expect if the control is told to consume ENTER, it also consumes TAB. alex From mario at ruby-im.net Sun Nov 30 13:11:56 2008 From: mario at ruby-im.net (Mario Steele) Date: Sun, 30 Nov 2008 12:11:56 -0600 Subject: [wxruby-users] wxComboBox and wxTE_PROCESS_ENTER In-Reply-To: <4932C7FA.5050505@pressure.to> References: <4932C7FA.5050505@pressure.to> Message-ID: The problem lies in the fact, that Wx::ComboBox has a Drop down, and a Text Edit in it. 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. The best thing to do, is to monitor evt_keypress, and create a new item, and update that item in the combo box, as the person types stuff into it. Either that, or monitor on focus lost, and check to see if the item is in the combo box, if not, add it. Though, that can lead to it's own problems, as a person could switch between the controls several times, and have several items added if he changes the text each and every time he tabs between the controls. Just a couple of suggestions on how to work around it. On Sun, Nov 30, 2008 at 11:06 AM, Alex Fenton wrote: > Fabio Petrucci wrote: > >> >> Wx::TE_PROCESS_ENTER can be set programmatically by >> window#toggle_window_style(Wx::TE_PROCESS_ENTER) >> >> ...now it works, but enabling this flag, the widget loose TAB controls >> (TAB / SHIFT+TAB) >> > > 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? > > cb = Wx::ComboBox.new(self, 500, "default value", Wx::Point.new(90,50), >> Wx::DEFAULT_SIZE, >> sampleList, >> Wx::CB_DROPDOWN|Wx::TE_PROCESS_ENTER) >> >> i get the enter event but no tabbing is possible. >> >> Is it a bug? >> > > I don't know. I expect if the control is told to consume ENTER, it also > consumes TAB. > > alex > _______________________________________________ > 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 fabio.petrucci at gmail.com Sun Nov 30 18:29:56 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Mon, 1 Dec 2008 00:29:56 +0100 Subject: [wxruby-users] wxComboBox and wxTE_PROCESS_ENTER In-Reply-To: References: <4932C7FA.5050505@pressure.to> Message-ID: 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: