From dlbeswick at gmail.com Sat Oct 1 05:22:51 2011 From: dlbeswick at gmail.com (David Beswick) Date: Sat, 1 Oct 2011 19:22:51 +1000 Subject: [wxruby-users] Packaging wxRuby fails In-Reply-To: <4DC97389.4080709@gmx.net> References: <4D779EDD.4090806@gmx.net> <103535ecce64256f7c8307c1fc5ccf1b@ruby-forum.com> <4DA160CE.30101@gmx.net> <4DC817F5.4050405@gmx.net> <4DC8480C.4090200@pressure.to> <4DC97389.4080709@gmx.net> Message-ID: Hi everyone, an update on this problem and wxruby's gem and build troubles. I was just able to build wxruby and run bigdemo with the help of a proposed natty (11.04) fix for Ubuntu's apt wxwidgets package. This is great progress! As soon as the natty fix is released, binary gems might be ready to go again. To summarise the problems and their fixes so far: 1. Previously, running any wxruby app would cause a crash in pixman. This has possibly been narrowed down to a problem with mesa or opengl drivers and it affects many projects that link dynamically to wxwidgets as well as other gui toolkits. Excluding opengl support seems to fix this for wxruby. See https://bugs.launchpad.net/ubuntu/+source/pixman/+bug/756237 2. An additional problem cropped up in Natty, and maybe other versions. The Xinerama library is in an unusual place in Ubuntu 64-bit. wxwidget's configure script can't find it and so it disables support for the wxDisplay class (as if --disable-display was given,) and this causes rake compile to fail because there's no definition of wxDisplay::ResetMode. There is an official proposed fix for this now, see https://bugs.launchpad.net/ubuntu/+source/wxwidgets2.8/+bug/828999, and follow the directions to get the fixed package. Please take a moment to verify the fix on the bug page, if you try it. 3. Just today, I discovered a problem with the wxruby rake files. The rake files exclude various classes from the build on linux, but the logic fails because code reads the array $excluded_classes in rakeunixish.rb before the array is actually set up at the bottom of rakeconfigure.rb. This causes link to fail because libgtk-media isn't present, and MediaCtrl should be excluded from the build. I added a class to wrap the functionality of extracting and testing for wx features, and it's implemented such that querying wx features should be insensitive to the order of different bits of code. Please apply the attached patch to fix this, let me know if you have problems with it. On Wed, May 11, 2011 at 3:19 AM, Quintus wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Am 09.05.2011 22:01, schrieb Alex Fenton: > > On 09/05/11 17:36, Quintus wrote: > >> Some progress seems to have been made, but wxRuby still doesn't run on > >> any Ubuntu> Lucid. The bug at > >> https://bugs.launchpad.net/ubuntu/+source/wxwidgets2.8/+bug/632984 has > >> finally been fixed (for Oneiric), just to reveal another one (see my > >> last comment on that bug) that still prevents the main bug at > >> https://bugs.launchpad.net/ubuntu/+source/pixman/+bug/756237 to get > >> flagged for Natty. > > > > thanks for the update - and thanks also for reporting on and documenting > > the issues on the Ubuntu bugtracker. I was half-thinking of switching to > > Fedora anyway before the next Ubuntu came out - maybe this will tip me > > over. > > I think I already mentioned it, but it was exaktly wxRuby that was the > final reason for me to switch from Ubuntu to Arch Linux. I really enjoy > the rolling release model now--no way back. :-) > > However, Ubuntu is the most-widespread Linux distribution out there. > It's not wise to drop support for it I think, because it would > significantly state a contrast to the platform-indepentness wxRuby aims > to provide. > > > Martin, I have been quite successful at deploying both 32 bit and > > 64-bit > > 10.04 installations of wxRuby. I had to go back to the 2.0.0 gem for > > 64, but > > it seems to work quite fine with our rather elaborate application. > > Ubuntu Lucid 64bit worked without a problem for me, even though I had to > compile wxRuby 2.0.1 myself. It's just that wxRuby doesn't work on each > and every Ubuntu *after* Lucid. > > And btw. my name is Marvin, note the v. :-) > > > Hi Don, on which distributions and versions of those distributions > > were you > > deploying your apps on? > > I can confirm wxRuby not working for Ubuntu Maverick 64bit, Ubuntu > Maverick 32bit, Ubuntu Natty 32bit (the last to being virtual machines) > and Arch Linux 64bit (completely updated last Friday)*. But I suppose it > doesn't work for different reasons on each machine... :-( > > > Here's the bug that discussion references, in Debian: > > > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613221 > > Thanks! It really looks like a bug in pixman then. > > ########################### > > So, what can we do now? wxRuby's obviously not at fault, it's > > a) pixman that is broken and > b) Debian/Ubuntu that ships broken wxWidgets packages > > b) is marked as fixed for Oneiric, but I doubt wheather wxRuby will run > then, because of a) and a symbol lookup error I already described on > Launchpad (this would be c) then I think). > > The pixman bug breaks wxRuby on nearly every recent Linux distribution, > and Debian/Ubuntu breaks it a second time due to their package > management, which is especially problementic because of their popularity. > > To conclude: I'm worried about wxRuby's future, although it seems that > wxRuby can't do much about the mentioned problems. > > > best > > alex > > Valete, > Marvin > > * The distros I were using "normally", i.e. not as virtual machines, > were like this: > Ubuntu Lucid 64bit -> Ubuntu Maverick 64bit [broke wxRuby] -> Arch Linux > 64bit > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iQEcBAEBAgAGBQJNyXOBAAoJELh1XLHFkqhajpYIAK0/ZBrho5fd9fGaEkGGQbal > +uwRxdavIldM38I8wolfIomPEZxTzupim+NPLigB1NHToUrSjhhCGkg482YuJR9u > HMncfRInw5eK/rXo1xHwF213sY3bZtxy9EOG+lJ/qLCm6qrke5tAGBKLzsY62QtG > v4KOXGNOyC+NEtdHFyPhancvwqrjfnyL/OjgUMku03saLq58vDZMiv1rAz++m69c > RO5h6sIZ+ZHp4tVIKSMKjLYoyQrVfuNK/A0RJMdpnLlsz+oAiP36sS65wKEL1wB4 > +F62p7Ow/yjgItqAeG2HgKRcJyKwRT9tXSK8M83dsxWk9hyJVubILa2dWpvsD70= > =12Su > -----END PGP SIGNATURE----- > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: wxruby-2.0.1-ubuntu-build-fix.patch Type: text/x-patch Size: 13057 bytes Desc: not available URL: From lists at ruby-forum.com Sat Oct 1 05:49:59 2011 From: lists at ruby-forum.com (Stanislav Chren) Date: Sat, 01 Oct 2011 11:49:59 +0200 Subject: [wxruby-users] Creating custom widget Message-ID: <71bba73696917e3fed98bfd62df93a02@ruby-forum.com> Hi, I'm trying to learn and experiment with Ruby a bit so I decided to make a simple diagram editor using wxruby. The problem is, I will need to create a custom widget for the diagram components (e.g. rectangles, connections) and implement some custom events. I found these examples of how it's done in generic wxWidgets: http://wiki.wxwidgets.org/Painting_your_custom_control http://docs.wxwidgets.org/2.9.2/overview_customwidgets.html Is something like this possible in wxRuby or is there any sample ruby code which I could look at? Thank you for any suggestions. Stano -- Posted via http://www.ruby-forum.com/. From dlbeswick at gmail.com Sat Oct 1 20:58:22 2011 From: dlbeswick at gmail.com (David Beswick) Date: Sun, 2 Oct 2011 11:58:22 +1100 Subject: [wxruby-users] Creating custom widget In-Reply-To: <71bba73696917e3fed98bfd62df93a02@ruby-forum.com> References: <71bba73696917e3fed98bfd62df93a02@ruby-forum.com> Message-ID: Hello Stanislav, I'm sure that this is possible. Most of the methods in that code should have direct wxruby equivalents, you can derive from the native wxruby classes, but the event-handling syntax is quite different. Check out the wxRuby samples. Where they're installed depends on what operating system you're on and how you installed wxruby, but if you can't find it then download the source and you can see them all in the "samples" folder. In particular, maybe check out samples/drawing/graphics_drawing.rb On Sat, Oct 1, 2011 at 7:49 PM, Stanislav Chren wrote: > Hi, > > I'm trying to learn and experiment with Ruby a bit so I decided to make > a simple diagram editor using wxruby. > > The problem is, I will need to create a custom widget for the diagram > components (e.g. rectangles, connections) and implement some custom > events. I found these examples of how it's done in generic wxWidgets: > http://wiki.wxwidgets.org/Painting_your_custom_control > http://docs.wxwidgets.org/2.9.2/overview_customwidgets.html > > Is something like this possible in wxRuby or is there any sample ruby > code which I could look at? > > Thank you for any suggestions. > > Stano > > -- > 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 Sat Oct 1 21:16:33 2011 From: alex at pressure.to (Alex Fenton) Date: Sun, 02 Oct 2011 02:16:33 +0100 Subject: [wxruby-users] Creating custom widget In-Reply-To: <71bba73696917e3fed98bfd62df93a02@ruby-forum.com> References: <71bba73696917e3fed98bfd62df93a02@ruby-forum.com> Message-ID: <4E87BB71.8060001@pressure.to> hi On 01/10/11 10:49, Stanislav Chren wrote: > The problem is, I will need to create a custom widget for the diagram > components (e.g. rectangles, connections) and implement some custom > events. I found these examples of how it's done in generic wxWidgets: > http://wiki.wxwidgets.org/Painting_your_custom_control > http://docs.wxwidgets.org/2.9.2/overview_customwidgets.html > > Is something like this possible in wxRuby or is there any sample ruby > code which I could look at? Have a look at samples/events/events.rb - it uses a custom class derived from Wx::Window that implements an on_paint method and event handling. cheers alex From sutniuq at gmx.net Wed Oct 5 09:21:00 2011 From: sutniuq at gmx.net (Quintus) Date: Wed, 05 Oct 2011 15:21:00 +0200 Subject: [wxruby-users] Packaging wxRuby fails In-Reply-To: References: <4D779EDD.4090806@gmx.net> <103535ecce64256f7c8307c1fc5ccf1b@ruby-forum.com> <4DA160CE.30101@gmx.net> <4DC817F5.4050405@gmx.net> <4DC8480C.4090200@pressure.to> <4DC97389.4080709@gmx.net> <4E88CC7B.5050000@pressure.to> Message-ID: <4E8C59BC.90906@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 05.10.2011 03:28, schrieb David Beswick: >> 1. Previously, running any wxruby app would cause a crash in >> pixman. This has possibly been narrowed down to a problem with >> mesa or opengl drivers and it affects many projects that link >> dynamically to wxwidgets as well as other gui toolkits. Excluding >> opengl support seems to fix this for wxruby. See >> https://bugs.launchpad.net/ubuntu/+source/pixman/+bug/756237 Maybe I'm a bit too optimistic, but wxRuby works again with pixman version 0.22.2, at least on my system (Arch Linux). It seems the bug has been fixed. Hopefully it stays like this... Valete, Marvin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOjFmvAAoJELh1XLHFkqhaLWUH/2v6HwKgghqsOEA7j8hbyagP 5cwZrd+5xl8io4dHG7w454gpQsuP4tohQjs29+RPg9doUy7Y0OseXuv3A4+28jfX YkreGzLG4RxyagFIdGJM/kQDIjo/GclIiAp72fmtx6hXFJOjox5nDPZMY+erKlh/ XP1AhktqX+Ia8WqF31C6vDHoOgjRBDJimL6wY+RQnhVbtpLfIgPxxmqyXMDKfVGl ce5PL14zNSqCx/S9XbbRz1Bgxp+Ko0B+w3/2Mx1YxfmxZGgoF8M6aSWO8ofTQ+Fs FQni3ItsaKHaqIIfoK0nZOYutLatNFeOaVysO6lw6gl0z7ldPefVkIGRacwi3zM= =I8GM -----END PGP SIGNATURE----- From mark at atldes.com Thu Oct 6 12:46:46 2011 From: mark at atldes.com (Mark Barton) Date: Thu, 06 Oct 2011 12:46:46 -0400 Subject: [wxruby-users] WxRuby refresh from a long running function Message-ID: <4E8DDB76.1040603@atldes.com> Hi All, This is my first post and I am a complete (well almost complete) noob at WxRuby. I have programmed in Ruby for a while, but now I am trying my hand at a GUI base program running on Windows. There is quite a bit of serial communication between the app and a external device. The problem I am facing is a function call that takes a long time to complete before returning to WxRuby. My application is pretty simple with a start button, a few fields that display data and a progress bar. There are a couple of dialogs that pop up during the call as well. Advancing the progress bar and displaying dialogs works just fine, except the dialog windows do mess up the top application appearance once the dialog is dismissed. Of course once the function call is complete the screen will refresh as expected. I have tried setting a separate thread for the function and using a timer with Thread.pass as shown in the WxRuby thread example. Although the GUI is nice an responsive, the performance of the long running function is unacceptable. So is there a callback that can be done to allow the ruby app to run that I can make from this long running function or some other way to use a separate thread more efficiently. Ruby 1.8.7, WxRuby 2.0.1 Any help is appreciated. Mark From mark at atldes.com Mon Oct 10 14:36:02 2011 From: mark at atldes.com (Mark Barton) Date: Mon, 10 Oct 2011 14:36:02 -0400 Subject: [wxruby-users] having trouble show/hide bitmap in a sizer Message-ID: <4E933B12.6000902@atldes.com> I'm trying to display one of two separate bitmap images along with some text. The images are a check and and a cross symbol and are displayed as FIRMWARE C or FIRMWARE X or FIRMWARE where C would be my checkmark image and X is the cross image. This is the code I am using to initially setup the Static bitmap and sizer. This is then added to a vertical box sizer containing a few other controls. Lastly for a test, I simply show the appropriate image as in @check_sb_firmware.show and @x_sb_firmware forthe other image. The problem that I am seeing is the first time I show the image, the image appears at the top of my panel, the second time I show the image it is in the correct position, just after my text. Am I handling this wrong or perhaps there is a better way? It seems like it should be a simple task. Thanks Mark def make_firmware_check(parent) firmware_check_sizer = Wx::BoxSizer.new(Wx::HORIZONTAL) check_bm_firmware = Bitmap.new("images/check_icon.png", Wx::BITMAP_TYPE_ANY) @check_sb_firmware = Wx::StaticBitmap.new(parent, -1, check_bm_firmware) fw_text = Wx::StaticText.new(parent, ID_SERIAL_STATIC_TEXT, "FIRMWARE", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, 0, "") x_bm_firmware = Bitmap.new("images/x_icon.png", Wx::BITMAP_TYPE_ANY) @x_sb_firmware = Wx::StaticBitmap.new(parent, -1, x_bm_firmware) firmware_check_sizer.add(fw_text, 1, Wx::RIGHT|Wx::TOP|Wx::ALIGN_LEFT, 5) firmware_check_sizer.add(@check_sb_firmware, 0, Wx::ALIGN_CENTER, 3) firmware_check_sizer.add(@x_sb_firmware, 0, Wx::ALIGN_CENTER, 3) @check_sb_firmware.hide @x_sb_firmware.hide return firmware_check_sizer end -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlbeswick at gmail.com Mon Oct 10 22:38:08 2011 From: dlbeswick at gmail.com (David Beswick) Date: Tue, 11 Oct 2011 13:38:08 +1100 Subject: [wxruby-users] WxRuby refresh from a long running function In-Reply-To: <4E8DDB76.1040603@atldes.com> References: <4E8DDB76.1040603@atldes.com> Message-ID: Hi Mark! The answer in my experience is that you'll have to spawn another ruby process and do the processing normally done in the long-running function there. Basically, you need to use inter-process communication to do your asynchronous processing instead of threads. Unfortunately, this is unpleasant to do on Windows because of Ruby's poor support for spawning processes compared to Linux, but it can be done and it'll give you a superior result to any solution involving Ruby threads. I see you're using Ruby 1.8.7. Just a heads-up that you'll find Ruby 1.9 won't give you a better result; I've tried that thinking it would work because of 1.9's operating-system thread implementation, but it doesn't improve things because Ruby still has a Global Interpreter Lock that prevents more than one thread doing anything at one time. I would put your effort straight into an IPC solution. I think you'd find that the performance of the method you've tried would be fine on OSX or Linux under GTK+, I have found that. It's probably because of differences in their GUI implementations compared to Windows. If that's an option for you, that might save you some time. I do remember FXRuby doing much better at this than wxruby. FXRuby always worked perfectly fine in this situation, I'd like to look into improving this for wxruby one day. On Fri, Oct 7, 2011 at 3:46 AM, Mark Barton wrote: > Hi All, > > This is my first post and I am a complete (well almost complete) noob at > WxRuby. I have programmed in Ruby for a while, but now I am trying my hand > at a GUI base program running on Windows. There is quite a bit of serial > communication between the app and a external device. The problem I am facing > is a function call that takes a long time to complete before returning to > WxRuby. > > My application is pretty simple with a start button, a few fields that > display data and a progress bar. There are a couple of dialogs that pop up > during the call as well. Advancing the progress bar and displaying dialogs > works just fine, except the dialog windows do mess up the top application > appearance once the dialog is dismissed. Of course once the function call is > complete the screen will refresh as expected. > > I have tried setting a separate thread for the function and using a timer > with Thread.pass as shown in the WxRuby thread example. Although the GUI is > nice an responsive, the performance of the long running function is > unacceptable. > > So is there a callback that can be done to allow the ruby app to run that I > can make from this long running function or some other way to use a separate > thread more efficiently. > > Ruby 1.8.7, WxRuby 2.0.1 > > Any help is appreciated. > > Mark > > ______________________________**_________________ > 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 sutniuq at gmx.net Tue Oct 11 02:36:39 2011 From: sutniuq at gmx.net (Quintus) Date: Tue, 11 Oct 2011 08:36:39 +0200 Subject: [wxruby-users] WxRuby refresh from a long running function In-Reply-To: References: <4E8DDB76.1040603@atldes.com> Message-ID: <4E93E3F7.7000004@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 11.10.2011 04:38, schrieb David Beswick: > I see you're using Ruby 1.8.7. Just a heads-up that you'll find > Ruby 1.9 won't give you a better result; I've tried that thinking > it would work because of 1.9's operating-system thread > implementation, but it doesn't improve things because Ruby still > has a Global Interpreter Lock that prevents more than one thread > doing anything at one time. Things are getting better, although you're right and the GIL (or GVL, "Global VM Lock") is still there. Doing I/O for example releases the GIL to allow other threads to run while the I/O thing is processed. Read about the Ruby API's rb_thread_blocking_region() if you want to know how to achieve this in C extensions. The Pickaxe for 1.9 covers this in chapter 29 "Extending Ruby" starting on page 833 with "The Threading Model". > I do remember FXRuby doing much better at this than wxruby. FXRuby > always worked perfectly fine in this situation, I'd like to look > into improving this for wxruby one day. FYI: FxRuby isn't worked on anymore, so although it may still work at the moment, that isn't guaranteed to stay like this. Valete, Marvin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOk+PqAAoJELh1XLHFkqha+DQIAJzCyHDMxSuakNP+Z72P+lsD ZjjhRWSYzzNrnjcldfvk3VzNMJRvWVh87UGWojfaoRcF6smjkjSxSJXWl0PRObQi k5pscB5axYmLnKPRqF4DNLthoIdZ/IvDvUPe5gCrDEasilcUZSpr5eHapz4RIKeT HzIQDhgxj0L/XBIic9OMeG4yRRBxPKP8CyRxk5C+eOrb2f0Vfu3UPTWeJdoVXFba cvyvDCcwHBajzm20e1zg9xsjmKhv7QsK2mC9Kgr1QImp24UAH8BJb8cJVPrWaYC5 BgneNdyI2V5Aa/Q59MKo5KNGsiPXRFqWEmSrQPt3+ncKURV0LfSuetodX3X8Xsw= =c880 -----END PGP SIGNATURE----- From dlbeswick at gmail.com Tue Oct 11 02:50:04 2011 From: dlbeswick at gmail.com (David Beswick) Date: Tue, 11 Oct 2011 17:50:04 +1100 Subject: [wxruby-users] WxRuby refresh from a long running function In-Reply-To: <4E93E3F7.7000004@gmx.net> References: <4E8DDB76.1040603@atldes.com> <4E93E3F7.7000004@gmx.net> Message-ID: Thanks for the tip on rb_thread_blocking_region Marvin, I'll look at that sometime. Does the wxruby team have a view as to how likely that approach would be to work, has anyone looked at it? And you're right about FXRuby, I wouldn't recommend that people use it. I just mentioned it more to say that I've seen threads working ok in other Ruby GUI toolkits. Despite this thread issue, wxruby is still a far better choice. On Tue, Oct 11, 2011 at 5:36 PM, Quintus wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Am 11.10.2011 04:38, schrieb David Beswick: > > I see you're using Ruby 1.8.7. Just a heads-up that you'll find > > Ruby 1.9 won't give you a better result; I've tried that thinking > > it would work because of 1.9's operating-system thread > > implementation, but it doesn't improve things because Ruby still > > has a Global Interpreter Lock that prevents more than one thread > > doing anything at one time. > > Things are getting better, although you're right and the GIL (or GVL, > "Global VM Lock") is still there. Doing I/O for example releases the > GIL to allow other threads to run while the I/O thing is processed. > Read about the Ruby API's rb_thread_blocking_region() if you want to > know how to achieve this in C extensions. The Pickaxe for 1.9 covers > this in chapter 29 "Extending Ruby" starting on page 833 with "The > Threading Model". > > > I do remember FXRuby doing much better at this than wxruby. FXRuby > > always worked perfectly fine in this situation, I'd like to look > > into improving this for wxruby one day. > > FYI: FxRuby isn't worked on anymore, so although it may still work at > the moment, that isn't guaranteed to stay like this. > > Valete, > Marvin > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iQEcBAEBAgAGBQJOk+PqAAoJELh1XLHFkqha+DQIAJzCyHDMxSuakNP+Z72P+lsD > ZjjhRWSYzzNrnjcldfvk3VzNMJRvWVh87UGWojfaoRcF6smjkjSxSJXWl0PRObQi > k5pscB5axYmLnKPRqF4DNLthoIdZ/IvDvUPe5gCrDEasilcUZSpr5eHapz4RIKeT > HzIQDhgxj0L/XBIic9OMeG4yRRBxPKP8CyRxk5C+eOrb2f0Vfu3UPTWeJdoVXFba > cvyvDCcwHBajzm20e1zg9xsjmKhv7QsK2mC9Kgr1QImp24UAH8BJb8cJVPrWaYC5 > BgneNdyI2V5Aa/Q59MKo5KNGsiPXRFqWEmSrQPt3+ncKURV0LfSuetodX3X8Xsw= > =c880 > -----END PGP SIGNATURE----- > _______________________________________________ > 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 sutniuq at gmx.net Tue Oct 11 02:55:18 2011 From: sutniuq at gmx.net (Quintus) Date: Tue, 11 Oct 2011 08:55:18 +0200 Subject: [wxruby-users] having trouble show/hide bitmap in a sizer In-Reply-To: <4E933B12.6000902@atldes.com> References: <4E933B12.6000902@atldes.com> Message-ID: <4E93E856.9070802@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 10.10.2011 20:36, schrieb Mark Barton: > def make_firmware_check(parent) firmware_check_sizer = > Wx::BoxSizer.new(Wx::HORIZONTAL) check_bm_firmware = > Bitmap.new("images/check_icon.png", Wx::BITMAP_TYPE_ANY) > @check_sb_firmware = Wx::StaticBitmap.new(parent, -1, > check_bm_firmware) fw_text = Wx::StaticText.new(parent, > ID_SERIAL_STATIC_TEXT, "FIRMWARE", Wx::DEFAULT_POSITION, > Wx::DEFAULT_SIZE, 0, "") x_bm_firmware = > Bitmap.new("images/x_icon.png", Wx::BITMAP_TYPE_ANY) @x_sb_firmware > = Wx::StaticBitmap.new(parent, -1, x_bm_firmware) > firmware_check_sizer.add(fw_text, 1, > Wx::RIGHT|Wx::TOP|Wx::ALIGN_LEFT, 5) > firmware_check_sizer.add(@check_sb_firmware, 0, Wx::ALIGN_CENTER, > 3) firmware_check_sizer.add(@x_sb_firmware, 0, Wx::ALIGN_CENTER, > 3) @check_sb_firmware.hide @x_sb_firmware.hide return > firmware_check_sizer end Do yourself a favour and include the Wx module in your scope so you don't have to always write that annoying Wx::*. Second, you should probably read this: http://wxruby.rubyforge.org/doc/wxruby_intro.html There's no need to specify all that nasty default parameters for your wxRuby code, so e.g. > fw_text = Wx::StaticText.new(parent, ID_SERIAL_STATIC_TEXT, > "FIRMWARE", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, 0, "") becomes > fw_text = StaticText.new(parent, :id => ID_SERIAL_STATIC_TEXT, > :label => "FIRMWARE") And you may leave out the ":id => ID_SERIAL_STATIC_TEXT" as well, because there's usually no reason to assign IDs manually to widgets. Even for event handling you can usually just pass the control instance into the event handler. Next, the Wx::StaticBitmap class isn't intended to draw normal images (as weird as it sounds). Quote from the docs: > A static bitmap control displays a bitmap. It is meant for display > of the small icons in the dialog boxes and is not meant to be a > general purpose image display control. In particular, under Windows > 9x the size of bitmap is limited to 64?64 pixels and thus you > should use your own control if you want to display larger images > portably. Finally I'm not sure how sizers work with hidden controls. Your code appears logically correct to me (although there are some stylistic problems as I already pointed out), maybe you're running into an issue I've experienced some time ago as well: Changing a control's contents doesn't cause wxRuby to recalculate the sizer layout (in particular, the issue I was running into was that I had a right-aligned StaticText widget and the text could grow bigger and was then running out of the window). I *think* it is possible to make wxRuby relayout the GUI by calling Sizer#recalc_sizes, but I didn't try this (the original code where I could have needed that has been removed already). Vale, Marvin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOk+hNAAoJELh1XLHFkqhaJ8AH/3g1ZNLcAxF+jzOU1I2uwfFr JwHQ50tL3dL8E9yTfheUpKH426DovnBXwLD47FrZNhtHaxDZY2WkiCRDvHqDi+b+ E06WlbTBej3jPTSFEfH0Rm3XRmsua6aozZPHC9XaoNz2bXwxwwdsJiao7OtoJ5bP 70s7DlsbaDnxoUPHi9R6izl2tLAB4P7VNi/HKMhy2m07PNDH7d5nzM+XfwUM3Gls EbcCRNoNGM0+fh/aqYXo78nJ3rhorknhH7HvKfbZUZkuOpIl804yIQE1C4WO9XIj WWPd9eTEfqR5YnaTNF7zlG2f9BZj/c26+/ndxqOt422vPBZEYLy4BXQgtKVQ83Y= =2wH4 -----END PGP SIGNATURE----- From alex at pressure.to Tue Oct 11 04:03:48 2011 From: alex at pressure.to (Alex Fenton) Date: Tue, 11 Oct 2011 09:03:48 +0100 Subject: [wxruby-users] WxRuby refresh from a long running function In-Reply-To: References: <4E8DDB76.1040603@atldes.com> <4E93E3F7.7000004@gmx.net> Message-ID: <4E93F864.9040007@pressure.to> On 11/10/11 07:50, David Beswick wrote: > Thanks for the tip on rb_thread_blocking_region Marvin, I'll look at > that sometime. Does the wxruby team have a view as to how likely that > approach would be to work, has anyone looked at it? I have looked at it, briefly. I'm not sure how well it would work for the GUI situation, where the UI has to remain responsive while an arbitrarily long (possibly IO-bound) process completes. The wxWidgets threading solution (for more complex tasks, where evt_idle / safe_yield etc are insufficient) is that the main Wx (event loop) thread keeps running, and the worker thread notifies it of progress by posting Wx::Events to it. However, in wxRuby, processing events requires the ruby interpreter to be running, and it seems that rb_thread_blocking_region doesn't allow re-entry to the interpreter. However, I haven't experimented with this in latest versions of Ruby 1.9 alex From mark at atldes.com Tue Oct 11 06:33:06 2011 From: mark at atldes.com (Mark Barton) Date: Tue, 11 Oct 2011 06:33:06 -0400 Subject: [wxruby-users] having trouble show/hide bitmap in a sizer In-Reply-To: <4E93E856.9070802@gmx.net> References: <4E933B12.6000902@atldes.com> <4E93E856.9070802@gmx.net> Message-ID: <4E941B62.2000007@atldes.com> On 10/11/11 2:55 AM, Quintus wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Am 10.10.2011 20:36, schrieb Mark Barton: >> def make_firmware_check(parent) firmware_check_sizer = >> Wx::BoxSizer.new(Wx::HORIZONTAL) check_bm_firmware = >> Bitmap.new("images/check_icon.png", Wx::BITMAP_TYPE_ANY) >> @check_sb_firmware = Wx::StaticBitmap.new(parent, -1, >> check_bm_firmware) fw_text = Wx::StaticText.new(parent, >> ID_SERIAL_STATIC_TEXT, "FIRMWARE", Wx::DEFAULT_POSITION, >> Wx::DEFAULT_SIZE, 0, "") x_bm_firmware = >> Bitmap.new("images/x_icon.png", Wx::BITMAP_TYPE_ANY) @x_sb_firmware >> = Wx::StaticBitmap.new(parent, -1, x_bm_firmware) >> firmware_check_sizer.add(fw_text, 1, >> Wx::RIGHT|Wx::TOP|Wx::ALIGN_LEFT, 5) >> firmware_check_sizer.add(@check_sb_firmware, 0, Wx::ALIGN_CENTER, >> 3) firmware_check_sizer.add(@x_sb_firmware, 0, Wx::ALIGN_CENTER, >> 3) @check_sb_firmware.hide @x_sb_firmware.hide return >> firmware_check_sizer end > Do yourself a favour and include the Wx module in your scope so you > don't have to always write that annoying Wx::*. Second, you should > probably read this: http://wxruby.rubyforge.org/doc/wxruby_intro.html > There's no need to specify all that nasty default parameters for your > wxRuby code, so e.g. > >> fw_text = Wx::StaticText.new(parent, ID_SERIAL_STATIC_TEXT, >> "FIRMWARE", Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, 0, "") > becomes > >> fw_text = StaticText.new(parent, :id => ID_SERIAL_STATIC_TEXT, >> :label => "FIRMWARE") > And you may leave out the ":id => ID_SERIAL_STATIC_TEXT" as well, > because there's usually no reason to assign IDs manually to widgets. > Even for event handling you can usually just pass the control instance > into the event handler. > > Next, the Wx::StaticBitmap class isn't intended to draw normal images > (as weird as it sounds). Quote from the docs: > >> A static bitmap control displays a bitmap. It is meant for display >> of the small icons in the dialog boxes and is not meant to be a >> general purpose image display control. In particular, under Windows >> 9x the size of bitmap is limited to 64?64 pixels and thus you >> should use your own control if you want to display larger images >> portably. > Finally I'm not sure how sizers work with hidden controls. Your code > appears logically correct to me (although there are some stylistic > problems as I already pointed out), maybe you're running into an issue > I've experienced some time ago as well: Changing a control's contents > doesn't cause wxRuby to recalculate the sizer layout (in particular, > the issue I was running into was that I had a right-aligned StaticText > widget and the text could grow bigger and was then running out of the > window). I *think* it is possible to make wxRuby relayout the GUI by > calling Sizer#recalc_sizes, but I didn't try this (the original code > where I could have needed that has been removed already). > > Vale, > Marvin > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iQEcBAEBAgAGBQJOk+hNAAoJELh1XLHFkqhaJ8AH/3g1ZNLcAxF+jzOU1I2uwfFr > JwHQ50tL3dL8E9yTfheUpKH426DovnBXwLD47FrZNhtHaxDZY2WkiCRDvHqDi+b+ > E06WlbTBej3jPTSFEfH0Rm3XRmsua6aozZPHC9XaoNz2bXwxwwdsJiao7OtoJ5bP > 70s7DlsbaDnxoUPHi9R6izl2tLAB4P7VNi/HKMhy2m07PNDH7d5nzM+XfwUM3Gls > EbcCRNoNGM0+fh/aqYXo78nJ3rhorknhH7HvKfbZUZkuOpIl804yIQE1C4WO9XIj > WWPd9eTEfqR5YnaTNF7zlG2f9BZj/c26+/ndxqOt422vPBZEYLy4BXQgtKVQ83Y= > =2wH4 > -----END PGP SIGNATURE----- > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > Thanks Marvin for the helpful information. I think you have hit the nail on the head or at least very close. In my test I was changing the layout, sleeping , changing the layout and so forth without allowing WxRuby to complete its loop even though I was calling layout each time. The bitmap works as expected if I allow the loop to complete before making the next change. Again thanks for you help. Mark From mark at atldes.com Tue Oct 11 07:18:47 2011 From: mark at atldes.com (Mark Barton) Date: Tue, 11 Oct 2011 07:18:47 -0400 Subject: [wxruby-users] WxRuby refresh from a long running function In-Reply-To: References: <4E8DDB76.1040603@atldes.com> Message-ID: <4E942617.1050103@atldes.com> On 10/10/11 10:38 PM, David Beswick wrote: > Hi Mark! The answer in my experience is that > you'll have to spawn another ruby process and do > the processing normally done in the long-running > function there. Basically, you need to use > inter-process communication to do your > asynchronous processing instead of threads. > Unfortunately, this is unpleasant to do on > Windows because of Ruby's poor support for > spawning processes compared to Linux, but it can > be done and it'll give you a superior result to > any solution involving Ruby threads. > Thanks David, I will keep this in mind. In my case the solution is to rewrite some of the code as a state machine so as to allow the WxRuby loop to occasionally run. This should be fine as I am not really IO bound as much as there are some intentional processing delays that are required. Mark From alex at pressure.to Tue Oct 11 03:49:22 2011 From: alex at pressure.to (Alex Fenton) Date: Tue, 11 Oct 2011 08:49:22 +0100 Subject: [wxruby-users] having trouble show/hide bitmap in a sizer In-Reply-To: <4E933B12.6000902@atldes.com> References: <4E933B12.6000902@atldes.com> Message-ID: <4E93F502.7030308@pressure.to> On 10/10/11 19:36, Mark Barton wrote: > > This is the code I am using to initially setup the Static bitmap and > sizer. This is then added to a vertical box sizer containing a few > other controls. Lastly for a test, I simply show the appropriate image > as in @check_sb_firmware.show and @x_sb_firmware forthe other image. > The problem that I am seeing is the first time I show the image, the > image appears at the top of my panel, the second time I show the image > it is in the correct position, just after my text. Am I handling this > wrong or perhaps there is a better way? Just to check, you do call parent.sizer = firmware_check_sizer in the calling function to assign the BoxSizer to the panel? After hiding or deleting windows that are controlled by a sizer, you may need to call sizer.layout to re-assign the spacing correctly. alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at atldes.com Wed Oct 12 07:55:22 2011 From: mark at atldes.com (Mark Barton) Date: Wed, 12 Oct 2011 07:55:22 -0400 Subject: [wxruby-users] having trouble show/hide bitmap in a sizer In-Reply-To: <4E93F502.7030308@pressure.to> References: <4E933B12.6000902@atldes.com> <4E93F502.7030308@pressure.to> Message-ID: <4E95802A.7040906@atldes.com> On 10/11/11 3:49 AM, Alex Fenton wrote: > On 10/10/11 19:36, Mark Barton wrote: >> >> This is the code I am using to initially setup >> the Static bitmap and sizer. This is then added >> to a vertical box sizer containing a few other >> controls. Lastly for a test, I simply show the >> appropriate image as in @check_sb_firmware.show >> and @x_sb_firmware forthe other image. The >> problem that I am seeing is the first time I >> show the image, the image appears at the top of >> my panel, the second time I show the image it >> is in the correct position, just after my text. >> Am I handling this wrong or perhaps there is a >> better way? > > Just to check, you do call parent.sizer = > firmware_check_sizer in the calling function to > assign the BoxSizer to the panel? > > After hiding or deleting windows that are > controlled by a sizer, you may need to call > sizer.layout to re-assign the spacing correctly. > > alex > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users Hi Alex, Hummmm, well, what I have is two horizontal BoxSizers with the text and static bitmaps added to a vertical BoxSizer along with a couple other controls. This vertical sizer is added to the left side of a two column FlexGridSizer. The FlexGridSizer is attached to the panel with: main_panel.set_sizer(myFlexGridSizer) followed by a main_panel.layout. Currently I have only the bitmap initially hidden and this seem to work if I allow the app loop to complete after changing the layout. The puzzling part is it does not work if I also hide the text as well as the bitmap in my function. In this case, both the bitmaps and text appear at the top of the panel and are partially visible. Thanks Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at ruby-forum.com Wed Oct 12 12:42:54 2011 From: lists at ruby-forum.com (Eric B.) Date: Wed, 12 Oct 2011 18:42:54 +0200 Subject: [wxruby-users] XP and Windows 7 -- def() inside App#run block problem Message-ID: <4afbfb299c74db6e58bffddac6ade547@ruby-forum.com> When I run the following code, I expect a blank frame to open (which is what happens when the def block is left out of the code). Instead, the program exits immediately. ruby 1.9.2p290 (2011-07-09) [i386-mingw32] wxruby 2.0.1 OS: Microsoft Windows XP Professional 5.1.2600 #!/usr/bin/ruby -w require "wx" Wx::App.run do Wx::Frame.new(nil).show def cause_of_problem puts "This prevents the window from staying open, even though it is never run" end end A perhaps related issue involves errors such as uninitialized variable accesses inside of event loops in Windows 7 -- I get no error message (even with $stdout.sync = true); instead, the application just stops responding, which makes debugging impractical. Has anyone else seen similar problems, and is wxruby debugging more robust under Linux? Thanks, Eric -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Oct 19 04:24:56 2011 From: alex at pressure.to (Alex Fenton) Date: Wed, 19 Oct 2011 09:24:56 +0100 Subject: [wxruby-users] Packaging wxRuby fails In-Reply-To: <4E88CC7B.5050000@pressure.to> References: <4D779EDD.4090806@gmx.net> <103535ecce64256f7c8307c1fc5ccf1b@ruby-forum.com> <4DA160CE.30101@gmx.net> <4DC817F5.4050405@gmx.net> <4DC8480C.4090200@pressure.to> <4DC97389.4080709@gmx.net> <4E88CC7B.5050000@pressure.to> Message-ID: <4E9E8958.4070905@pressure.to> hello all - have now committed this patch - looks excellent and works fine on my main Ubuntu box (11.10). Thanks again and sorry to be slow - have just started a new job and moved hosts. We should look to release a bug-fix 2.0.2 soon - I have a little bit of time this weekend. There are some uncommitted patches I'd like to review at http://rubyforge.org/tracker/?atid=220&group_id=35&func=browse We had thought that we wouldn't add features to 2.0.x line, but I'd favour merging these given our slow (!) release schedule. Discussion welcome (preferably on wxruby-dev). best alex On 02/10/11 21:41, Alex Fenton wrote: > hi > > thanks very much for the research, summary and patch. I've just got > back from holiday, but will have a look at this later this week with a > view to merging. I'm using 11.04 so should be able to test directly. > > best alex > > On 01/10/11 10:22, David Beswick wrote: >> Hi everyone, an update on this problem and wxruby's gem and build >> troubles. I was just able to build wxruby and run bigdemo with the >> help of a propose d natty (11.04) fix for Ubuntu's apt wxwidgets >> package. This is great progress! As soon as the natty fix is >> released, binary gems might be ready to go again. >> >> To summarise the problems and their fixes so far: >> >> 1. Previously, running any wxruby app would cause a crash in pixman. >> This has possibly been narrowed down to a problem with mesa or opengl >> drivers and it affects many projects that link dynamically to >> wxwidgets as well as other gui toolkits. Excluding opengl support >> seems to fix this for wxruby. See >> https://bugs.launchpad.net/ubuntu/+source/pixman/+bug/756237 >> >> 2. An additional problem cropped up in Natty, and maybe other >> versions. The Xinerama library is in an unusual place in Ubuntu >> 64-bit. wxwidget's configure script can't find it and so it disables >> support for the wxDisplay class (as if --disable-display was given,) >> and this causes rake compile to fail because there's no definition of >> wxDisplay::ResetMode. There is an official proposed fix for this now, >> see >> https://bugs.launchpad.net/ubuntu/+source/wxwidgets2.8/+bug/828999, >> and follow the directions to get the fixed package. Please take a >> moment to verify the fix on the bug page, if you try it. >> >> 3. Just today, I discovered a problem with the wxruby rake files. The >> rake files exclude various classes from the build on linux, but the >> logic fails because code reads the array $excluded_classes in >> rakeunixish.rb before the array is actually set up at the bottom of >> rakeconfigure.rb. This causes link to fail because libgtk-media isn't >> present, and MediaCtrl should be excluded from the build. I added a >> class to wrap the functionality of extracting and testing for wx >> features, and it's implemented such that querying wx features should >> be insensitive to the order of different bits of code. Please apply >> the attached patch to fix this, let me know if you have problems with it. >> >> >> >> On Wed, May 11, 2011 at 3:19 AM, Quintus > > wrote: >> >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Am 09.05.2011 22:01, schrieb Alex Fenton: >> > On 09/05/11 17:36, Quintus wrote: >> >> Some progress seems to have been made, but wxRuby still >> doesn't run on >> >> any Ubuntu> Lucid. The bug at >> >> >> https://bugs.launchpad.net/ubuntu/+source/wxwidgets2.8/+bug/632984 has >> >> finally been fixed (for Oneiric), just to reveal another one >> (see my >> >> last comment on that bug) that still prevents the main bug at >> >> https://bugs.launchpad.net/ubuntu/+source/pixman/+bug/756237 >> to get >> >> flagged for Natty. >> > >> > thanks for the update - and thanks also for reporting on and >> documenting >> > the issues on the Ubuntu bugtracker. I was half-thinking of >> switching to >> > Fedora anyway before the next Ubuntu came out - maybe this will >> tip me >> > over. >> >> I think I already mentioned it, but it was exaktly wxRuby that >> was the >> final reason for me to switch from Ubuntu to Arch Linux. I really >> enjoy >> the rolling release model now--no way back. :-) >> >> However, Ubuntu is the most-widespread Linux distribution out there. >> It's not wise to drop support for it I think, because it would >> significantly state a contrast to the platform-indepentness >> wxRuby aims >> to provide. >> >> > Martin, I have been quite successful at deploying both 32 bit and >> > 64-bit >> > 10.04 installations of wxRuby. I had to go back to the 2.0.0 >> gem for >> > 64, but >> > it seems to work quite fine with our rather elaborate application. >> >> Ubuntu Lucid 64bit worked without a problem for me, even though I >> had to >> compile wxRuby 2.0.1 myself. It's just that wxRuby doesn't work >> on each >> and every Ubuntu *after* Lucid. >> >> And btw. my name is Marvin, note the v. :-) >> >> > Hi Don, on which distributions and versions of those distributions >> > were you >> > deploying your apps on? >> >> I can confirm wxRuby not working for Ubuntu Maverick 64bit, Ubuntu >> Maverick 32bit, Ubuntu Natty 32bit (the last to being virtual >> machines) >> and Arch Linux 64bit (completely updated last Friday)*. But I >> suppose it >> doesn't work for different reasons on each machine... :-( >> >> > Here's the bug that discussion references, in Debian: >> > >> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613221 >> >> Thanks! It really looks like a bug in pixman then. >> >> ########################### >> >> So, what can we do now? wxRuby's obviously not at fault, it's >> >> a) pixman that is broken and >> b) Debian/Ubuntu that ships broken wxWidgets packages >> >> b) is marked as fixed for Oneiric, but I doubt wheather wxRuby >> will run >> then, because of a) and a symbol lookup error I already described on >> Launchpad (this would be c) then I think). >> >> The pixman bug breaks wxRuby on nearly every recent Linux >> distribution, >> and Debian/Ubuntu breaks it a second time due to their package >> management, which is especially problementic because of their >> popularity. >> >> To conclude: I'm worried about wxRuby's future, although it seems >> that >> wxRuby can't do much about the mentioned problems. >> >> > best >> > alex >> >> Valete, >> Marvin >> >> * The distros I were using "normally", i.e. not as virtual machines, >> were like this: >> Ubuntu Lucid 64bit -> Ubuntu Maverick 64bit [broke wxRuby] -> >> Arch Linux >> 64bit >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.11 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ >> >> iQEcBAEBAgAGBQJNyXOBAAoJELh1XLHFkqhajpYIAK0/ZBrho5fd9fGaEkGGQbal >> +uwRxdavIldM38I8wolfIomPEZxTzupim+NPLigB1NHToUrSjhhCGkg482YuJR9u >> HMncfRInw5eK/rXo1xHwF213sY3bZtxy9EOG+lJ/qLCm6qrke5tAGBKLzsY62QtG >> v4KOXGNOyC+NEtdHFyPhancvwqrjfnyL/OjgUMku03saLq58vDZMiv1rAz++m69c >> RO5h6sIZ+ZHp4tVIKSMKjLYoyQrVfuNK/A0RJMdpnLlsz+oAiP36sS65wKEL1wB4 >> +F62p7Ow/yjgItqAeG2HgKRcJyKwRT9tXSK8M83dsxWk9hyJVubILa2dWpvsD70= >> =12Su >> -----END PGP SIGNATURE----- >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at pressure.to Thu Oct 20 15:27:53 2011 From: alex at pressure.to (Alex Fenton) Date: Thu, 20 Oct 2011 20:27:53 +0100 Subject: [wxruby-users] XP and Windows 7 -- def() inside App#run block problem In-Reply-To: <4afbfb299c74db6e58bffddac6ade547@ruby-forum.com> References: <4afbfb299c74db6e58bffddac6ade547@ruby-forum.com> Message-ID: <4EA07639.6000005@pressure.to> hi On 12/10/11 17:42, Eric B. wrote: > When I run the following code, I expect a blank frame to open (which is > what happens when the def block is left out of the code). Instead, the > program exits immediately. > > ruby 1.9.2p290 (2011-07-09) [i386-mingw32] > wxruby 2.0.1 > OS: Microsoft Windows XP Professional 5.1.2600 > > #!/usr/bin/ruby -w > > require "wx" > > Wx::App.run do > Wx::Frame.new(nil).show > > def cause_of_problem > puts "This prevents the window from staying open, even though it is > never run" > end > > end You need to return a true value from App.run block to signal that the app set up successfully and the GUI loop should begin. The return value of the 'def' is 'nil', which evaluates to false. Adding any true value after the def block will fix this. > A perhaps related issue involves errors such as uninitialized variable > accesses inside of event loops in Windows 7 -- I get no error message > (even with $stdout.sync = true); instead, the application just stops > responding, which makes debugging impractical. > > Has anyone else seen similar problems, and is wxruby debugging more > robust under Linux? I'm afraid I haven't used wxRuby on Windows 7, but on all the platforms I've used (Windows XP, Linux, OS X) I'd expect this kind of normal Ruby error to throw an exception and abort. alex From dlbeswick at gmail.com Thu Oct 20 16:51:55 2011 From: dlbeswick at gmail.com (David Beswick) Date: Fri, 21 Oct 2011 07:51:55 +1100 Subject: [wxruby-users] XP and Windows 7 -- def() inside App#run block problem In-Reply-To: <4EA07639.6000005@pressure.to> References: <4afbfb299c74db6e58bffddac6ade547@ruby-forum.com> <4EA07639.6000005@pressure.to> Message-ID: It's true that crashes in native code under Linux are much more helpful -- you get a backtrace into the native code. Under Windows in the past I've recompiled wxWidgets and wxRuby with debugging information, then have run ruby through the Visual Studio debugger to get this information, which is a pain. Maybe it would be possible to use Structured Exception Handling under Windows to catch exceptions such as null pointer accesses in wxruby code and provide more helpful information. David On Fri, Oct 21, 2011 at 6:27 AM, Alex Fenton wrote: > hi > > > On 12/10/11 17:42, Eric B. wrote: > >> When I run the following code, I expect a blank frame to open (which is >> what happens when the def block is left out of the code). Instead, the >> program exits immediately. >> >> ruby 1.9.2p290 (2011-07-09) [i386-mingw32] >> wxruby 2.0.1 >> OS: Microsoft Windows XP Professional 5.1.2600 >> >> #!/usr/bin/ruby -w >> >> require "wx" >> >> Wx::App.run do >> Wx::Frame.new(nil).show >> >> def cause_of_problem >> puts "This prevents the window from staying open, even though it is >> never run" >> end >> >> end >> > > You need to return a true value from App.run block to signal that the app > set up successfully and the GUI loop should begin. > > The return value of the 'def' is 'nil', which evaluates to false. Adding > any true value after the def block will fix this. > > > A perhaps related issue involves errors such as uninitialized variable >> accesses inside of event loops in Windows 7 -- I get no error message >> (even with $stdout.sync = true); instead, the application just stops >> responding, which makes debugging impractical. >> >> Has anyone else seen similar problems, and is wxruby debugging more >> robust under Linux? >> > > I'm afraid I haven't used wxRuby on Windows 7, but on all the platforms > I've used (Windows XP, Linux, OS X) I'd expect this kind of normal Ruby > error to throw an exception and abort. > > 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 lists at ruby-forum.com Wed Oct 26 22:44:58 2011 From: lists at ruby-forum.com (Fengfeng Li) Date: Thu, 27 Oct 2011 04:44:58 +0200 Subject: [wxruby-users] How to balance between GUI and Speed? In-Reply-To: References: <0fc5b6d0129c2fe9bc2df81b55897bee@ruby-forum.com> Message-ID: <3e2c7af7ac2b86297ba13742a0a5ff01@ruby-forum.com> Hi, Mario Steele wrote in post #999797: > Hello Fengfeng, > > I actually ran into similar issues that your running into. Which > prompted > me to create this library: http://repos.ruby-im.net/xprocess/ It will > allow > you to execute processes, as well as capture output, and send input to > the > sub-process, without blocking any of the Ruby Threads. The interface to > the > library is pretty simple. I don't have any docs for the library, but in > simplistic terms of an example: > > my_proc = XProcess.new(cmd) > my_proc.execute(my_args) > while my_proc.exists? do > Thread.pass() # Allow other threads to do their work while this > process > is working. > end > # Process has ended, we can parse output of my_proc through > my_proc.out.read_lines(), or various other IO methods. > > hth, > > Mario I ran setup.rb and some errors occured as below: ---> lib ---> lib/XProcess <--- lib/XProcess <--- lib ---> ext ---> ext/XProcess ---> ext/XProcess/io_peek C:/ruby/bin/ruby.exe D:/xprocess-79fffe13d20a/ext/XProcess/io_peek/extconf.rb checking for ruby.h... no *** D:/xprocess-79fffe13d20a/ext/XProcess/io_peek/extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=D:/xprocess-79fffe13d20a/ext/XProcess/io_peek --curdir --ruby=C:/ruby/bin/ruby --with-.-dir --without-.-dir --with-.-include --without-.-include=${.-dir}/include --with-.-lib --without-.-lib=${.-dir}/lib setup.rb:655:in `command': system("C:/ruby/bin/ruby.exe" "D:/xprocess-79fffe13d20a/ext/XProcess/io_peek/extconf.rb") failed (RuntimeError) from setup.rb:660:in `ruby' from setup.rb:1238:in `extconf' from setup.rb:1230:in `config_dir_ext' from setup.rb:1532:in `__send__' from setup.rb:1532:in `traverse' from setup.rb:1549:in `dive_into' from setup.rb:1530:in `traverse' from setup.rb:1534:in `traverse' from setup.rb:1533:in `each' from setup.rb:1533:in `traverse' from setup.rb:1549:in `dive_into' from setup.rb:1530:in `traverse' from setup.rb:1534:in `traverse' from setup.rb:1533:in `each' from setup.rb:1533:in `traverse' from setup.rb:1549:in `dive_into' from setup.rb:1530:in `traverse' from setup.rb:1524:in `exec_task_traverse' from setup.rb:1519:in `each' from setup.rb:1519:in `exec_task_traverse' from setup.rb:1223:in `exec_config' from setup.rb:991:in `exec_config' from setup.rb:812:in `invoke' from setup.rb:773:in `invoke' from setup.rb:1578 My enviroment is: Windows XP 32-BIT, ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]. Could you have a look at these? thank you. -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Thu Oct 27 06:13:20 2011 From: mario at ruby-im.net (Mario Steele) Date: Thu, 27 Oct 2011 06:13:20 -0400 Subject: [wxruby-users] How to balance between GUI and Speed? In-Reply-To: <3e2c7af7ac2b86297ba13742a0a5ff01@ruby-forum.com> References: <0fc5b6d0129c2fe9bc2df81b55897bee@ruby-forum.com> <3e2c7af7ac2b86297ba13742a0a5ff01@ruby-forum.com> Message-ID: Hello Fengfeng, The error your getting, is from the fact that extconf.rb can't find ruby.h. And given that your running from Windows XP, I'm guessing that your running the One Click Installer for it. You will however, need the Development Environment for the One Click Installer, in order to build the XProcess and various extensions used in making it work. The Development Environment can be found here: http://rubyforge.org/frs/download.php/66888/devkit-3.4.5r3-20091110.7z You will need a utility such as WinRar or 7zip to extract the files. hth, Mario On Wed, Oct 26, 2011 at 10:44 PM, Fengfeng Li wrote: > Hi, > > Mario Steele wrote in post #999797: > > Hello Fengfeng, > > > > I actually ran into similar issues that your running into. Which > > prompted > > me to create this library: http://repos.ruby-im.net/xprocess/ It will > > allow > > you to execute processes, as well as capture output, and send input to > > the > > sub-process, without blocking any of the Ruby Threads. The interface to > > the > > library is pretty simple. I don't have any docs for the library, but in > > simplistic terms of an example: > > > > my_proc = XProcess.new(cmd) > > my_proc.execute(my_args) > > while my_proc.exists? do > > Thread.pass() # Allow other threads to do their work while this > > process > > is working. > > end > > # Process has ended, we can parse output of my_proc through > > my_proc.out.read_lines(), or various other IO methods. > > > > hth, > > > > Mario > > I ran setup.rb and some errors occured as below: > > ---> lib > ---> lib/XProcess > <--- lib/XProcess > <--- lib > ---> ext > ---> ext/XProcess > ---> ext/XProcess/io_peek > C:/ruby/bin/ruby.exe > D:/xprocess-79fffe13d20a/ext/XProcess/io_peek/extconf.rb > checking for ruby.h... no > *** D:/xprocess-79fffe13d20a/ext/XProcess/io_peek/extconf.rb failed *** > Could not create Makefile due to some reason, probably lack of > necessary libraries and/or headers. Check the mkmf.log file for more > details. You may need configuration options. > > Provided configuration options: > --with-opt-dir > --without-opt-dir > --with-opt-include > --without-opt-include=${opt-dir}/include > --with-opt-lib > --without-opt-lib=${opt-dir}/lib > --with-make-prog > --without-make-prog > --srcdir=D:/xprocess-79fffe13d20a/ext/XProcess/io_peek > --curdir > --ruby=C:/ruby/bin/ruby > --with-.-dir > --without-.-dir > --with-.-include > --without-.-include=${.-dir}/include > --with-.-lib > --without-.-lib=${.-dir}/lib > setup.rb:655:in `command': system("C:/ruby/bin/ruby.exe" > "D:/xprocess-79fffe13d20a/ext/XProcess/io_peek/extconf.rb") failed > (RuntimeError) > from setup.rb:660:in `ruby' > from setup.rb:1238:in `extconf' > from setup.rb:1230:in `config_dir_ext' > from setup.rb:1532:in `__send__' > from setup.rb:1532:in `traverse' > from setup.rb:1549:in `dive_into' > from setup.rb:1530:in `traverse' > from setup.rb:1534:in `traverse' > from setup.rb:1533:in `each' > from setup.rb:1533:in `traverse' > from setup.rb:1549:in `dive_into' > from setup.rb:1530:in `traverse' > from setup.rb:1534:in `traverse' > from setup.rb:1533:in `each' > from setup.rb:1533:in `traverse' > from setup.rb:1549:in `dive_into' > from setup.rb:1530:in `traverse' > from setup.rb:1524:in `exec_task_traverse' > from setup.rb:1519:in `each' > from setup.rb:1519:in `exec_task_traverse' > from setup.rb:1223:in `exec_config' > from setup.rb:991:in `exec_config' > from setup.rb:812:in `invoke' > from setup.rb:773:in `invoke' > from setup.rb:1578 > > My enviroment is: Windows XP 32-BIT, ruby 1.8.7 (2011-02-18 patchlevel > 334) [i386-mingw32]. > Could you have a look at these? thank you. > > -- > 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 Captain 3rd CO - Geo 99 CO - USS T'hy'la XO - Diplomatic Corps - Second Life http://www.iftcommand.com/chapters/thyla/ http://www.trekfederation.com http://geo99.ruby-im.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From alejandro.riedel at gmail.com Sat Oct 29 22:06:29 2011 From: alejandro.riedel at gmail.com (Alejandro Riedel) Date: Sat, 29 Oct 2011 23:06:29 -0300 Subject: [wxruby-users] ERROR - libwx_gtk2u_media-2.8.so.0: cannot open shared object file Message-ID: Hi all, I've been working with wxruby for a while with an Ubuntu 10.04 environment mounted with VMWare over Windows. Now, I'm trying to set it up in a new environment. It's Ubuntu 11.04, using RVM with both ruby 1.8.7 and 1.9.2 installed. I installed wxruby and wxruby-ruby19 accordingly within corresponding gemsets. Now, when I try to launch an app that works in my old environment I'm getting this error... *>.../custom_require.rb:36:in `require': libwx_gtk2u_media-2.8.so.0: cannot open shared object file* I tried installing the libraries related to wxGTK but they were already installed and updated... $sudo apt-get install libwxgtk2.8-dev >libwxgtk2.8-dev is already the newest version. $sudo apt-get install libwxgtk2.8-0 >libwxgtk2.8-0 is already the newest version. How can I solve this? I don't know if it helps but I installed both wxruby versions using 'gem install' command... Thanks in advance, Alex *ALEJANDRO RIEDEL** * *LinkedIn - github - Blog - twitter * -------------- next part -------------- An HTML attachment was scrubbed... URL: From sutniuq at gmx.net Sun Oct 30 05:32:19 2011 From: sutniuq at gmx.net (Quintus) Date: Sun, 30 Oct 2011 10:32:19 +0100 Subject: [wxruby-users] ERROR - libwx_gtk2u_media-2.8.so.0: cannot open shared object file In-Reply-To: References: Message-ID: <4EAD19A3.7030501@gmx.net> Am 30.10.2011 03:06, schrieb Alejandro Riedel: > Hi all, Hi Alejandro, > Now, I'm trying to set it up in a new environment. It's Ubuntu 11.04, > using RVM with both ruby 1.8.7 and 1.9.2 installed. > Now, when I try to launch an app that works in my old environment I'm > getting this error... > > />.../custom_require.rb:36:in `require': libwx_gtk2u_media-2.8.so.0: > cannot open shared object file/ It's a known problem with Ubuntu Maverick and Natty. They removed the media library you're missing from wxWidgets -- and there's no way to install it separately besides compiling wxWidgets yourself. See this bug, which is fixed in Ubuntu Oneiric: https://bugs.launchpad.net/ubuntu/+source/wxwidgets2.8/+bug/632984 And don't try to compile wxWidgets yourself, you'll run straight into a bug in pixman which causes wxRuby to crash: https://bugs.launchpad.net/ubuntu/+source/pixman/+bug/756237 > I tried installing the libraries related towxGTK but they were already > installed and updated... > > $sudo apt-get install libwxgtk2.8-dev > >libwxgtk2.8-dev is already the newest version. > $sudo apt-get install libwxgtk2.8-0 > >libwxgtk2.8-0 is already the newest version. > > How can I solve this? Upgrade to Oneiric and hope both bugs are gone. As the first one is officially marked as "fixed" it should be; the second one *may* be, because on my Arch Linux system, which uses pixman 0.22.2, that bug is gone as well. But I don't know wheather that pixman made it into Ubuntu Oneiric or if the version was published after the feature freeze. Finally, there has been a lengthy discussion along wxRuby devs and users here: http://www.ruby-forum.com/topic/1246679 Vale, Marvin