From jacekwiktor at gmail.com Sat Mar 1 06:48:56 2008 From: jacekwiktor at gmail.com (Jacek Nowak) Date: Sat, 1 Mar 2008 12:48:56 +0100 Subject: [wxruby-users] A bug in wxRuby. Segmentation fault in random situations. In-Reply-To: <47C8BAEF.5010500@pressure.to> References: <570d9b010802170815p2750966br89e5d65ce70584f3@mail.gmail.com> <47BA27CA.4000108@pressure.to> <570d9b010802190319r3cb8cfc7gc9bfdf4b51e5bef2@mail.gmail.com> <47BAC628.7060409@pressure.to> <570d9b010802190717x78573832j58331e50fb953a8e@mail.gmail.com> <47BBDA8B.7080906@pressure.to> <570d9b010802281007u18d4d81ap7cbb33299e99ec7c@mail.gmail.com> <47C8BAEF.5010500@pressure.to> Message-ID: <570d9b010803010348w225336e3s672e301b78a00894@mail.gmail.com> Hi Alex, Thanks for all your help. I am trying to compile the latest source from svn. When I run "rake" everything seems to compile well but after 2 or 3 minutes I get the following error: GLCanvas.cpp .\src/GLCanvas.h(19) : error C2504: 'wxGLCanvas' : base class undefined .\src/GLCanvas.h(23) : error C2629: unexpected 'class SwigDirector_wxGLCanvas (' .\src/GLCanvas.h(23) : error C2238: unexpected token(s) preceding ';' .\src/GLCanvas.h(24) : error C2629: unexpected 'class SwigDirector_wxGLCanvas (' .\src/GLCanvas.h(24) : error C2238: unexpected token(s) preceding ';' src/GLCanvas.cpp(2393) : error C2614: 'SwigDirector_wxGLCanvas' : illegal member initialization: 'wxGLCanvas' is not a base or member src/GLCanvas.cpp(2399) : error C2061: syntax error : identifier 'wxGLCanvas' src/GLCanvas.cpp(2399) : error C2511: 'SwigDirector_wxGLCanvas::SwigDirector_wxGLCanvas' : overloaded member function 'void (unsigned long,class wxWindow *)' not found in 'SwigDirector_wxGLCanvas' .\src/GLCanvas.h(19) : see declaration of 'SwigDirector_wxGLCanvas' src/GLCanvas.cpp(4019) : fatal error C1004: unexpected end of file found I downloaded the latest source from svn. I am using: wxWidgets 2.8.7 swigwin-1.3.34 rake-0.8.1 windows xp sp2 msvc++ 6.0 (btw - in the wiki : http://wxruby.rubyforge.org/wiki/wiki.pl?InstallingFromSource it is written that I should use swig-1.3.31 but when I tried to compile with this version rake gave me an error that I should use 1.3.34) -- Jacek Nowak jacekwiktor at gmail.com From alex at pressure.to Sat Mar 1 07:37:37 2008 From: alex at pressure.to (Alex Fenton) Date: Sat, 01 Mar 2008 12:37:37 +0000 Subject: [wxruby-users] A bug in wxRuby. Segmentation fault in random situations. In-Reply-To: <570d9b010803010348w225336e3s672e301b78a00894@mail.gmail.com> References: <570d9b010802170815p2750966br89e5d65ce70584f3@mail.gmail.com> <47BA27CA.4000108@pressure.to> <570d9b010802190319r3cb8cfc7gc9bfdf4b51e5bef2@mail.gmail.com> <47BAC628.7060409@pressure.to> <570d9b010802190717x78573832j58331e50fb953a8e@mail.gmail.com> <47BBDA8B.7080906@pressure.to> <570d9b010802281007u18d4d81ap7cbb33299e99ec7c@mail.gmail.com> <47C8BAEF.5010500@pressure.to> <570d9b010803010348w225336e3s672e301b78a00894@mail.gmail.com> Message-ID: <47C94E11.3000408@pressure.to> Hi Jacek Jacek Nowak wrote: > I am trying to compile the latest source from svn. > When I run "rake" everything seems to compile well but after 2 or 3 > minutes I get the following error: > > GLCanvas.cpp > .\src/GLCanvas.h(19) : error C2504: 'wxGLCanvas' : base class undefined > I've always skipped GLCanvas on my Windows build, so I don't know exactly what's up. I'm guessing some missing library i.e. opengl. Sean makes the release windows build so may have some ideas. If you don't need GLCanvas, probably easiest just to avoid it. Method 1) This should force wxRuby to skip this class, but you'll need to remember this argument every time, or set an environment variable. Delete src/GLCanvas.cpp then build wxRuby with: rake WXRUBY_EXCLUDED=GLCanvas Method 2) Rebuild wxWidgets without the USE_OPENGL argument to nmake. Then wxRuby should notice that class isn't supported and skip it. > (btw - in the wiki : > http://wxruby.rubyforge.org/wiki/wiki.pl?InstallingFromSource it is > written that I should use swig-1.3.31 but when I tried to compile with > this version rake gave me an error that I should use 1.3.34) > > Yeah, we upgraded to the latest SWIG releases in the dev cycle as they have ruby fixes pertinent to wxRuby. The code was already checking, but I've updated the wiki to reflect this. Thanks alex From mario at ruby-im.net Sat Mar 1 10:11:38 2008 From: mario at ruby-im.net (Mario Steele) Date: Sat, 1 Mar 2008 09:11:38 -0600 Subject: [wxruby-users] wxRIDE Finally Available Message-ID: Hello fellow wxRuby users, Well, after a long period in which I originally announced that I was creating an IDE, I have finally become satisfied enough to release a SVN Version of wxRIDE. I started the project out, and in cases where I couldn't launch the application again, I utilized SciTE (Which uses Scintilla, same as wxRIDE), outside of that initial part, and subsequent failures to start, wxRIDE was created and modified with itself. (Basically, I used wxRIDE to write wxRIDE, as I progressed.) Now, keep in mind, that this version is a very very very very alpha version of the editor, so if things blow up, and you loose hours of work, don't blame me! Save your files, and save them very very often. Currently, here's a list of features that are currently implemented in wxRIDE. * Implements AUI demo to build the core interface for wxRIDE. * Implements Scintilla through StyledTextCtrl. Further syntax highlighting needed, as Ruby is the only language currently implemented. * Workspace Sidebar, to view files currently not associated to a project, and those that are associated to a project (Project handling not implemented yet), as well as a Filesystem Browser to browse files on your computer, without having to utilize the Open Dialog, and a non-functional Object Space to explore what classes and methods are being defined within Ruby source code. * All basic editing functions, Cut/Copy/Paste/Find/Replace/multi-line (de-)indentation, Code Folding, etc, etc * Help File Viewer for wxRuby documentation (No documentation yet for wxRIDE itself, and Help File Viewer subject to changes) * Execution of Ruby Scripts, with capturing of output to a nice little window within the IDE! Capturing of output of other applications not implemented yet. * Catching of errors that wxRIDE runs into itself within it's code. Right now, wxError.rb creates a dialog to show the user, but sometimes it cannot execute for some reason (Work needing there), but the error file wxRIDE.erris still generated within the wxRIDE Directory, so you can review it to see what has gone wrong. * Saving of Size, position, maximize/minimize state, panels open/closed in the AUI manager, as well as the default Home Page in the Notebook What is still needed to be done: As noted above, capture of output from other non-ruby programs, Project handling, etc, etc Replacement Graphics for various icons, and default actions. (Anyone want to volunteer?) Creation of a RAD component to generate complete GUI's (Also, anyone want to help out?) So far, this has only been tested on Windows, and Linux, as I have no mac around here (Hint Hint Sean and Alex), so I need testing on MacOS X, to see how well I programmed this to be cross-platform. To check out this new bleeding edge software, hook up your faviorate SVN checkout tool, and check out svn://rubyforge.org/var/svn/wxride/trunk or http://wxride.rubyforge.org/svn/trunk/. Suggestions, Help, Comments, whatever are much appreciated! L8ers, -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080301/946c425a/attachment-0001.html From mario at ruby-im.net Sat Mar 1 10:15:50 2008 From: mario at ruby-im.net (Mario Steele) Date: Sat, 1 Mar 2008 09:15:50 -0600 Subject: [wxruby-users] wxRIDE Finally Available In-Reply-To: References: Message-ID: Hey all, Forgot one little side note. MacOS X and Linux users shouldn't have to worry about this, but on Windows, I utilize win32/open3 in order to execute the process separately, instead of relying on popen to be available within Ruby itself. So until I have something setup to detect if win32/open3 to be installed, you will need to install this extension in order to use. You can grab it by bringing up a command prompt, and typing in gem install win32-open3, or visiting http://rubyforge.org/projects/win32utils L8ers all, On 3/1/08, Mario Steele wrote: > > Hello fellow wxRuby users, > > Well, after a long period in which I originally announced that I was > creating an IDE, I have finally become satisfied enough to release a SVN > Version of wxRIDE. I started the project out, and in cases where I couldn't > launch the application again, I utilized SciTE (Which uses Scintilla, same > as wxRIDE), outside of that initial part, and subsequent failures to start, > wxRIDE was created and modified with itself. (Basically, I used wxRIDE to > write wxRIDE, as I progressed.) > > Now, keep in mind, that this version is a very very very very alpha > version of the editor, so if things blow up, and you loose hours of work, > don't blame me! Save your files, and save them very very often. Currently, > here's a list of features that are currently implemented in wxRIDE. > > * Implements AUI demo to build the core interface for wxRIDE. > * Implements Scintilla through StyledTextCtrl. Further syntax > highlighting needed, as Ruby is the only language currently implemented. > * Workspace Sidebar, to view files currently not associated to a project, > and those that are associated to a project (Project handling not implemented > yet), as well as a Filesystem Browser to browse files on your computer, > without having to utilize the Open Dialog, and a non-functional Object Space > to explore what classes and methods are being defined within Ruby source > code. > * All basic editing functions, Cut/Copy/Paste/Find/Replace/multi-line > (de-)indentation, Code Folding, etc, etc > * Help File Viewer for wxRuby documentation (No documentation yet for > wxRIDE itself, and Help File Viewer subject to changes) > * Execution of Ruby Scripts, with capturing of output to a nice little > window within the IDE! Capturing of output of other applications not > implemented yet. > * Catching of errors that wxRIDE runs into itself within it's code. Right > now, wxError.rb creates a dialog to show the user, but sometimes it cannot > execute for some reason (Work needing there), but the error file > wxRIDE.err is still generated within the wxRIDE Directory, so you can > review it to see what has gone wrong. > * Saving of Size, position, maximize/minimize state, panels open/closed in > the AUI manager, as well as the default Home Page in the Notebook > > What is still needed to be done: > > As noted above, capture of output from other non-ruby programs, Project > handling, etc, etc > Replacement Graphics for various icons, and default actions. (Anyone want > to volunteer?) > Creation of a RAD component to generate complete GUI's (Also, anyone want > to help out?) > > So far, this has only been tested on Windows, and Linux, as I have no mac > around here (Hint Hint Sean and Alex), so I need testing on MacOS X, to see > how well I programmed this to be cross-platform. To check out this new > bleeding edge software, hook up your faviorate SVN checkout tool, and check > out svn://rubyforge.org/var/svn/wxride/trunk or > http://wxride.rubyforge.org/svn/trunk/. > > Suggestions, Help, Comments, whatever are much appreciated! > > L8ers, > > -- > Mario Steele > http://www.trilake.net > http://www.ruby-im.net > http://rubyforge.org/projects/wxruby/ > http://rubyforge.org/projects/wxride/ > http://rubyforge.org/projects/vwmc/ -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080301/b145e2a1/attachment.html From alec at arlross.demon.co.uk Sat Mar 1 12:28:29 2008 From: alec at arlross.demon.co.uk (Alec Ross) Date: Sat, 1 Mar 2008 17:28:29 +0000 Subject: [wxruby-users] wxRIDE Finally Available In-Reply-To: References: Message-ID: > Hello fellow wxRuby users, > > Well, after a long period in which I originally announced that I was > creating an IDE, I have finally become satisfied enough to release a SVN > Version of wxRIDE. Many thanks. ... > What is still needed to be done: ... > Creation of a RAD component to generate complete GUI's (Also, anyone > want to help out?) Can it / will it be able to import and use XRC produced by other tools? Alec -- Alec Ross From jacekwiktor at gmail.com Sat Mar 1 13:01:32 2008 From: jacekwiktor at gmail.com (Jacek Nowak) Date: Sat, 1 Mar 2008 19:01:32 +0100 Subject: [wxruby-users] A bug in wxRuby. Segmentation fault in random situations. In-Reply-To: <47C94E11.3000408@pressure.to> References: <570d9b010802170815p2750966br89e5d65ce70584f3@mail.gmail.com> <47BA27CA.4000108@pressure.to> <570d9b010802190319r3cb8cfc7gc9bfdf4b51e5bef2@mail.gmail.com> <47BAC628.7060409@pressure.to> <570d9b010802190717x78573832j58331e50fb953a8e@mail.gmail.com> <47BBDA8B.7080906@pressure.to> <570d9b010802281007u18d4d81ap7cbb33299e99ec7c@mail.gmail.com> <47C8BAEF.5010500@pressure.to> <570d9b010803010348w225336e3s672e301b78a00894@mail.gmail.com> <47C94E11.3000408@pressure.to> Message-ID: <570d9b010803011001l179dbd0asb6870437847301ed@mail.gmail.com> Hi! I installed the latest version from svn and there are no crashes anymore! :) I have tested my app extensively with gc_stress and now it works fine. Thanks a lot to Alex and Mario for your support and to all developers of wxruby for all your work. You are doing a really great job! Wxruby is very nice, definitely the best solution for writing GUI apps in ruby. I am expecting with impatience a stable 2.0 release. I hope there are aren't many bugs left. So I will continue writing my app in wxruby, if I find any more problems I will let you know. -- Jacek Nowak jacekwiktor at gmail.com From mario at ruby-im.net Sat Mar 1 22:12:42 2008 From: mario at ruby-im.net (Mario Steele) Date: Sat, 1 Mar 2008 21:12:42 -0600 Subject: [wxruby-users] wxRIDE Finally Available In-Reply-To: References: Message-ID: On 3/1/08, Alec Ross wrote: > > > Many thanks. Your welcome. Can it / will it be able to import and use XRC produced by other tools? If you are refering to the RAD Tool, XRC Import will be available. But I have yet to start the actual initial design of the RAD Tool for it. My first goal, is to get Project Handling, Preferences, and Syntax Highlighting for other languages in first, as well as proabbly improving the code base, getting things straighten around, and concurrent. So bare with me on that. I've added Sean Lindsay as a developer as well, so he will be helping me out with wxRIDE. I'm hopeful that people will find it interesting, and worthwhile, so that I can continue to progress the project further, and out beat other IDE's that are currently out there for Ruby. But I'm always ambitious like that. LOL Anyways, More comments, and suggestions always welcome! L8ers, -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080301/83b84c40/attachment.html From lists at ruby-forum.com Sun Mar 2 10:26:48 2008 From: lists at ruby-forum.com (Tim Ferrell) Date: Sun, 2 Mar 2008 16:26:48 +0100 Subject: [wxruby-users] Thread code questions In-Reply-To: <5b3f85312e7ecfe56b4a9eff0b6b86c1@ruby-forum.com> References: <618d7e63e2c50ced538d0be2c1034b30@ruby-forum.com> <71e9fa0e205b3fc18cbd8510e2be02d6@ruby-forum.com> <3c12d9b081e028f0cf6a8eba5c7b72e4@ruby-forum.com> <47BA2A42.2010908@pressure.to> <87f254451e2b19547ca72ddea5b537fd@ruby-forum.com> <47C2A5FF.1010900@pressure.to> <800ff042b40806f330a946e2e8becf02@ruby-forum.com> <47C68E87.3010507@pressure.to> <9d45b60f13b52bc7945a09f99c053b03@ruby-forum.com> <47C6FA3E.8040107@pressure.to> <337de74230338e6d814671364584bbec@ruby-forum.com> <47C72467.1070406@pressure.to> <47C7443C.6050309@pressure.to> <47C7C8A0.120.37C8EBA6@dirk.traulsen.lypso.de> <47C7C280.7000000@pressure.to> <5b3f85312e7ecfe56b4a9eff0b6b86c1@ruby-forum.com> Message-ID: <0f2447e34e3076ec8c9b9ed7b52f0c58@ruby-forum.com> Well, all is working fine now with a few tweaks... so consider this a followup with a small question :-) I ended up with a situation where the worker thread was not getting enough time (i.e. downloads were very slow) with the initial approach of using a timer to call Thread.pass every 10ms and, I noticed a slight improvement as I lowered that down (eventually) to every 1ms... but this still downloaded considerably slower than the "thread-less" console version I started from. In an attempt to address this, I did away with the timer calling Thread.pass and elected instead to add a Thread#join(limit) call just after the progress bar status is updated, like so: # Test the state of the queue and worker progress protected def monitor_queue if not @worker # start queue @dialog.show process_queue_item(@current_item) elsif @worker and @current_item < @queue.size - 1 finish(@worker.status, @worker[:tmpfile]) if @dialog.cancelled # still running? if @worker.status # update progress bar @dialog.progress_item.value = @worker[:progress] @worker.join(0.095) # << this is what I added else # start next process_queue_item(@current_item += 1) end else finish(@worker.status, @worker[:tmpfile]) end end As I understand it, the limit parameter gives the Thread a certain amount of time to work (in this case 95ms) before resuming the normal scheduling behavior ... the end result in this case seems to be a better balance between ui responsiveness and thread activity for this particular app. My question: since this is my first use of Thread with wx, does anyone see any potential pitfalls I may have overlooked? I did notice in testing that the Wx::Timer resolution seemed to vary significantly from platform to platform (as the docs suggested would be the case) so I suppose that there could be a bit of contention between the Thread.join call and successive calls to the monitor_queue method... Would there be any harm in wrapping the Thread.join call with some kind of flag to tell monitor_queue to skip over its normal processing if the worker thread is currently joined? # Test the state of the queue and worker progress protected def monitor_queue if not @working if not @worker # start queue @dialog.show process_queue_item(@current_item) elsif @worker and @current_item < @queue.size - 1 finish(@worker.status, @worker[:tmpfile]) if @dialog.cancelled # still running? if @worker.status # update progress bar @dialog.progress_item.value = @worker[:progress] @working = true @worker.join(0.095) @working = false else # start next process_queue_item(@current_item += 1) end else finish(@worker.status, @worker[:tmpfile]) end end end Thanks for any feedback... Cheers, Tim -- Posted via http://www.ruby-forum.com/. From bureaux.sebastien at neuf.fr Mon Mar 3 12:12:50 2008 From: bureaux.sebastien at neuf.fr (sebastien) Date: Mon, 3 Mar 2008 18:12:50 +0100 Subject: [wxruby-users] processus Message-ID: <000701c87d51$d1a25980$0201a8c0@sebastien> Salut Alex. Peut tu me conseiller pour que je puisse renomer le processus et changer la priorit? de mon application. merci. sebastien http://beusse.liveror.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080303/7273ccf4/attachment-0001.html From alex at pressure.to Mon Mar 3 15:40:44 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 03 Mar 2008 20:40:44 +0000 Subject: [wxruby-users] Thread code questions In-Reply-To: <0f2447e34e3076ec8c9b9ed7b52f0c58@ruby-forum.com> References: <618d7e63e2c50ced538d0be2c1034b30@ruby-forum.com> <71e9fa0e205b3fc18cbd8510e2be02d6@ruby-forum.com> <3c12d9b081e028f0cf6a8eba5c7b72e4@ruby-forum.com> <47BA2A42.2010908@pressure.to> <87f254451e2b19547ca72ddea5b537fd@ruby-forum.com> <47C2A5FF.1010900@pressure.to> <800ff042b40806f330a946e2e8becf02@ruby-forum.com> <47C68E87.3010507@pressure.to> <9d45b60f13b52bc7945a09f99c053b03@ruby-forum.com> <47C6FA3E.8040107@pressure.to> <337de74230338e6d814671364584bbec@ruby-forum.com> <47C72467.1070406@pressure.to> <47C7443C.6050309@pressure.to> <47C7C8A0.120.37C8EBA6@dirk.traulsen.lypso.de> <47C7C280.7000000@pressure.to> <5b3f85312e7ecfe56b4a9eff0b6b86c1@ruby-forum.com> <0f2447e34e3076ec8c9b9ed7b52f0c58@ruby-forum.com> Message-ID: <47CC624C.7050406@pressure.to> Tim Ferrell wrote: > @worker.join(0.095) # << this is what I added > > ... > As I understand it, the limit parameter gives the Thread a certain > amount of time to work (in this case 95ms) before resuming the normal > scheduling behavior ... the end result in this case seems to be a better > balance between ui responsiveness and thread activity for this > particular app. > Interesting, I've never used this parameter ebefore. > My question: since this is my first use of Thread with wx, does anyone > see any potential pitfalls I may have overlooked? > None that I can see. Overall I think experience with Threads + wxRuby so it's mainly a case of trying to see what works across platforms. Thanks for keeping us posted on your findings. > Would there be any harm in wrapping the Thread.join call with some kind > of flag to tell monitor_queue to skip over its normal processing if the > worker thread is currently joined? > Not that I can see. I'm not sure it would ever reach that point - would the main thread start running again until the limit expires? cheers alex From lists at ruby-forum.com Mon Mar 3 15:57:55 2008 From: lists at ruby-forum.com (Tim Ferrell) Date: Mon, 3 Mar 2008 21:57:55 +0100 Subject: [wxruby-users] Thread code questions In-Reply-To: <47CC624C.7050406@pressure.to> References: <618d7e63e2c50ced538d0be2c1034b30@ruby-forum.com> <71e9fa0e205b3fc18cbd8510e2be02d6@ruby-forum.com> <3c12d9b081e028f0cf6a8eba5c7b72e4@ruby-forum.com> <47BA2A42.2010908@pressure.to> <87f254451e2b19547ca72ddea5b537fd@ruby-forum.com> <47C2A5FF.1010900@pressure.to> <800ff042b40806f330a946e2e8becf02@ruby-forum.com> <47C68E87.3010507@pressure.to> <9d45b60f13b52bc7945a09f99c053b03@ruby-forum.com> <47C6FA3E.8040107@pressure.to> <337de74230338e6d814671364584bbec@ruby-forum.com> <47C72467.1070406@pressure.to> <47C7443C.6050309@pressure.to> <47C7C8A0.120.37C8EBA6@dirk.traulsen.lypso.de> <47C7C280.7000000@pressure.to> <5b3f85312e7ecfe56b4a9eff0b6b86c1@ruby-forum.com> <0f2447e34e3076ec8c9b9ed7b52f0c58@ruby-forum.com> <47CC624C.7050406@pressure.to> Message-ID: Alex Fenton wrote: > Interesting, I've never used this parameter ebefore. Me either :-) It does seem to work, though, joining for the amount of time specified... This gave me a little more flexibility to time things in such a way that the ui generally stays responsive while still letting the download thread have some undivided time to work... Downloads are much faster for me this way... they do still feel a little bit throttled but overall it feels like a better balance so I am happy for now... although I may try adjusting the timer/limit to smaller increments and see how that affects ui responsiveness and download speeds... :-) >> Would there be any harm in wrapping the Thread.join call with some kind >> of flag to tell monitor_queue to skip over its normal processing if the >> worker thread is currently joined? >> > Not that I can see. I'm not sure it would ever reach that point - would > the main thread start running again until the limit expires? Well, maybe I'm off the mark here but I was thinking that the Timer would fire the monitor-queue method call every 100ms regardless of the status of the joined thread and that, as such, it might end up calling the method while a previous invocation was still active... I may be overthinking it though! I have not yet had much exposure to Ruby's threads... :-) Cheers, Tim -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Mon Mar 3 19:01:50 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 04 Mar 2008 00:01:50 +0000 Subject: [wxruby-users] processus In-Reply-To: <000701c87d51$d1a25980$0201a8c0@sebastien> References: <000701c87d51$d1a25980$0201a8c0@sebastien> Message-ID: <47CC916E.2010406@pressure.to> Salut sebastien wrote: > Peut tu me conseiller pour que je puisse renomer le processus [Could you tell me how to rename a process] Je souhaitais faire ?a, mais je ne sais pas comment avec Windows, sauf par copier et renommer ruby.exe [I've wanted to do that, but I don't know how on Windows apart from copying and renaming ruby.exe] > et changer la priorit? de mon application. http://www.ruby-doc.org/core/classes/Process.html#M003197 Je ne suis jamais me servi de cette methode; tu pourrais chercher l'aide sur une groupe generale de Ruby en fran?ais. [Use Process.setpriority - I haven't used this method so you could look for help in a general ruby group] cheers alex From bureaux.sebastien at neuf.fr Tue Mar 4 13:05:13 2008 From: bureaux.sebastien at neuf.fr (sebastien) Date: Tue, 4 Mar 2008 19:05:13 +0100 Subject: [wxruby-users] processus Message-ID: <000501c87e22$4c209250$0201a8c0@sebastien> Salut Alex. J'avait d?j? tester ce que tu ma conseiller pour changer la priorit? de mon application, mais ?a ne marche pas. Voil? le message d'erreur que j'obtient par exemple: "uninitialized constant Process::PRIO_USER (NameError)" Apparement ?a ne marche pas sur windows??? sebastien http://beusse.liveror.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080304/5f435849/attachment.html From mario at ruby-im.net Tue Mar 4 16:08:53 2008 From: mario at ruby-im.net (Mario Steele) Date: Tue, 4 Mar 2008 15:08:53 -0600 Subject: [wxruby-users] wxruby effect like fxshutter In-Reply-To: <47C2A757.5000308@pressure.to> References: <4656ef5f9f162c23848a7012ec463571@ruby-forum.com> <47C2A757.5000308@pressure.to> Message-ID: Hey guys, Well, I got some time to put something simple together. Fortunatly Alex, it's not a fully attached type of deal, as looking at the original Fox example, it's just like utilizing Wx::Notebook. What I've done, is a simple bit of code, that works similar to how FXShutter works, except for a few differences. One, it's wxRuby, not Fox, so keep that in mind, but the basics of it, are these: shutter.rb Creates the class Wx::Shutter It has three Methods within it: Wx::Shutter.new(parent,id) Creates a New Shutter Object. Wx::Shutter#add_header(title) Creates a New Header Button, which will toggle the associated list of items with it. Returns the instance of Wx::Button used. Wx::Shutter#add_item(header,text,icon=NullBitmap) Add's a new item to the Header in question (Using the returned Wx::Button). There is a Custom event created for notifying the programmer of when an item has been selected within the headings. ShutterEvent ShutterEvent#header Returns the Header Wx::Button associated with it. ShutterEvent#item Returns the 0 based index to item selected within the program itself. Included, is a simple example, that just shows how it works, with events executing and such, you should be able to use shutter.rb to do what you want, all you need to do, is create each panel, and hide them all, then simply show the one your interested in, or associated to the item in the list. Hope this helps you out, it's not perfect, but has similar ideas as to what is being used in Fox. L8ers, On 2/25/08, Alex Fenton wrote: > > Gerard Rakoczy wrote: > > i was searching for an efect in wxruby like fxshutter from fxruby. > > http://www.fxruby.org/doc/examples.html > > The nearest thing is wxToolBook, which allows multiple pages to be > controlled (like a notebook), but using icon tools rather than tabs to > switch between windows. > > Unfortunately this is one of the few new classes in wxWidgets 2.8 that > isn't currently ported in wxRuby. You could probably create a similar > effect by using a ToolBar + using a Sizer to contain the main window, > and swap and hide/show panels. > > > 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/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080304/f1d36dc2/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: shutter.rb Type: application/octet-stream Size: 1971 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080304/f1d36dc2/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: test_shutter.rb Type: application/octet-stream Size: 2365 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080304/f1d36dc2/attachment-0001.obj From fabio.petrucci at gmail.com Wed Mar 5 04:36:29 2008 From: fabio.petrucci at gmail.com (Fabio Petrucci) Date: Wed, 5 Mar 2008 10:36:29 +0100 Subject: [wxruby-users] wxruby effect like fxshutter In-Reply-To: References: <4656ef5f9f162c23848a7012ec463571@ruby-forum.com> <47C2A757.5000308@pressure.to> Message-ID: That's what i was looking for... thank you Mario, nice example :) On Tue, Mar 4, 2008 at 10:08 PM, Mario Steele wrote: > Hey guys, > > Well, I got some time to put something simple together. Fortunatly Alex, > it's not a fully attached type of deal, as looking at the original Fox > example, it's just like utilizing Wx::Notebook. What I've done, is a simple > bit of code, that works similar to how FXShutter works, except for a few > differences. > > One, it's wxRuby, not Fox, so keep that in mind, but the basics of it, are > these: > > shutter.rb > Creates the class Wx::Shutter > It has three Methods within it: > > Wx::Shutter.new(parent,id) > > Creates a New Shutter Object. > > Wx::Shutter#add_header(title) > > Creates a New Header Button, which will toggle the associated list of > items with it. Returns the instance of Wx::Button used. > > Wx::Shutter#add_item(header,text,icon=NullBitmap) > > Add's a new item to the Header in question (Using the returned > Wx::Button). > > There is a Custom event created for notifying the programmer of when an > item has been selected within the headings. > > ShutterEvent > > ShutterEvent#header > > Returns the Header Wx::Button associated with it. > > ShutterEvent#item > > Returns the 0 based index to item selected within the program itself. > > > Included, is a simple example, that just shows how it works, with events > executing and such, you should be able to use shutter.rb to do what you > want, all you need to do, is create each panel, and hide them all, then > simply show the one your interested in, or associated to the item in the > list. > > Hope this helps you out, it's not perfect, but has similar ideas as to > what is being used in Fox. > > L8ers, > > > On 2/25/08, Alex Fenton wrote: > > > > Gerard Rakoczy wrote: > > > i was searching for an efect in wxruby like fxshutter from fxruby. > > > http://www.fxruby.org/doc/examples.html > > > > The nearest thing is wxToolBook, which allows multiple pages to be > > controlled (like a notebook), but using icon tools rather than tabs to > > switch between windows. > > > > Unfortunately this is one of the few new classes in wxWidgets 2.8 that > > isn't currently ported in wxRuby. You could probably create a similar > > effect by using a ToolBar + using a Sizer to contain the main window, > > and swap and hide/show panels. > > > > > > 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/ > http://rubyforge.org/projects/vwmc/ > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080305/d133a864/attachment-0001.html From lists at ruby-forum.com Wed Mar 5 11:27:16 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Wed, 5 Mar 2008 17:27:16 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock Message-ID: I've been trying to figure out the best method for generating GUI's with Ruby. I ended up using DialogBlock because it seems like the fastest way. But not I have to work backwards and have not done this before. How do I go from the file I generate in DialogBlock to a code in Ruby? -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Mar 5 11:40:54 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 05 Mar 2008 16:40:54 +0000 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: References: Message-ID: <47CECD16.1060102@pressure.to> Joshua Lefkowitz wrote: > I've been trying to figure out the best method for generating GUI's with > Ruby. I ended up using DialogBlock because it seems like the fastest > way. But not I have to work backwards and have not done this before. > How do I go from the file I generate in DialogBlock to a code in Ruby? > The wxruby example samples/xrc/xrc_sample.rb shows how to load an XRC-based layout into a wxRuby program. To save time, I also recommend that you have a look at the tool 'xrcise'. This automatically creates ruby code to load XRC layouts and link to specific controls within the XML file: http://wxruby.rubyforge.org/wiki/wiki.pl?UsingXRCise alex From lists at ruby-forum.com Wed Mar 5 12:47:49 2008 From: lists at ruby-forum.com (Tim Ferrell) Date: Wed, 5 Mar 2008 18:47:49 +0100 Subject: [wxruby-users] Thread code questions In-Reply-To: References: <618d7e63e2c50ced538d0be2c1034b30@ruby-forum.com> <71e9fa0e205b3fc18cbd8510e2be02d6@ruby-forum.com> <3c12d9b081e028f0cf6a8eba5c7b72e4@ruby-forum.com> <47BA2A42.2010908@pressure.to> <87f254451e2b19547ca72ddea5b537fd@ruby-forum.com> <47C2A5FF.1010900@pressure.to> <800ff042b40806f330a946e2e8becf02@ruby-forum.com> <47C68E87.3010507@pressure.to> <9d45b60f13b52bc7945a09f99c053b03@ruby-forum.com> <47C6FA3E.8040107@pressure.to> <337de74230338e6d814671364584bbec@ruby-forum.com> <47C72467.1070406@pressure.to> <47C7443C.6050309@pressure.to> <47C7C8A0.120.37C8EBA6@dirk.traulsen.lypso.de> <47C7C280.7000000@pressure.to> <5b3f85312e7ecfe56b4a9eff0b6b86c1@ruby-forum.com> <0f2447e34e3076ec8c9b9ed7b52f0c58@ruby-forum.com> <47CC624C.7050406@pressure.to> Message-ID: <1bbc2c4b9f8ce44d3a1ed247de227331@ruby-forum.com> Tim Ferrell wrote: > > Downloads are much faster for me this way... they do still feel a > little bit throttled but overall it feels like a better balance so I am > happy for now... although I may try adjusting the timer/limit to smaller > increments and see how that affects ui responsiveness and download > speeds... :-) Well, if it helps anyone else, I discovered that setting the join limit too low caused crashes, at least on the Mac... I ended up using 10ms monitor interval and a 50ms join limit... I also had to remove the check of @dialog.canceled from within the thread as this occasionally led to malloc double free errors. Now the monitor_queue method just kills the thread if the user requests to cancel... > > Well, maybe I'm off the mark here but I was thinking that the Timer > would fire the monitor-queue method call every 100ms regardless of the > status of the joined thread and that, as such, it might end up calling > the method while a previous invocation was still active... > This concern proved to be unfounded as joining the thread inhibits the timer from firing until the thread releases the join... Thanks to everyone for all the help with this!! Cheers, Tim -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Wed Mar 5 15:02:59 2008 From: alex at pressure.to (Alex Fenton) Date: Wed, 05 Mar 2008 20:02:59 +0000 Subject: [wxruby-users] processus In-Reply-To: <000501c87e22$4c209250$0201a8c0@sebastien> References: <000501c87e22$4c209250$0201a8c0@sebastien> Message-ID: <47CEFC73.6070602@pressure.to> sebastien wrote: > J'avait d?j? tester ce que tu ma conseiller pour changer la priorit? > de mon application, mais ?a ne marche pas. > Voil? le message d'erreur que j'obtient par exemple: > "uninitialized constant Process::PRIO_USER (NameError)" > Apparement ?a ne marche pas sur windows??? [I've already tried what you advised (i.e. Process#setpriority) but it doesn't work. The error message is uninitialized constant Process::PRIO_USER (NameError). Apparently it doesn't work on windows? ] Peut-?tre, mais je ne sais pas. Comme j'ai dit, ceci n'est pas une question sur wxRuby, et je te conseille de chercher des avis d'un forum general sur ruby. Sorry. [Perhaps, but I don't know. As I said, it's not a question about wxRuby, and I recommend you seek opinions on a general ruby forum. Sorry] cheers alex From lists at ruby-forum.com Thu Mar 6 00:10:16 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Thu, 6 Mar 2008 06:10:16 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <47CECD16.1060102@pressure.to> References: <47CECD16.1060102@pressure.to> Message-ID: <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> Alex Fenton wrote: > The wxruby example samples/xrc/xrc_sample.rb shows how to load an > XRC-based layout into a wxRuby program. > > To save time, I also recommend that you have a look at the tool > 'xrcise'. > alex Thanks for your help. I am slowly learning how to do this. I followed your suggestions. I am able to generate the XRC file from DialogBLock. Then, I am able to generate the my_frame.rb file. But, when I try to integrate it by using the code posted on the tutorial in the creating a code in SciTE. I get the following syntax error in two lines of the source: syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.' I tried figuring out how to change the code myself to resolve this error, but I'm just not good enough...yet -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Mar 6 03:35:34 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 06 Mar 2008 08:35:34 +0000 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> Message-ID: <47CFACD6.70101@pressure.to> Joshua Lefkowitz wrote: > I get the following syntax error in two > lines of the source: > > syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.' > > Please could you post your XRC file and the generated code. Thanks. alex From lists at ruby-forum.com Thu Mar 6 11:18:22 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Thu, 6 Mar 2008 17:18:22 +0100 Subject: [wxruby-users] How to set exit on close?? Message-ID: <2358d0035b751e7c52127063d2323f75@ruby-forum.com> I want to set close window when press 'X' in top-right I make wxruby GUI from Farpy guie but I can't close it (when I close I must press close in cmd and the return -1) how can I set it?? Attachments: http://www.ruby-forum.com/attachment/1521/untitled.JPG -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Mar 6 11:34:12 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 06 Mar 2008 16:34:12 +0000 Subject: [wxruby-users] How to set exit on close?? In-Reply-To: <2358d0035b751e7c52127063d2323f75@ruby-forum.com> References: <2358d0035b751e7c52127063d2323f75@ruby-forum.com> Message-ID: <47D01D04.2090606@pressure.to> Pat Kiatchaipipat wrote: > I want to set close window when press 'X' in top-right I make wxruby GUI > from Farpy guie but I can't close it (when I close I must press close in > cmd and the return -1) how can I set it?? I'm not sure I understand your question. Basically, if you want to have the standard close button close a window, do nothing. By default, wxRuby understands that the "X" button should close the window. If you want to do some custom checking or processing when the close button on frame is pressed, use evt_close to define an event handler for the frame. evt_close :on_close Then in your on_close method, receive the event, then either call skip() or veto() to allow or disallow the event. def on_close(event) if ready_to_close event.skip() else event.veto() end end Take a look at the samples/minimal/minimal.rb as this is demonstrated in there alex From lists at ruby-forum.com Thu Mar 6 12:08:27 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Thu, 6 Mar 2008 18:08:27 +0100 Subject: [wxruby-users] How to set exit on close?? In-Reply-To: <2358d0035b751e7c52127063d2323f75@ruby-forum.com> References: <2358d0035b751e7c52127063d2323f75@ruby-forum.com> Message-ID: <9c5c4eb09ecfddbe9855bf881821eca7@ruby-forum.com> thank you I find it :) -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Mar 6 13:09:19 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Thu, 6 Mar 2008 19:09:19 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <47CFACD6.70101@pressure.to> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> Message-ID: <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> > Joshua Lefkowitz wrote: >> syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.' > Please could you post your XRC file and the generated code. Thanks. Alex, here's the code (from the XRCise tutorial) --------------- require 'wx' # load in the generated code require 'my_frame' # Mix-in for a Wx::TextCtrl module CaseChangeTextCtrl? # convert all the text in the control to upper case def upcase! self.value = self.value.upcase end # convert all the text in the control to lower case def downcase! self.value = self.value.downcase end end # Inherit from the generated base class and set up event handlers class CaseChangeFrame? < TextFrameBase? def initialize super evt_button(upper_bt) { text_box.upcase! } evt_button(lower_bt) { text_box.downcase! } end end # Run the class Wx::App.run do CaseChangeFrame?.new.show end ------------ Josh -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Mar 6 16:51:45 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 06 Mar 2008 21:51:45 +0000 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> Message-ID: <47D06771.4010505@pressure.to> Joshua Lefkowitz wrote: > Alex, here's the code (from the XRCise tutorial) > > --------------- > > require 'wx' > # load in the generated code > require 'my_frame' > > # Mix-in for a Wx::TextCtrl > module CaseChangeTextCtrl? Ah, sorry, looks like the wiki has mangled some of the ruby code by adding ? - there shouldn't be one here. I've corrected the formatting on the wiki, can you try to copy and paste again please? thanks alex From lists at ruby-forum.com Thu Mar 6 17:22:46 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Thu, 6 Mar 2008 23:22:46 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <47D06771.4010505@pressure.to> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> Message-ID: <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> >> require 'wx' >> # load in the generated code >> require 'my_frame' >> >> # Mix-in for a Wx::TextCtrl >> module CaseChangeTextCtrl? > > Ah, sorry, looks like the wiki has mangled some of the ruby code by > adding ? - there shouldn't be one here. I've corrected the formatting on > the wiki, can you try to copy and paste again please? > > thanks > alex I gave it another shot and it still wasn't working. So, I tried removing all of the '?' characters from the ruby source code. This worked, but I don't see any buttons. My question is, the wiki page shows '?' characters for working in the DialogBlock and for the ruby source. Perhaps just clarifying where a '?' does and doesn't belong will fix everything. Still, for a really green programmer, just getting it to work at all was very satisfying. If I complete this project, I hope to have something to give back to the open source community. Thanks! -- Posted via http://www.ruby-forum.com/. From sandor.szuecs at fu-berlin.de Thu Mar 6 17:59:16 2008 From: sandor.szuecs at fu-berlin.de (=?ISO-8859-1?Q?Sandor_Sz=FCcs?=) Date: Thu, 6 Mar 2008 23:59:16 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> Message-ID: <9B5AEE5F-550C-465B-8995-019262A48787@fu-berlin.de> Hi, On 06.03.2008, at 23:22, Joshua Lefkowitz wrote: > I gave it another shot and it still wasn't working. So, I tried > removing all of the '?' characters from the ruby source code. This > worked, but I don't see any buttons. My question is, the wiki page > shows '?' characters for working in the DialogBlock and for the ruby > source. Perhaps just clarifying where a '?' does and doesn't belong > will fix everything. ? is just a wiki link for creating a new page for CaseChangeTextCtrl. The wiki editor has to quote the wiki-text. If it's a TWiki then you should quote it with '!': !CaseChangeTextCtrl (IIRC). hth. regards, sandor -- From alex at pressure.to Thu Mar 6 19:14:29 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 07 Mar 2008 00:14:29 +0000 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> Message-ID: <47D088E5.1080503@pressure.to> Joshua Lefkowitz wrote: > I gave it another shot and it still wasn't working. So, I tried > removing all of the '?' characters from the ruby source code. This > worked, but I don't see any buttons. My question is, the wiki page > shows '?' characters for working in the DialogBlock and for the ruby > source. Perhaps just clarifying where a '?' does and doesn't belong > will fix everything. REalised I hadn't saved the changes to the wiki page. The source code should be correct now without '?' alex From lists at ruby-forum.com Thu Mar 6 19:26:40 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Fri, 7 Mar 2008 01:26:40 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <47D088E5.1080503@pressure.to> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> Message-ID: <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> Alex Fenton wrote: > Joshua Lefkowitz wrote: >> I gave it another shot and it still wasn't working. So, I tried >> removing all of the '?' characters from the ruby source code. This >> worked, but I don't see any buttons. My question is, the wiki page >> shows '?' characters for working in the DialogBlock and for the ruby >> source. Perhaps just clarifying where a '?' does and doesn't belong >> will fix everything. > REalised I hadn't saved the changes to the wiki page. The source code > should be correct now without '?' > > alex The code works, but I still do not see the buttons in the window that I produce. I followed the wiki as instructed from start to finish. Is there some functionality I was supposed to give to the buttons that perhaps I didn't? Attachments: http://www.ruby-forum.com/attachment/1523/frame.xrc -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Mar 6 19:35:05 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 07 Mar 2008 00:35:05 +0000 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> Message-ID: <47D08DB9.3030204@pressure.to> Joshua Lefkowitz wrote: > The code works, but I still do not see the buttons in the window that I > produce. I followed the wiki as instructed from start to finish. Is > there some functionality I was supposed to give to the buttons that > perhaps I didn't? Your buttons and the textctrl need to be arranged in a Sizer. In DialogBlocks you should see in the palette of addable elements a "Sizers" tab. Add a vertical sizer to the main frame. Then, in order, add the TextCtrl and the two buttons to it. I guess the tutorial should be more explicit about this but I'd think that the result you have at the moment doesn't look right in the preview shown in DialogBlocks? alex From lists at ruby-forum.com Thu Mar 6 19:48:58 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Fri, 7 Mar 2008 01:48:58 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <47D08DB9.3030204@pressure.to> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> Message-ID: <3fe727837db8766c96234d74cae93054@ruby-forum.com> Alex Fenton wrote: > Joshua Lefkowitz wrote: >> The code works, but I still do not see the buttons in the window that I >> produce. I followed the wiki as instructed from start to finish. Is >> there some functionality I was supposed to give to the buttons that >> perhaps I didn't? > Your buttons and the textctrl need to be arranged in a Sizer. In > DialogBlocks you should see in the palette of addable elements a > "Sizers" tab. Add a vertical sizer to the main frame. Then, in order, > add the TextCtrl and the two buttons to it. > > I guess the tutorial should be more explicit about this but I'd think > that the result you have at the moment doesn't look right in the preview > shown in DialogBlocks? > > alex I'll play with it and I think I can figure it out from what you wrote. I think these types of problems--where you're not explicit about something--is more an issue for people like me who are really new to programming and trying to teach themselves everything. People who have experience with programming probably would have picked up on this issue. I'll let you know the results. Thanks. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Mar 6 20:36:35 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Fri, 7 Mar 2008 02:36:35 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <3fe727837db8766c96234d74cae93054@ruby-forum.com> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> Message-ID: <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> >> Your buttons and the textctrl need to be arranged in a Sizer. In >> DialogBlocks you should see in the palette of addable elements a >> "Sizers" tab. Add a vertical sizer to the main frame. Then, in order, >> add the TextCtrl and the two buttons to it. SUCCESS! Now, I just have to understand it all and get to my own code. Thanks for your help. I was just about ready to throw in the towel. Help and OCD prevail. -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Thu Mar 6 20:38:53 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 07 Mar 2008 01:38:53 +0000 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> Message-ID: <47D09CAD.10804@pressure.to> Joshua Lefkowitz wrote: > SUCCESS! > > Now, I just have to understand it all and get to my own code. > > Thanks for your help. I was just about ready to throw in the towel. > Great, glad it worked out. Feel free to ask for help; this is a friendly list for people with all levels of experience Good luck alex From lists at ruby-forum.com Fri Mar 7 01:28:30 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Fri, 7 Mar 2008 07:28:30 +0100 Subject: [wxruby-users] copy & paste event Message-ID: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> hi. now I have problem about copy and paste text in my application I make copy and paste button in toolbar and I have fuction of them but I don't know how to make it can copy only selection text and paste into other textCtrl. see my picture for more info. thank you :) Attachments: http://www.ruby-forum.com/attachment/1526/untitled.JPG -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Mar 7 03:51:35 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 07 Mar 2008 08:51:35 +0000 Subject: [wxruby-users] copy & paste event In-Reply-To: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> Message-ID: <47D10217.8000803@pressure.to> Hi Pat Kiatchaipipat wrote: > hi. now I have problem about copy and paste text in my application I > make copy and paste button in toolbar and I have fuction of them but I > don't know how to make it can copy only selection text and paste into > other textCtrl. see my picture for more info. thank you :) > If you just want ToolBar buttons that do the "normal" thing for cut/copy/paste - i.e. do that action to the current selection in the current active widget - just give the Tool the relevant standard id when you create it. For example toolbar.add_tool(Wx::ID_COPY, 'Cut', bitmap_1 ....) Or Wx::ID_CUT, Wx::ID_PASTE. No additional programming effort should be needed alex From lists at ruby-forum.com Fri Mar 7 04:53:25 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Fri, 7 Mar 2008 10:53:25 +0100 Subject: [wxruby-users] copy & paste event In-Reply-To: <47D10217.8000803@pressure.to> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> <47D10217.8000803@pressure.to> Message-ID: <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> I use tb.add_tool(ID_COPY, "Copy", ArtProvider::get_bitmap(ART_COPY)) but when I click it can't copy some text what's wrong :'( -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Mar 7 05:43:11 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 07 Mar 2008 10:43:11 +0000 Subject: [wxruby-users] copy & paste event In-Reply-To: <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> <47D10217.8000803@pressure.to> <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> Message-ID: <47D11C3F.7030307@pressure.to> Pat Kiatchaipipat wrote: > tb.add_tool(ID_COPY, "Copy", ArtProvider::get_bitmap(ART_COPY)) > > but when I click it can't copy some text > what's wrong :'( > Add something like evt_tool(Wx::ID_COPY) :on_copy then create a method like: def on_copy text_box.copy end alex From lists at ruby-forum.com Fri Mar 7 06:19:32 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Fri, 7 Mar 2008 12:19:32 +0100 Subject: [wxruby-users] copy & paste event In-Reply-To: <47D11C3F.7030307@pressure.to> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> <47D10217.8000803@pressure.to> <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> <47D11C3F.7030307@pressure.to> Message-ID: <947c4fb60b7fde306d61587d7192d635@ruby-forum.com> :'( tb.add_tool(ID_COPY, "Copy", ArtProvider::get_bitmap(ART_COPY)) evt_tool(ID_COPY){|event| on_copy()} def on_copy() @textbox2.copy end then I copy it's ok but it can copy only @textbox2 and and I have many textbox. how can I use it to copy only selected text not dependent textbox? I have @textbox1, @textbox2 and @textbox3 -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Mar 7 06:48:47 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 07 Mar 2008 11:48:47 +0000 Subject: [wxruby-users] copy & paste event In-Reply-To: <947c4fb60b7fde306d61587d7192d635@ruby-forum.com> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> <47D10217.8000803@pressure.to> <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> <47D11C3F.7030307@pressure.to> <947c4fb60b7fde306d61587d7192d635@ruby-forum.com> Message-ID: <47D12B9F.6010108@pressure.to> Pat Kiatchaipipat wrote: > tb.add_tool(ID_COPY, "Copy", ArtProvider::get_bitmap(ART_COPY)) > evt_tool(ID_COPY){|event| on_copy()} > > def on_copy() > @textbox2.copy > end > > then I copy it's ok but it can copy only @textbox2 and and I have many > textbox. how can I use it to copy only selected text not dependent > textbox? I have @textbox1, @textbox2 and @textbox3 > IMHO it seems a confusing UI design to have a toolbar button that can interact with one of several different widgets depending on circumstances. Anyway, it's up to you to decide the logic by which one of the text boxes is chosen to have its selection copied. Perhaps, you could use evt_set_focus to track the most recently focussed textbox, or perhaps you could test each textbox in turn with get_selection to see if it has a selection. Suggest you spend some time trying things out and working through the wxruby samples and documentation to see what's possible. alex From lists at ruby-forum.com Fri Mar 7 07:10:36 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Fri, 7 Mar 2008 13:10:36 +0100 Subject: [wxruby-users] copy & paste event In-Reply-To: <47D12B9F.6010108@pressure.to> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> <47D10217.8000803@pressure.to> <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> <47D11C3F.7030307@pressure.to> <947c4fb60b7fde306d61587d7192d635@ruby-forum.com> <47D12B9F.6010108@pressure.to> Message-ID: Thank you I use it now!! :D -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 7 09:08:26 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Fri, 7 Mar 2008 15:08:26 +0100 Subject: [wxruby-users] copy & paste event In-Reply-To: <47D12B9F.6010108@pressure.to> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> <47D10217.8000803@pressure.to> <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> <47D11C3F.7030307@pressure.to> <947c4fb60b7fde306d61587d7192d635@ruby-forum.com> <47D12B9F.6010108@pressure.to> Message-ID: <4275d7e372b26130d56d798cd50e078c@ruby-forum.com> now I have problem with paste :( when I copy I use this a = @textbox1.get_selection() b = @textbox2.get_selection() c = @textbox3.get_selection() if a[1] - a[0] != 0 @textbox1.copy elsif b[1] - b[0] != 0 @textbox2.copy elsif c[1] - c[0] != 0 @textbox3.copy end to check where @textbox was selected but when I want to paste it can't use this I try to think but I don't know how can I fix it please help me :'( -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Fri Mar 7 09:26:26 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 07 Mar 2008 14:26:26 +0000 Subject: [wxruby-users] copy & paste event In-Reply-To: <4275d7e372b26130d56d798cd50e078c@ruby-forum.com> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> <47D10217.8000803@pressure.to> <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> <47D11C3F.7030307@pressure.to> <947c4fb60b7fde306d61587d7192d635@ruby-forum.com> <47D12B9F.6010108@pressure.to> <4275d7e372b26130d56d798cd50e078c@ruby-forum.com> Message-ID: <47D15092.7030901@pressure.to> Pat Kiatchaipipat wrote: > to check where @textbox was selected but when I want to paste it can't > use this I try to think but I don't know how can I fix it please help me > http://wxruby.rubyforge.org/doc/textctrl.html#TextCtrl_paste As for which TextCtrl to paste into, I have no idea because you haven't given us any idea of what your app is meant to do. If you wanted to track the last-focussed TextCtrl, it might be something like (untested): evt_child_focus do | event | if [ @textbox1, @textbox2, @textbox3 ].any?(event.window) @focussed_textbox = event.window end end When posting, it helps a lot if you write clearly what you want to do, what you've tried, and what you expected to happen. Don't expect other people to guess or do your work for you. alex From lists at ruby-forum.com Fri Mar 7 10:33:19 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Fri, 7 Mar 2008 16:33:19 +0100 Subject: [wxruby-users] copy & paste event In-Reply-To: <47D15092.7030901@pressure.to> References: <34c609b534ede1b9acab8bbb2accc864@ruby-forum.com> <47D10217.8000803@pressure.to> <9abe1138940d37737c6bbdcbda315f39@ruby-forum.com> <47D11C3F.7030307@pressure.to> <947c4fb60b7fde306d61587d7192d635@ruby-forum.com> <47D12B9F.6010108@pressure.to> <4275d7e372b26130d56d798cd50e078c@ruby-forum.com> <47D15092.7030901@pressure.to> Message-ID: <93f32059d767becd58aaa4d35a9ba753@ruby-forum.com> sorry, I will explain again :) I have three textbox like this picture, and I have copy, paste, cut on toolbar and I want to make when user click at copy it will copy text that selected (I can do it now) and then I want to paste text in other textbox example first I copy 'sssss' on left textbox, it's ok. then I want to paste it in right textbox that I point into it (see picture) if I use @textbox2.paste in function on_paste. it's ok but it can paste only right textbox when I point mouse at left textbox and paste it, it will appear at riht textbox :'( Attachments: http://www.ruby-forum.com/attachment/1528/untitled.JPG -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Fri Mar 7 23:25:46 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Sat, 8 Mar 2008 05:25:46 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <47D09CAD.10804@pressure.to> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> <47D09CAD.10804@pressure.to> Message-ID: Alex Fenton wrote: > Joshua Lefkowitz wrote: >> SUCCESS! >> >> Now, I just have to understand it all and get to my own code. >> >> Thanks for your help. I was just about ready to throw in the towel. >> > Great, glad it worked out. Feel free to ask for help; this is a friendly > list for people with all levels of experience > > Good luck > alex I tried to move on to apply what I learned and make my own simple application. I started off more simple than the XRCise tutorial example, just creating a frame through DialogBlock, then applied XRCise. When I get to writing the ruby source code that mixes in the ruby class file generated from XRCise, I get nowhere. I'm thinking that I'm not just going to be able to pick this up as easily as I hoped and was wondering if there are particular books (or chapters of books) or websites I should be looking at to learn the basics--with respect to GUI. I have the "pickaxe", the Ruby Way (and a couple of others), and I've been all over the web, so I have a general feel for all the info that's out there--there's so much out there, I'm not sure what to focus on at this point. Any advice is much appreciated. -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Sun Mar 9 00:16:57 2008 From: mario at ruby-im.net (Mario Steele) Date: Sat, 8 Mar 2008 23:16:57 -0600 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: References: <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> <47D09CAD.10804@pressure.to> Message-ID: Hello Joshua, May I inquire as to the reasoning behind needing to use DialogBlocks? Is it purely so that you can see instantly what is being created, or reusability, etc, etc, etc? I might recommend, till you get yourself comfortable with wxRuby, that you try building frames, and user interfaces by hand, through actual Ruby Code. But if you absolutely need to have a User Interface generated by DialogBlocks, and xrcise is not working for you.... Can you explain what the problem is more specifically? A lot of times, when building interfaces with XRC, you need to know what you are doing, and how xrcise is going to translate that into Ruby code for you. L8ers, On 3/7/08, Joshua Lefkowitz wrote: > > Alex Fenton wrote: > > Joshua Lefkowitz wrote: > >> SUCCESS! > >> > >> Now, I just have to understand it all and get to my own code. > >> > >> Thanks for your help. I was just about ready to throw in the towel. > >> > > Great, glad it worked out. Feel free to ask for help; this is a friendly > > list for people with all levels of experience > > > > Good luck > > alex > > I tried to move on to apply what I learned and make my own simple > application. I started off more simple than the XRCise tutorial > example, just creating a frame through DialogBlock, then applied XRCise. > When I get to writing the ruby source code that mixes in the ruby class > file generated from XRCise, I get nowhere. I'm thinking that I'm not > just going to be able to pick this up as easily as I hoped and was > wondering if there are particular books (or chapters of books) or > websites I should be looking at to learn the basics--with respect to > GUI. I have the "pickaxe", the Ruby Way (and a couple of others), and > I've been all over the web, so I have a general feel for all the info > that's out there--there's so much out there, I'm not sure what to focus > on at this point. Any advice is much appreciated. > -- > 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/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080308/426deace/attachment.html From lists at ruby-forum.com Sun Mar 9 01:07:51 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Sun, 9 Mar 2008 07:07:51 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> <47D09CAD.10804@pressure.to> Message-ID: <1dfae6f8ff6f3e4af90243166b2f701e@ruby-forum.com> Mario Steele wrote: > Hello Joshua, > > May I inquire as to the reasoning behind needing to use DialogBlocks? > Is it > purely so that you can see instantly what is being created, or > reusability, > etc, etc, etc? I might recommend, till you get yourself comfortable > with > wxRuby, that you try building frames, and user interfaces by hand, > through > actual Ruby Code. But if you absolutely need to have a User Interface > generated by DialogBlocks, and xrcise is not working for you.... Can you > explain what the problem is more specifically? > > A lot of times, when building interfaces with XRC, you need to know what > you > are doing, and how xrcise is going to translate that into Ruby code for > you. > > L8ers, Mario, thanks for the input. I do need to have a GUI for my final app, but it doesn't have to be via DialogBlocks/XRCise. I guess my question is, if I learn about GUI in say Tk, how easily will i be able to apply that to any of the other GUI aps--fxruby, wxruby, etc.? -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Sun Mar 9 01:55:47 2008 From: mario at ruby-im.net (Mario Steele) Date: Sun, 9 Mar 2008 00:55:47 -0600 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <1dfae6f8ff6f3e4af90243166b2f701e@ruby-forum.com> References: <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> <47D09CAD.10804@pressure.to> <1dfae6f8ff6f3e4af90243166b2f701e@ruby-forum.com> Message-ID: Hello Joshua, On 3/9/08, Joshua Lefkowitz wrote: > > > Mario, thanks for the input. I do need to have a GUI for my final app, > but it doesn't have to be via DialogBlocks/XRCise. I guess my question > is, if I learn about GUI in say Tk, how easily will i be able to apply > that to any of the other GUI aps--fxruby, wxruby, etc.? Just a note, but when reffering to other GUI Toolkits, like Tk, FXRuby and wxRuby, they are technically GUI Libraries. As to your particular question, I strongly, very very strongly recommend staying with 1 GUI Toolkit. The reason for this, is that each GUI Toolkit library has it's own API Interface, it's own set of Controls, it's own way of handling Events that come from the GUI elements. Also, there's certain advantages and dis-advantages to using each Toolkit. Tk, is a very low level GUI Toolkit, and heavily relies on having the TK/TCL Framework installed along side Ruby in order to work. GUI Apps that are created with TK, do not truely have a native OS feel to it, and can tend to be over-complicated. FXRuby, has a Single GUI Look and Feel, so it's garunteed to look the same across all platforms, though that is not always a good thing. The reason why it looks the same no matter what platform you run on, is cause Fox does all of it's own drawing for all the controls that it has associated with it. I have found many times over, that with this method of drawing controls, can lend to be a main cause for bottlenecks in programs developed in Ruby. Everything is compiled in with the Extension, so you don't need to re-distribute a whole bunch of stuff, just a single .so file and a few .rb files, which makes it a lot easier to port. wxRuby on the other hand, utilizes Native OS Controls wherever possible, only substituting for controls that do not exist on the platform in question. It's very fast, and has very few bottlenecks, cause it's not custom drawing every single control, outside of the main Window. This is favorable, cause it will retain the user's preferences for Font size, control colors, layout, etc, etc. Also, as with FXRuby, wxRuby has a single SO File, and a few .rb files, making distrobution easier. Going between these three toolkits, can be very fustrating when your trying to develop apps. Do note, that these are my own opinions, and experiences from using these three Toolkits, and even though I develop soley with wxRuby, I encourage people to experiment with other libraries, but only pick 1 toolkit in which to do any programming with, otherwise, it will get harder and more frustrating in which to do stuff, any other way. If you have any other questions, please feel free to ask away! L8ers, -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080309/f6e14d28/attachment-0001.html From lists at ruby-forum.com Sun Mar 9 13:44:44 2008 From: lists at ruby-forum.com (Tim Ferrell) Date: Sun, 9 Mar 2008 18:44:44 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> <47D09CAD.10804@pressure.to> <1dfae6f8ff6f3e4af90243166b2f701e@ruby-forum.com> Message-ID: Mario Steele wrote: > I strongly, very very strongly recommend staying with 1 GUI Toolkit. I can't second that enough... :-) I came to Ruby/wxRuby from Windows (VB6, .NET), Java , and then Qt3/C++ development... so I was accustomed to really only having 1 choice for the gui toolkit... Well, with Ruby I had many to choose from and it was hard to decide at first. I looked at the Qt bindings for Ruby since I was working with Qt3 at the time... I found them to be okay (well, a bit quirky and incomplete on the Mac), but I did not want to lock myself into the "GPL or pay" licensing scheme that using Qt requires. I then looked at FOX (no Mac support, somewhat visually unappealing), Tk (ugly code *grin*, no Ruby support yet for new, nice looking widgets), GTK (spurious errors, deployment headaches)... I was intially avoiding wxWindows, thinking it had pretty much run out of steam. However, I am glad to find I was wrong. It seems to me to have the best blend of features, looks nice on every platform, and it is very easy to deploy with a Ruby app via the binary gems... Oh, yeah, back to my point :-) In order to test, I wrote a little app in all of the toolkits I evaluated ... each got to various stages of completion as I hit obstacles or lost interest in subjecting myself to the pain encountered in working with them... and by the time I gave wxWidgets/wxRuby a go, my head was spinning with so many varied approaches to events, naming, threading and so on ... I ended up struggling more with wxRuby than I might have otherwise... :-) All in all, though, my evaluation experiences proved helpful. I am much more inclined now to work through any issues I may encounter with wxRuby because I know the "grass is not greener" with any other toolkit. Cheers, Tim -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Mar 9 13:59:05 2008 From: lists at ruby-forum.com (Joshua Lefkowitz) Date: Sun, 9 Mar 2008 18:59:05 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> <47D09CAD.10804@pressure.to> <1dfae6f8ff6f3e4af90243166b2f701e@ruby-forum.com> Message-ID: <58d798d2758cd7d797b0084284cda3ca@ruby-forum.com> Tim, Mario, Thanks for your informative input. I think I'll stick to trying to learn wxruby. I will try learning to code everything manually. I'll follow the online tutorials and decipher the examples as best as I can. Any other suggestions are greatly appreciated. -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Sun Mar 9 14:04:05 2008 From: lists at ruby-forum.com (Tim Ferrell) Date: Sun, 9 Mar 2008 19:04:05 +0100 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <58d798d2758cd7d797b0084284cda3ca@ruby-forum.com> References: <47CECD16.1060102@pressure.to> <258018d988e3af79011b023fd71c0b6d@ruby-forum.com> <47CFACD6.70101@pressure.to> <6621844e565ef7d2178ed178135a8cfc@ruby-forum.com> <47D06771.4010505@pressure.to> <3a870e51fc06a7d27cd73c12e024eb0e@ruby-forum.com> <47D088E5.1080503@pressure.to> <7875bdb805fd426a15205bbc2d9208df@ruby-forum.com> <47D08DB9.3030204@pressure.to> <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> <47D09CAD.10804@pressure.to> <1dfae6f8ff6f3e4af90243166b2f701e@ruby-forum.com> <58d798d2758cd7d797b0084284cda3ca@ruby-forum.com> Message-ID: <14dc4c7b3001819bda48baf9c3e91379@ruby-forum.com> Joshua Lefkowitz wrote: > Tim, Mario, > > Thanks for your informative input. I think I'll stick to trying to > learn wxruby. I will try learning to code everything manually. I'll > follow the online tutorials and decipher the examples as best as I can. > Any other suggestions are greatly appreciated. No problem... and if it helps, feel free to post code and questions here. I, too, am using DialogBlocks and xrcise with my apps and am still relatively new to wxRuby, but I'll be more than happy to help out any way I can... Cheers, Tim -- Posted via http://www.ruby-forum.com/. From mario at ruby-im.net Sun Mar 9 14:04:07 2008 From: mario at ruby-im.net (Mario Steele) Date: Sun, 9 Mar 2008 13:04:07 -0500 Subject: [wxruby-users] wxruby, XRC, DialogBlock In-Reply-To: <58d798d2758cd7d797b0084284cda3ca@ruby-forum.com> References: <3fe727837db8766c96234d74cae93054@ruby-forum.com> <5259571ad9690a0bc4de3802e68ac0c4@ruby-forum.com> <47D09CAD.10804@pressure.to> <1dfae6f8ff6f3e4af90243166b2f701e@ruby-forum.com> <58d798d2758cd7d797b0084284cda3ca@ruby-forum.com> Message-ID: Hey Joshua, On 3/9/08, Joshua Lefkowitz wrote: > Tim, Mario, > > Thanks for your informative input. I think I'll stick to trying to > learn wxruby. I will try learning to code everything manually. I'll > follow the online tutorials and decipher the examples as best as I can. > Any other suggestions are greatly appreciated. Your quite welcome for the input. If you have any questions about how Widgets work, and so on, feel free to ask, as one of us devs, or another user on the Mailing List, will be more then happy to help you out with it. Examples is the best way to learn how things work within wxRuby, as it is pretty much as it's shown there. It does take some time to learn, but don't get discouraged so easily. As Tim has pointed out, other toolkits are hard to work with, and some are not even fully cross-platform, or are a headache to deploy in any case. Another nice thing that you will have with wxRuby, compared with other Toolkits, is the users, we have a Chat room #wxruby on irc.freenode.net, we have the Mailing List, and we consider ourselvs a very helpful bunch, even to those who are new not to just wxRuby, but new to Ruby itself to. Not very many other Toolkits can say the same. Good luck with your learning experince, and again, ask any questions you may have, and feel free to look through our Mailing List Archives, there's quite a bit of information that has been discussed in the past over the mailing list, that can be easily looked through. L8ers, -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080309/a7d14599/attachment.html From alex at pressure.to Tue Mar 11 03:25:53 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 11 Mar 2008 07:25:53 +0000 Subject: [wxruby-users] wxRuby 1.9.5 Message-ID: <47D63401.9030503@pressure.to> Hi wxRuby 1.9.5 is now out with a full set of binary gems. It can be downloaded from the usual place: http://rubyforge.org/frs/?group_id=35&release_id=19932 Or via rubygems: gem install wxruby == WHAT'S NEW == This doesn't have any major new features, but has a lot of bugfixes, including some nasty crashers, and additional useful methods within existing classes. It also has additions and improvements to the documentation, such as better cross-referencing. There's a full list of changes here: http://rubyforge.org/frs/shownotes.php?release_id=19932 One change to note is that the default linux-x86 build now *doesn't* include Wx::MediaCtrl. This is to reduce the package dependencies required to use the gem. As normal, if compiling yourself, and suitable packages are installed, support for MediaCtrl will be included. Feedback's welcome on this. == WHAT'S NEXT == The main focus will be on bugfixing, minor syntax improvements as well as improving the samples and docs. The aim is to have a stable wxruby 2.0 shortly based largely on the current feature set. Whilst wxRuby doesn't support some of the new and more esoteric GUI classes in wxWidgets, we think it's more important to have a production version out there. == THANKS == Many thanks to everyone who contributed to this release through patches, bug reports and binary builds. Keep 'em coming. cheers alex From lists at ruby-forum.com Tue Mar 11 04:20:55 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Tue, 11 Mar 2008 09:20:55 +0100 Subject: [wxruby-users] How can I play files .mp3 and midi ?? Message-ID: <9c8915b26bd5fa1cec3d10eabace226b@ruby-forum.com> I use def button_event3() Sound.new('destiny.wav').play end and I can play normally but this can't use with .mp3 and midi files. how can I play it?? it work for .wav only?? -- Posted via http://www.ruby-forum.com/. From alex at pressure.to Tue Mar 11 05:19:13 2008 From: alex at pressure.to (Alex Fenton) Date: Tue, 11 Mar 2008 09:19:13 +0000 Subject: [wxruby-users] How can I play files .mp3 and midi ?? In-Reply-To: <9c8915b26bd5fa1cec3d10eabace226b@ruby-forum.com> References: <9c8915b26bd5fa1cec3d10eabace226b@ruby-forum.com> Message-ID: <47D64E91.1050302@pressure.to> Pat Kiatchaipipat wrote: > and I can play normally but this can't use with .mp3 and midi files. how > can I play it?? it work for .wav only?? > Yes, Wx::Sound is intended only for playing short .wav sounds. You can use Wx::MediaCtrl to play mp3, if your platform supports that format (definitely yes for Windows and OS X). alex From lists at ruby-forum.com Tue Mar 11 07:21:52 2008 From: lists at ruby-forum.com (Pat Kiatchaipipat) Date: Tue, 11 Mar 2008 12:21:52 +0100 Subject: [wxruby-users] How can I play files .mp3 and midi ?? In-Reply-To: <47D64E91.1050302@pressure.to> References: <9c8915b26bd5fa1cec3d10eabace226b@ruby-forum.com> <47D64E91.1050302@pressure.to> Message-ID: <96d61ff3efd2d1a5b15968f59ca70b41@ruby-forum.com> thank you! I just see mediaCtrl in wxruby it can play mp3 :D -- Posted via http://www.ruby-forum.com/. From chauk.mean at gmail.com Tue Mar 11 20:03:21 2008 From: chauk.mean at gmail.com (Chauk-Mean P) Date: Wed, 12 Mar 2008 01:03:21 +0100 Subject: [wxruby-users] Different (tree) event behaviors across platforms Message-ID: Hi all, I'm currently writing a simple outliner application as a tutorial on wxRuby (both will be soon released ;-) ) I tested this application on Windows and Linux and found that the tree event behavior : - is sometime strange on each platform - is also different on each platform Even if I managed to take care of these differences in the application, I'm just wondering if : - they revealed some wxRuby issues ? wxWindows issues ? - or it is normal ? In this case, I'd really appreciate some links/documentation on these cross-platforms issues. You will find attached the source codes and captures of the application on Windows and Linux (Fedora 8). So the symptoms : 1/ Run outliner_wo_check.rb Clicking on the 'Add Root' button, creates an item and allow the edition of its label. On Windows, this works as expected. You can click several times and everything is fine. On Linux, this does not work. Sometimes, the editing of the label is not ended by the selection (through code) of another item. See the outliner_linux_wo_check.jpg capture. To fix this Linux issue, I added some checks to know if a label is being edited and to ensure that the editing is ended before adding items. 2/ Run outliner.rb If I create a root article, there are 2 selection change events on Windows (strange) and only one on Linux (as expected). See outliner_linux.jpg and outliner_windows.jpg. 3/ Run again outliner.rb : - create two root articles, create a child within the first root as shown in outliner_windows.jpg - close the application afterwards On Windows, you will see traces indicating that there are selection change events occuring during the close of the application ! On Linux, you don't have these events. This time for 2/ and 3/ I had to write code to face these strange things on Windows. Thanks in advance for any help/clarification. Cheers. Chauk-Mean. -------------- next part -------------- A non-text attachment was scrubbed... Name: outliner_wo_check.rb Type: application/x-ruby Size: 4537 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: outliner_linux_wo_check.jpg Type: image/jpeg Size: 51602 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0003.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: outliner.rb Type: application/x-ruby Size: 4528 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0003.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: outliner_win.jpg Type: image/jpeg Size: 53115 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0004.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: outliner_linux.jpg Type: image/jpeg Size: 39896 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0005.jpg From mario at ruby-im.net Wed Mar 12 02:42:13 2008 From: mario at ruby-im.net (Mario Steele) Date: Wed, 12 Mar 2008 01:42:13 -0500 Subject: [wxruby-users] wxRIDE Mailing Lists open Message-ID: Hello All, I've finalized wxRIDE's Mailing Lists. For users of wxRIDE, who are looking for help, having problems, or general questions about wxRIDE, may use the wxRIDE's user list, at wxride-users at rubyforge.org or you can register at http://rubyforge.org/mailman/listinfo/wxride-users We also have a Development list, for the developers of wxRIDE. Please keep in mind, that this is meant for wxRIDE Developers only, but if you want to see what is going on behind the scenes, you may subscribe to wxride-development at rubyforge.org or http://rubyforge.org/mailman/listinfo/wxride-development If you have any questions, please feel free to ask on these lists, as that is what they are ment for, to keep down on the wxRIDE emails comming through on wxRuby's mailing list. -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/4eb68fe0/attachment.html From bureaux.sebastien at neuf.fr Thu Mar 13 06:53:43 2008 From: bureaux.sebastien at neuf.fr (sebastien) Date: Thu, 13 Mar 2008 11:53:43 +0100 Subject: [wxruby-users] TreeCtrl Message-ID: <000501c884f8$838fe2e0$0201a8c0@sebastien> Salut Alex. J'ai 1 fenetre "TreeCtrl" et 1 fenetre "CheckListBox" $d = CheckListBox..... $liste1 est un tableau. Quand je fait un clique_droit sur un item(TreeCtrl) pour activer le menu, le nom de l'item appara?t en "bold" correctement, mais quand je passe en parametre: $d.insert_items($liste1, 0) ou $d.set(client_data = $liste1), donc le contenu de $liste1 s'affiche, et que je refait 1 clique_droit sur n'importe quel item(TreeCtrl) le nom de l'item n'appara?t plus en bold. Apr?s recherche, apparement seul $d.insert_items($liste1, 0) ou $d.set(client_data = $liste1) sont la cause du probl?me. Ce qui est ?tonnant, c'est que "TreeCtrl" et "CheckListBox" n'ont aucun rapport. D'ou peut provenir la cause du probl?me? merci sebastien http://beusse.liveror.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080313/de0bac78/attachment.html From alex at pressure.to Thu Mar 13 15:11:59 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 13 Mar 2008 19:11:59 +0000 Subject: [wxruby-users] Different (tree) event behaviors across platforms In-Reply-To: References: Message-ID: <47D97C7F.7020203@pressure.to> Hi Chauk-Mean P wrote: > I'm currently writing a simple outliner application as a tutorial on > wxRuby (both will be soon released ;-) ) > I tested this application on Windows and Linux and found that the tree > event behavior : > - is sometime strange on each platform > - is also different on each platform > Thank you for the report and test cases. As you know wxWidgets wraps native controls and the native event loop, and there are some subtle differences sometimes. From experience I think there are more of these in TreeCtrl than anywhere else - it's probably because it's the most complex native-wrapped control. > Even if I managed to take care of these differences in the > application, I'm just wondering if : > - they revealed some wxRuby issues ? wxWindows issues ? > - or it is normal ? In this case, I'd really appreciate some > links/documentation on these cross-platforms issues. > In most cases they're wxWidgets issues, though ultimately the only way to verify this is to write a C++ sample. As for official docs, we're limited to what's in the wxWidgets docs, plus any annotations we make. In the past I've turned up useful confirmations of subtler cross-platform differences by searching for info on wxPython or C++ (eg by searching for wxTreeCtrl). The wxWiki sometimes also has info. But usually it's just a question of coding round it, as you've done. Happy to apply patches that note these differences in our ruby docs. > You will find attached the source codes and captures of the > application on Windows and Linux (Fedora 8). > > I tried out your examples, and was able to reproduce the differences you describe. > 3/ Run again outliner.rb : > - create two root articles, create a child within the first root as > shown in outliner_windows.jpg > - close the application afterwards > > On Windows, you will see traces indicating that there are selection > change events occuring during the close of the application ! On Linux, > you don't have these events. This might possibly be something fixable in wxRuby, but I'm not sure. There's a few places I've been surprised by ObjectPreviouslyDeleted errors where events are getting sent to destroyed objects. I wonder if wxRuby should try to explicitly disconnect event handlers on window deletion - but there's nothing in the C++ docs that suggests this. cheers alex From dbgrandi at gmail.com Thu Mar 13 18:22:08 2008 From: dbgrandi at gmail.com (David Grandinetti) Date: Thu, 13 Mar 2008 15:22:08 -0700 Subject: [wxruby-users] TaskBarIcon in OS X Message-ID: <4d27af0c0803131522g5330e8e6qee84f6ab9c0b44c5@mail.gmail.com> Is the Wx:TaskBarIcon supported under OS X? I can't seem to get it working. My code works under Windows, but not OS X. I thought it was something I was doing, so I tried the bigdemo.rb sample and that doesnt' seem to like OS X either. I'm running OS X 10.5 with wxRuby 1.9.5 gem and ruby 1.8.6. -dave -- David Grandinetti (315) 569 2594 From alex at pressure.to Fri Mar 14 05:09:27 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Mar 2008 09:09:27 +0000 Subject: [wxruby-users] TaskBarIcon in OS X In-Reply-To: <4d27af0c0803131522g5330e8e6qee84f6ab9c0b44c5@mail.gmail.com> References: <4d27af0c0803131522g5330e8e6qee84f6ab9c0b44c5@mail.gmail.com> Message-ID: <47DA40C7.5070106@pressure.to> David Grandinetti wrote: > Is the Wx:TaskBarIcon supported under OS X? I can't seem to get it > working. My code works under Windows, but not OS X. I thought it was > something I was doing, so I tried the bigdemo.rb sample and that > doesnt' seem to like OS X either. It does work, but perhaps not in the way you were expecting. wxWidgets considers the 'TaskBar' on OS X to be the dock; if you run bigdemo, you should see that the icon in the dock is changed, and has the taskbar menu associated with it. The purpose of the standard desktop elements (eg dock, menu bar, Windows taskbar) don't map exactly from OS to OS, but I think this is seen as the closest equivalent. According to the Apple HIG, the area on the right of the Menu Bar, where the power status, volume, clock etc is "reserved for use by Apple". http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGMOSXEnvironment/chapter_8_section_4.html#//apple_ref/doc/uid/TP40002721-TPXREF139 http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGMenus/chapter_17_section_4.html#//apple_ref/doc/uid/TP30000356-CHDFJEAC PS - there does seem to be a bug on OS X changing the Doc icon. But otherwise it works fine. cheers alex From bureaux.sebastien at neuf.fr Fri Mar 14 06:57:15 2008 From: bureaux.sebastien at neuf.fr (sebastien) Date: Fri, 14 Mar 2008 11:57:15 +0100 Subject: [wxruby-users] maximizeevent Message-ID: <000501c885c2$2aa1de20$0201a8c0@sebastien> Bonjour Alex. Dans les docs, il y a "maximizeevent", mais je ne voit pas "minimizeevent"??? Pourquoi? sebastien http://beusse.liveror.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080314/1fb3ed65/attachment.html From alex at pressure.to Fri Mar 14 07:10:46 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 14 Mar 2008 11:10:46 +0000 Subject: [wxruby-users] maximizeevent In-Reply-To: <000501c885c2$2aa1de20$0201a8c0@sebastien> References: <000501c885c2$2aa1de20$0201a8c0@sebastien> Message-ID: <47DA5D36.602@pressure.to> Salut sebastien wrote: > Dans les docs, il y a "maximizeevent", mais je ne voit pas > "minimizeevent"??? [in the docs, there's MaximizeEvent, but not MinimizeEvent?] Voyez "iconizeevent" [see IconizeEvent] http://wxruby.rubyforge.org/doc/iconizeevent.html alex From chauk.mean at gmail.com Fri Mar 14 10:50:33 2008 From: chauk.mean at gmail.com (Chauk-Mean P) Date: Fri, 14 Mar 2008 15:50:33 +0100 Subject: [wxruby-users] Different (tree) event behaviors across platforms In-Reply-To: <47D97C7F.7020203@pressure.to> References: <47D97C7F.7020203@pressure.to> Message-ID: Hi, 2008/3/13, Alex Fenton : > Thank you for the report and test cases. As you know wxWidgets wraps > native controls and the native event loop, and there are some subtle > differences sometimes. From experience I think there are more of these > in TreeCtrl than anywhere else - it's probably because it's the most > complex native-wrapped control. Unfortunately, it is also one of the most useful control :-). > In most cases they're wxWidgets issues, though ultimately the only way > to verify this is to write a C++ sample. As for official docs, we're > limited to what's in the wxWidgets docs, plus any annotations we make. > In the past I've turned up useful confirmations of subtler > cross-platform differences by searching for info on wxPython or C++ (eg > by searching for wxTreeCtrl). The wxWiki sometimes also has info. Thanks for the links. But after a quick search, I haven't found a place where cross-platforms subtleties are documented. I will try a deeper search. > Happy to apply patches that note these differences in our ruby docs. I'm glad to add another little contribution to wxRuby. What do you think about having a general section on cross-platforms issues, or having such a section in each Control (when it is relevant) ? > > On Windows, you will see traces indicating that there are selection > > change events occuring during the close of the application ! On Linux, > > you don't have these events. > This might possibly be something fixable in wxRuby, but I'm not sure. > There's a few places I've been surprised by ObjectPreviouslyDeleted > errors where events are getting sent to destroyed objects. I wonder if > wxRuby should try to explicitly disconnect event handlers on window > deletion - but there's nothing in the C++ docs that suggests this. This is exactly the problem I had. In the code of selection change event, I take and put the content of the textctrl (in the right pane) based on the selected item. But during the close of the window, the textctrl has been already destroyed. So I received this ObjectPreviouslyDeleted error. It would be really great if wxRuby can deal with this issue. Indeed, unlike the 2 other issues, this one makes the application crash. Cheers. Chauk-Mean. From chauk.mean at gmail.com Fri Mar 14 11:30:11 2008 From: chauk.mean at gmail.com (Chauk-Mean P) Date: Fri, 14 Mar 2008 16:30:11 +0100 Subject: [wxruby-users] wxRIDE Finally Available In-Reply-To: References: Message-ID: Hi Mario, 2008/3/1, Mario Steele : > Hello fellow wxRuby users, > > Well, after a long period in which I originally announced that I was > creating an IDE, I have finally become satisfied enough to release a SVN > Version of wxRIDE. That's great. Will you provide an archive file for wxRIDE for convenience in the future ? Anyway, I will have a look from my Linux box which has svn installed. > * Implements Scintilla through StyledTextCtrl. Further syntax highlighting > needed, as Ruby is the only language currently implemented. Does the syntax highlighting supports Ruby 1.9.0 new syntax ? {a: "value a", b: "value b"} as an alternative for {:a => "value a", :b => "value b" } Currently, I think that there is no editor or IDE that supports this new syntax. It would be great if wxRIDE was the first IDE supporting this new syntax. Cheers. Chauk-Mean. From dbgrandi at gmail.com Fri Mar 14 14:43:41 2008 From: dbgrandi at gmail.com (David Grandinetti) Date: Fri, 14 Mar 2008 11:43:41 -0700 Subject: [wxruby-users] TaskBarIcon in OS X In-Reply-To: <47DA40C7.5070106@pressure.to> References: <4d27af0c0803131522g5330e8e6qee84f6ab9c0b44c5@mail.gmail.com> <47DA40C7.5070106@pressure.to> Message-ID: <4d27af0c0803141143h355c4639ha485360d8d53a2c1@mail.gmail.com> Thanks, Alex. You are correct. It does work, just not in the way I was looking for. Actually, I have come to expect apps to have an icon on the right of the menu bar if they are meant to run in the background...like Skype, GMail notifier, etc. I never knew that Apple considered that incorrect. I've never used a menu from the dock icon either, but now that I'm checking some of my favorite apps out they have some pretty useful features in there. Very good to know! I don't know if this is a issue better taken up with the wxWidgets developers, but you may consider (even though the Apple HIG guidelines frown on it) that developers will want to be able to put icons on the right side of the menu bar. -dave On Fri, Mar 14, 2008 at 2:09 AM, Alex Fenton wrote: > David Grandinetti wrote: > > Is the Wx:TaskBarIcon supported under OS X? I can't seem to get it > > working. My code works under Windows, but not OS X. I thought it was > > something I was doing, so I tried the bigdemo.rb sample and that > > doesnt' seem to like OS X either. > It does work, but perhaps not in the way you were expecting. wxWidgets > considers the 'TaskBar' on OS X to be the dock; if you run bigdemo, you > should see that the icon in the dock is changed, and has the taskbar > menu associated with it. > > The purpose of the standard desktop elements (eg dock, menu bar, Windows > taskbar) don't map exactly from OS to OS, but I think this is seen as > the closest equivalent. According to the Apple HIG, the area on the > right of the Menu Bar, where the power status, volume, clock etc is > "reserved for use by Apple". > > http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGMOSXEnvironment/chapter_8_section_4.html#//apple_ref/doc/uid/TP40002721-TPXREF139 > http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGMenus/chapter_17_section_4.html#//apple_ref/doc/uid/TP30000356-CHDFJEAC > > PS - there does seem to be a bug on OS X changing the Doc icon. But > otherwise it works fine. > > cheers > alex > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -- David Grandinetti (315) 569 2594 From mario at ruby-im.net Fri Mar 14 15:47:39 2008 From: mario at ruby-im.net (Mario Steele) Date: Fri, 14 Mar 2008 14:47:39 -0500 Subject: [wxruby-users] wxRIDE Finally Available In-Reply-To: References: Message-ID: Hello, On 3/14/08, Chauk-Mean P wrote: > > Hi Mario, > > 2008/3/1, Mario Steele : > > > Hello fellow wxRuby users, > > > > Well, after a long period in which I originally announced that I was > > creating an IDE, I have finally become satisfied enough to release a SVN > > Version of wxRIDE. > > > That's great. > Will you provide an archive file for wxRIDE for convenience in the future > ? > Anyway, I will have a look from my Linux box which has svn installed. I will be providing a package, along with a Setup file, that will execute, to ensure that everything that is needed is installed. But that will be after I get the initial setup done for wxRIDE. > * Implements Scintilla through StyledTextCtrl. Further syntax > highlighting > > needed, as Ruby is the only language currently implemented. > > > Does the syntax highlighting supports Ruby 1.9.0 new syntax ? > {a: "value a", b: "value b"} as an alternative for {:a => "value a", > :b => "value b" } I have no syntax validation being completed on it. If your looking for a: to be highlighted like :a, then that may be a bit of a problem, cause that is done within the Syntax Highlighting engine itself, not by code I implement into the system. It won't know the difference between symbols that start with the colon, being the same as if they end with the colon. I will have to look into that. Currently, I think that there is no editor or IDE that supports this new > syntax. > It would be great if wxRIDE was the first IDE supporting this new syntax. > > Cheers. > > Chauk-Mean. > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > I'm hoping to replace FreeRIDE, Arachno Ruby IDE, and Mondrian IDE, since all three of these use the Fox Toolkit in their design, and I've seen them all (Except for Arachno, since that's programmed in a different language), be consistently slow. Plus I'll be adding more features, then what I've listed so far for wxRIDE. A lot more. The base design is going to be as a single Application, not a modular plugin interface. Plugins however will be available to enhance the IDE. If you want to keep tabs, or learn more, feel free to subscribe to the wxRIDE User's Mailing List. L8ers, -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080314/4cb7a690/attachment.html From chauk.mean at gmail.com Fri Mar 14 17:15:47 2008 From: chauk.mean at gmail.com (Chauk-Mean P) Date: Fri, 14 Mar 2008 22:15:47 +0100 Subject: [wxruby-users] wxRIDE Finally Available In-Reply-To: References: Message-ID: Hi again, 2008/3/14, Mario Steele : > > Will you provide an archive file for wxRIDE for convenience in the future > ? > > Anyway, I will have a look from my Linux box which has svn installed. > > I will be providing a package, along with a Setup file, that will execute, > to ensure that everything that is needed is installed. But that will be > after I get the initial setup done for wxRIDE. > That's sound great. I just tried wxRIDE and it's a really nice work. The file explorer is great. In fact, wxRIDE is already more useful than SciTE thanks to this file explorer. > The base design is going to be as a > single Application, not a modular plugin interface. Plugins however will be > available to enhance the IDE. I understand that wxRIDE will be a full IDE. But what do you think about a light version of wxRIDE that would be just an enhanced SciTE ? Anyway, keep on your good work. Cheers. Chauk-Mean. From mario at ruby-im.net Fri Mar 14 17:49:12 2008 From: mario at ruby-im.net (Mario Steele) Date: Fri, 14 Mar 2008 16:49:12 -0500 Subject: [wxruby-users] wxRIDE Finally Available In-Reply-To: References: Message-ID: Hello Again, On 3/14/08, Chauk-Mean P wrote: > > Hi again, > > That's sound great. > > I just tried wxRIDE and it's a really nice work. > The file explorer is great. > In fact, wxRIDE is already more useful than SciTE thanks to this file > explorer. Thanks, I like to make things as easy as possible, yet natural to the interface of wxRIDE. I understand that wxRIDE will be a full IDE. > But what do you think about a light version of wxRIDE that would be > just an enhanced SciTE ? Well, with the design of wxRIDE that I have planned, it will be modular, where you can have it as light as you want, or as feature rich as you want it. Unfortunatly, right now my concentration is on getting things together as I want them. Then I will go back through, and re-write it, in a more modular method, through Plugins, still leaving the Editor as it is, and expand the rest through Plugins. Anyway, keep on your good work. I plan on keeping up the good work, as I've had a lot of positive feedback from people, which is keeping me encouraged, and I'm liking the final result myself. -- Mario Steele http://www.trilake.net http://www.ruby-im.net http://rubyforge.org/projects/wxruby/ http://rubyforge.org/projects/wxride/ http://rubyforge.org/projects/vwmc/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080314/cc04af4f/attachment.html From alex at pressure.to Sat Mar 15 09:49:53 2008 From: alex at pressure.to (Alex Fenton) Date: Sat, 15 Mar 2008 13:49:53 +0000 Subject: [wxruby-users] TaskBarIcon in OS X In-Reply-To: <4d27af0c0803141143h355c4639ha485360d8d53a2c1@mail.gmail.com> References: <4d27af0c0803131522g5330e8e6qee84f6ab9c0b44c5@mail.gmail.com> <47DA40C7.5070106@pressure.to> <4d27af0c0803141143h355c4639ha485360d8d53a2c1@mail.gmail.com> Message-ID: <47DBD401.7080603@pressure.to> David Grandinetti wrote: > I don't know if this is a issue better taken up with the wxWidgets > developers, but you may consider (even though the Apple HIG guidelines > frown on it) that developers will want to be able to put icons on the > right side of the menu bar. > It's something that would be implemented in wxWidgets. It's been discussed before: http://lists.wxwidgets.org/archive/wx-dev/msg40258.html but it seems to be ruled out by one of the wxWidgets OS X lead devs: http://lists.wxwidgets.org/archive/wx-dev/msg40273.html FWIW, I agree with that reasoning. If you were really certain that a menu bar icon was what you wanted, you might be able to create one using Ruby Cocoa. From that htread, looks like the relevant class is NSStatusBarItem. cheers alex From lists at ruby-forum.com Wed Mar 19 15:59:19 2008 From: lists at ruby-forum.com (Paul w Florczykowski) Date: Wed, 19 Mar 2008 20:59:19 +0100 Subject: [wxruby-users] Tearing in my buffered animation test script... In-Reply-To: <839490bc0711302028v35a8d9d5lb959762b17f115e8@mail.gmail.com> References: <839490bc0711302028v35a8d9d5lb959762b17f115e8@mail.gmail.com> Message-ID: <4fe424e11d38ff2ceab4c3a213fb5182@ruby-forum.com> Hi Jay! I have tested your application, and indeed there is great deal of flicker as expected. You are not making any particular errors in your code; the problem occurs because the drawing, or more precisely, the copying of graphics (blit) is not synchronized with the vertical sync signal your screen receives from your graphics card. (I'm speaking in terms of analog signal CRT, but actually this applies to any kind of digital screen as well, as far the application is concerned) The usual way to deal with this is: 1. Draw all the graphics onto an backbuffer (any surface that does not appear on the screen yet) 2. Await the V-blank (the vertical sync signal) 3. Copy the contents of this backbuffer onto the screen (the frontbuffer), or simply swap the buffers if your API supports it 4. repeat from 1 What you are currently doing is similar but lacks the point (2). wxRuby aims to support this on a lower level (i think). There is a method called "paint_buffered" (in stead of "paint") that provides a BufferedDC-object instead of ClientDC or DC. Drawing to the BufferedDC is then not supposed to be visible first after: 1. the actual drawing you are making on it is finally completed ie. the block provided to "buffered_paint" finishes, and 2. the V-blank occurs. Sadly enough, this feature does not seem to be working properly with wxruby 1.9.5. I have currently similar problem - have not yet decided whether to devise another method to signal V-blank to Ruby, or to accept the moderate flicker in my application. Best regards, Paul W Florczykowski -- Posted via http://www.ruby-forum.com/. From bmatthew1 at blueyonder.co.uk Thu Mar 27 16:49:59 2008 From: bmatthew1 at blueyonder.co.uk (Matthew Webb) Date: Thu, 27 Mar 2008 20:49:59 +0000 Subject: [wxruby-users] wxRuby & RubyScript2exe Message-ID: I've got wxruby (1.9.5) & rubyscript2exe (0.5.3) installed & I'm using Windows Vista. I'm trying to use rubyscript2exe to turn one of the wxruby sample programs into an .exe. The sample is in the controls folder & is called controls.rb. I use 'rubyscript2exe controls.rb --rubyscript2exe-verbose' to "compile" it. But when I try to run it I get the following error: Bitmap file does not exist: C:\Users\Matthew\eee\eee.controls.exe.4\app/icons/list.xpm (ArgumentError) Do you have any ideas how I could solve this problem? -- matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080327/50acd4a6/attachment-0001.html From alex at pressure.to Thu Mar 27 19:58:50 2008 From: alex at pressure.to (Alex Fenton) Date: Thu, 27 Mar 2008 23:58:50 +0000 Subject: [wxruby-users] wxRuby & RubyScript2exe In-Reply-To: References: Message-ID: <47EC34BA.8080307@pressure.to> Matthew Webb wrote: > I've got wxruby (1.9.5) & rubyscript2exe (0.5.3) installed & I'm using > Windows Vista. > > I'm trying to use rubyscript2exe to turn one of the wxruby sample > programs into an .exe. > > The sample is in the controls folder & is called controls.rb. > > I use 'rubyscript2exe controls.rb --rubyscript2exe-verbose' to > "compile" it. > > But when I try to run it I get the following error: > > Bitmap file does not exist: > C:\Users\Matthew\eee\eee.controls.exe.4\app/icons/list.xpm (ArgumentError) The problem is that the bitmap file isn't included in the bundled-up package that rubyscript2exe creates and later unpacks when the .exe is run. The simple way is to manually tell rubyscript2exe to add the .xpm file to the bundle. To do this, add a constant to the beginning of the file with an array of files that should be included. RUBYSCRIPT2EXE.dlls = [ 'icons/list.xpm', ... ] (Or it might be RUBYSCRIPT2EXE.libs = [...] I can't remember and can't test it right now. See http://www.erikveen.dds.nl/rubyscript2exe/#3.3.1 ) A more complex but perhaps better way for bigger apps is to build the .exe as normal, then distribute it and the icons packaged up as a zip, a tar, or using an installer like NSIS. Then, at runtime, test if the application is running from within rubyscript2exe, find out where it's installed, and load image files from that location. Wx::ArtProvider can also help here. An example of this approach below - see the part where it sets WEFT_SHAREDIR http://weft-qda.rubyforge.org/svn/trunk/weft-qda/weft-qda.rb alex From alex at pressure.to Thu Mar 27 20:17:24 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 28 Mar 2008 00:17:24 +0000 Subject: [wxruby-users] Tearing in my buffered animation test script... In-Reply-To: <4fe424e11d38ff2ceab4c3a213fb5182@ruby-forum.com> References: <839490bc0711302028v35a8d9d5lb959762b17f115e8@mail.gmail.com> <4fe424e11d38ff2ceab4c3a213fb5182@ruby-forum.com> Message-ID: <47EC3914.20006@pressure.to> Hi Paul Paul w Florczykowski wrote: > I have tested your application, and indeed there is great deal of > flicker as expected. You are not making any particular errors in your > code; the problem occurs because the drawing, or more precisely, the > copying of graphics (blit) is not synchronized with the vertical sync > signal your screen receives from your graphics card. (I'm speaking in > terms of analog signal CRT, but actually this applies to any kind of > digital screen as well, as far the application is concerned) > > The usual way to deal with this is: > > 1. Draw all the graphics onto an backbuffer (any surface that does not > appear on the screen yet) > > 2. Await the V-blank (the vertical sync signal) > > 3. Copy the contents of this backbuffer onto the screen (the > frontbuffer), or simply swap the buffers if your API supports it > > 4. repeat from 1 > I didn't know about (2), thanks for this info on buffering. > What you are currently doing is similar but lacks the point (2). wxRuby > aims to support this on a lower level (i think). There is a method > called "paint_buffered" (in stead of "paint") that provides a > BufferedDC-object instead of ClientDC or DC. Drawing to the BufferedDC > is then not supposed to be visible first after: 1. the actual drawing > you are making on it is finally completed ie. the block provided to > "buffered_paint" finishes, and 2. the V-blank occurs. > > Sadly enough, this feature does not seem to be working properly with > wxruby 1.9.5. I have currently similar problem - have not yet decided > whether to devise another method to signal V-blank to Ruby, or to accept > the moderate flicker in my application. > wxRuby 1.9.5 'paint_buffered' method does what you describe, lacking point (2). It doesn't do anything more low-level. It's implemented in pure Ruby, http://wxruby.rubyforge.org/svn/trunk/wxruby2/lib/wx/classes/window.rb but it's a straight conversion of the C++ code that wxWidgets uses to provide BufferedDC: http://svn.wxwidgets.org/viewvc/wx/wxWidgets/tags/WX_2_8_7/include/wx/dcbuffer.h?revision=52270&view=markup If you find any advice on how we can improve this by synchronising with the V-blank please post this, as this is beyond my expertise. thanks alex From bmatthew1 at blueyonder.co.uk Thu Mar 27 21:15:03 2008 From: bmatthew1 at blueyonder.co.uk (Matthew Webb) Date: Fri, 28 Mar 2008 01:15:03 +0000 Subject: [wxruby-users] wxRuby & RubyScript2exe In-Reply-To: <47EC34BA.8080307@pressure.to> References: <47EC34BA.8080307@pressure.to> Message-ID: <47EC4697.50909@blueyonder.co.uk> Alex Fenton wrote: > Matthew Webb wrote: > >> I've got wxruby (1.9.5) & rubyscript2exe (0.5.3) installed & I'm using >> Windows Vista. >> >> I'm trying to use rubyscript2exe to turn one of the wxruby sample >> programs into an .exe. >> >> The sample is in the controls folder & is called controls.rb. >> >> I use 'rubyscript2exe controls.rb --rubyscript2exe-verbose' to >> "compile" it. >> >> But when I try to run it I get the following error: >> >> Bitmap file does not exist: >> C:\Users\Matthew\eee\eee.controls.exe.4\app/icons/list.xpm (ArgumentError) >> > The problem is that the bitmap file isn't included in the bundled-up > package that rubyscript2exe creates and later unpacks when the .exe is run. > > The simple way is to manually tell rubyscript2exe to add the .xpm file > to the bundle. To do this, add a constant to the beginning of the file > with an array of files that should be included. > > RUBYSCRIPT2EXE.dlls = [ 'icons/list.xpm', ... ] > > (Or it might be RUBYSCRIPT2EXE.libs = [...] > I can't remember and can't test it right now. See > http://www.erikveen.dds.nl/rubyscript2exe/#3.3.1 ) > > A more complex but perhaps better way for bigger apps is to build the > .exe as normal, then distribute it and the icons packaged up as a zip, a > tar, or using an installer like NSIS. > > Then, at runtime, test if the application is running from within > rubyscript2exe, find out where it's installed, and load image files from > that location. Wx::ArtProvider can also help here. An example of this > approach below - see the part where it sets WEFT_SHAREDIR > > http://weft-qda.rubyforge.org/svn/trunk/weft-qda/weft-qda.rb > > alex > > > > > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > It would seem that the problem isn't 'list.xpm' not loading but 'mondrian.ico' not loading. I've added the following two lines to the beginning of 'controls.rb'... require "rubyscript2exe" RUBYSCRIPT2EXE.bin = ["mondrian.ico"] When I run the .exe I get this error... Icon file does not exist: C:\Users\Matthew\eee\eee.controls.exe.2\app/mondrian.ico (ArgumentError) It's really strange because 'mondrian.ico' is in the same folder as 'Controls.rb' so I'd expect it to be found. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080328/8e984c10/attachment.html From alex at pressure.to Fri Mar 28 02:47:30 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 28 Mar 2008 06:47:30 +0000 Subject: [wxruby-users] wxRuby & RubyScript2exe In-Reply-To: <47EC4697.50909@blueyonder.co.uk> References: <47EC34BA.8080307@pressure.to> <47EC4697.50909@blueyonder.co.uk> Message-ID: <47EC9482.1070602@pressure.to> Matthew Webb wrote: > It would seem that the problem isn't 'list.xpm' not loading but > 'mondrian.ico' not loading. > > I've added the following two lines to the beginning of 'controls.rb'... > > require "rubyscript2exe" > RUBYSCRIPT2EXE.bin = ["mondrian.ico"] > > When I run the .exe I get this error... > > Icon file does not exist: > C:\Users\Matthew\eee\eee.controls.exe.2\app/mondrian.ico (ArgumentError) > > It's really strange because 'mondrian.ico' is in the same folder as > 'Controls.rb' so I'd expect it to be found. You've put it in the 'bin' dir of the package, but controls.rb is in the 'app' dir. controls.rb loads the icon file like this: Icon.new( File.join( File.dirname(__FILE__), "mondrian.ico"), Wx::BITMAP_TYPE_ICO ) i.e. relative to its position. So it looks in the app dir, doesn't find it and gives the error you saw. You'll either need to put the icon file somewhere different in the bundle, or change that code. You might find it helpful to unpack the bundle rubyscript2exe creates to see the directory structure. See the page for more details, but basically run it with the argument ---eee-justextract alex From bmatthew1 at blueyonder.co.uk Fri Mar 28 10:52:12 2008 From: bmatthew1 at blueyonder.co.uk (Matthew Webb) Date: Fri, 28 Mar 2008 14:52:12 +0000 Subject: [wxruby-users] wxRuby & RubyScript2exe In-Reply-To: <47EC9482.1070602@pressure.to> References: <47EC34BA.8080307@pressure.to> <47EC4697.50909@blueyonder.co.uk> <47EC9482.1070602@pressure.to> Message-ID: <47ED061C.4090806@blueyonder.co.uk> Alex Fenton wrote: > Matthew Webb wrote: > >> It would seem that the problem isn't 'list.xpm' not loading but >> 'mondrian.ico' not loading. >> >> I've added the following two lines to the beginning of 'controls.rb'... >> >> require "rubyscript2exe" >> RUBYSCRIPT2EXE.bin = ["mondrian.ico"] >> >> When I run the .exe I get this error... >> >> Icon file does not exist: >> C:\Users\Matthew\eee\eee.controls.exe.2\app/mondrian.ico (ArgumentError) >> >> It's really strange because 'mondrian.ico' is in the same folder as >> 'Controls.rb' so I'd expect it to be found. >> > You've put it in the 'bin' dir of the package, but controls.rb is in the > 'app' dir. controls.rb loads the icon file like this: > > Icon.new( File.join( File.dirname(__FILE__), "mondrian.ico"), > Wx::BITMAP_TYPE_ICO ) > > i.e. relative to its position. So it looks in the app dir, doesn't find > it and gives the error you saw. You'll either need to put the icon file > somewhere different in the bundle, or change that code. > > You might find it helpful to unpack the bundle rubyscript2exe creates to > see the directory structure. See the page for more details, but > basically run it with the argument ---eee-justextract > > alex > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > Okay I've finally managed to fix the problem I was having. I found the following thread regarding rubyscript2exe & image loading... http://objectmix.com/ruby/303278-re-rubyscript2exe-cannot-put-picture-project.html If I rename the controls.rb file to init.rb & then "compile" the entire controls Directory like... C:\Users\Matthew\Desktop>rubyscript2exe controls/ it works fine. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080328/53c59523/attachment.html From jay at mcgavren.com Fri Mar 28 15:16:46 2008 From: jay at mcgavren.com (Jay McGavren) Date: Fri, 28 Mar 2008 12:16:46 -0700 Subject: [wxruby-users] Tearing in my buffered animation test script... Message-ID: <839490bc0803281216s776f6ca3k1d41ca6fe99d9878@mail.gmail.com> Paul w Florczykowski wrote: > I have tested your application, and indeed there is great > deal of flicker as expected. You are not making any > particular errors in your code; the problem occurs because > the drawing, or more precisely, the copying of graphics > (blit) is not synchronized with the vertical sync signal > your screen receives from your graphics card. (I'm speaking > in terms of analog signal CRT, but actually this applies to > any kind of digital screen as well, as far the application > is concerned) Actually, Alex Fenton and Mario Steele helped me resolve most of my flicker issues just by speeding up my drawing routine. On my Windows box the flicker is no longer noticeable, even though I don't do a vsync. I think I posted a flicker-free version of the test script to this list (check the archives), but if not you can check the source for my main app (http://jay.mcgavren.com/zyps) to see what we're currently doing. > What you are currently doing is similar but lacks the point > (2). wxRuby aims to support this on a lower level (i > think). There is a method called "paint_buffered" (in stead > of "paint") that provides a BufferedDC-object instead of > ClientDC or DC. > ... > Sadly enough, this feature does not seem to be working > properly with wxruby 1.9.5. I heard from Alex at one point that paint_buffered was working in the Subversion version, but I don't know if that's made it into a release yet. -Jay McGavren http://jay.mcgavren.com/zyps From alex at pressure.to Fri Mar 28 15:25:46 2008 From: alex at pressure.to (Alex Fenton) Date: Fri, 28 Mar 2008 19:25:46 +0000 Subject: [wxruby-users] Tearing in my buffered animation test script... In-Reply-To: <839490bc0803281216s776f6ca3k1d41ca6fe99d9878@mail.gmail.com> References: <839490bc0803281216s776f6ca3k1d41ca6fe99d9878@mail.gmail.com> Message-ID: <47ED463A.3060504@pressure.to> Jay McGavren wrote: > Paul w Florczykowski wrote: > >> Sadly enough, this feature does not seem to be working >> properly with wxruby 1.9.5. >> > > I heard from Alex at one point that paint_buffered was working in the > Subversion version, but I don't know if that's made it into a release > yet. Yep, it's in the 1.9.5 release. I'd be interested in any feedback you have on how it works with Zyps best alex From jay at mcgavren.com Fri Mar 28 15:28:16 2008 From: jay at mcgavren.com (Jay McGavren) Date: Fri, 28 Mar 2008 12:28:16 -0700 Subject: [wxruby-users] wxRuby & RubyScript2exe Message-ID: <839490bc0803281228g27ac6cd5j93c31954bb4c9f39@mail.gmail.com> Matthew Webb wrote: > Bitmap file does not exist: > C:\Users\Matthew\eee\eee.controls.exe.4\app/icons/list.xpm > (ArgumentError) > > Do you have any ideas how I could solve this problem? The problem is that this script depends on an external file, which rubyscript2exe doesn't include in the .exe (and therefore not in the eee temp folder). You'll need to employ a little cleverness to include the resource with the executable. This page talks about including library files for another GUI framework in the .exe, and should be adaptable for including resource files: http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_rubyscript2exe > require 'rubyscript2exe' > require 'fileutils' > require 'pathname' > > p0 = Pathname.new(RUBYSCRIPT2EXE.appdir) > root_runtime = p0.parent.to_s > begin > FileUtils.cp_r('run_dep/.', root_runtime) > rescue > end > > Those lines copy all the files & folders inside the > "run_dep" folder to the folder where rubyscript2exe will > extract your application. The begin/rescue is needed > because that fails when you run your application the first > time in rubyscript2exe, to create the .exe. You'll of course need to modify the path referenced in the script such that it points to the temp location that the resource gets decompressed to. BTW, overall wxRuby works *beautifully* with rubyscript2exe, which is one of my favorite features about it. -Jay McGavren From lists at ruby-forum.com Fri Mar 28 21:16:38 2008 From: lists at ruby-forum.com (Paul w Florczykowski) Date: Sat, 29 Mar 2008 02:16:38 +0100 Subject: [wxruby-users] Tearing in my buffered animation test script... In-Reply-To: <47ED463A.3060504@pressure.to> References: <839490bc0803281216s776f6ca3k1d41ca6fe99d9878@mail.gmail.com> <47ED463A.3060504@pressure.to> Message-ID: Thanks for your replies. Well I assumed double buffering automatically implies vertical sync, but ofcourse it actually means drawing on offscreen buffer first; with or without vsync..- While I'm rather new to both Ruby and WxRuby (and for that matter to any GUI toolkit at all:) I have done my share of programming graphics using Direct3D and other APIs specifically designed for that. In that world there is almost always some easy way to synchronize the actual copy or buffer swap with the vertical blank period of the screen. For example the Present(...) method of the rendering device interface in DirectX 9, automatically waits for the V-blank period before it swaps buffers, provided it is called with correct arguments. And since I come from there I was kind of expecting similar solutions for any kind of graphics. However after doing some research I realized that the opposite holds for the world of GUI APIs. On Windows (XP at least, don't know about Vista) it seems very hard to get any info about the current position of the electron ray from the OS, unless working with either DirectX, OpenGL or directly with the graphics driver. And that is probably the right approach unless one is generating a lot of fast changing screen content at high framerates - because first then the shearing will be noticeable unless vertiacally synced. As for my own WxRuby-learning-application, I'm also completely satisfied with copying to the frontbuffer without the vsync, feel free to take a look: http://web.comhem.se/paul/triplot . The shearing is there, but I have to look very hard to see it. When I saw info on the paint_buffered method that stated it was there to faciliate flicker-free drawing I assumed it was supposed to be vertically synced just because of a preconception, sorry about that. And... I took a look at the Zyps application (really cool). As you say, there is no visible shearing. -- Posted via http://www.ruby-forum.com/. From bmatthew1 at blueyonder.co.uk Fri Mar 28 21:18:34 2008 From: bmatthew1 at blueyonder.co.uk (Matthew Webb) Date: Sat, 29 Mar 2008 01:18:34 +0000 Subject: [wxruby-users] wxRuby & RubyScript2exe In-Reply-To: <839490bc0803281228g27ac6cd5j93c31954bb4c9f39@mail.gmail.com> References: <839490bc0803281228g27ac6cd5j93c31954bb4c9f39@mail.gmail.com> Message-ID: <47ED98EA.9010008@blueyonder.co.uk> Jay McGavren wrote: > Matthew Webb wrote: > >> Bitmap file does not exist: >> C:\Users\Matthew\eee\eee.controls.exe.4\app/icons/list.xpm >> (ArgumentError) >> >> Do you have any ideas how I could solve this problem? >> > > The problem is that this script depends on an external file, which > rubyscript2exe doesn't include in the .exe (and therefore not in the > eee temp folder). You'll need to employ a little cleverness to > include the resource with the executable. > > This page talks about including library files for another GUI > framework in the .exe, and should be adaptable for including resource > files: > > http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_rubyscript2exe > > >> require 'rubyscript2exe' >> require 'fileutils' >> require 'pathname' >> >> p0 = Pathname.new(RUBYSCRIPT2EXE.appdir) >> root_runtime = p0.parent.to_s >> begin >> FileUtils.cp_r('run_dep/.', root_runtime) >> rescue >> end >> >> Those lines copy all the files & folders inside the >> "run_dep" folder to the folder where rubyscript2exe will >> extract your application. The begin/rescue is needed >> because that fails when you run your application the first >> time in rubyscript2exe, to create the .exe. >> > > You'll of course need to modify the path referenced in the script such > that it points to the temp location that the resource gets > decompressed to. > > BTW, overall wxRuby works *beautifully* with rubyscript2exe, which is > one of my favorite features about it. > > -Jay McGavren > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > Thanks for the advice, I placed the following code at the start of the program... require 'rubyscript2exe' require 'fileutils' require 'pathname' p0 = Pathname.new(RUBYSCRIPT2EXE.appdir) root_runtime = p0.parent.to_s begin FileUtils.cp_r('run_dep/.', root_runtime) rescue end I changed this line from... icon_file = File.join( File.dirname(__FILE__), "mondrian.png") to... icon_file = File.join( File.dirname(RUBYSCRIPT2EXE.appdir), "mondrian.png") Then I created a folder called 'run_dep' where the script was located & I placed the icons in that folder. The script was "compiled" with 'rubyscript2exe minimal.rb --rubyscript2exe-rubyw' When I executed it the icons loaded & the program worked. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20080329/597e2409/attachment.html From awarrier at berkeley.edu Mon Mar 31 12:26:30 2008 From: awarrier at berkeley.edu (Ajithkumar Warrier) Date: Mon, 31 Mar 2008 09:26:30 -0700 Subject: [wxruby-users] How to search the mailing list? Message-ID: <77d2136d0803310926u1a54ab2cs52a458858d59d59d@mail.gmail.com> Hi, I haven't been able to figure out how to search the mailing list for specific keywords. I would appreciate any pointers in this direction. Thanks warrior From alex at pressure.to Mon Mar 31 12:39:26 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 31 Mar 2008 17:39:26 +0100 Subject: [wxruby-users] How to search the mailing list? In-Reply-To: <77d2136d0803310926u1a54ab2cs52a458858d59d59d@mail.gmail.com> References: <77d2136d0803310926u1a54ab2cs52a458858d59d59d@mail.gmail.com> Message-ID: <47F113BE.20400@pressure.to> Hi Ajithkumar Warrier wrote: > I haven't been able to figure out how to search the mailing list for > specific keywords. > I would appreciate any pointers in this direction. > There's no dedicated search function for the wxruby-users mailing lists but if you search google for something like "wxruby-users" + keyword "site:rubyforge.org wxruby" + keyword it has pretty much the same effect alex From awarrier at berkeley.edu Mon Mar 31 12:52:24 2008 From: awarrier at berkeley.edu (Ajithkumar Warrier) Date: Mon, 31 Mar 2008 09:52:24 -0700 Subject: [wxruby-users] How to search the mailing list? In-Reply-To: <47F113BE.20400@pressure.to> References: <77d2136d0803310926u1a54ab2cs52a458858d59d59d@mail.gmail.com> <47F113BE.20400@pressure.to> Message-ID: <77d2136d0803310952i6c78fde3l237f7f446d008d08@mail.gmail.com> Thanks, I'll try it On Mon, Mar 31, 2008 at 9:39 AM, Alex Fenton wrote: > Hi > > > > Ajithkumar Warrier wrote: > > I haven't been able to figure out how to search the mailing list for > > specific keywords. > > I would appreciate any pointers in this direction. > > > There's no dedicated search function for the wxruby-users mailing lists > but if you search google for something like > > "wxruby-users" + keyword > "site:rubyforge.org wxruby" + keyword > > it has pretty much the same effect > > alex > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From awarrier at berkeley.edu Mon Mar 31 13:01:43 2008 From: awarrier at berkeley.edu (Ajithkumar Warrier) Date: Mon, 31 Mar 2008 10:01:43 -0700 Subject: [wxruby-users] Mouse motion example - help Message-ID: <77d2136d0803311001q38fe28bfpe974c1c5155fceb5@mail.gmail.com> Hi, I am trying out this example adapted from the wxpython book, but the mouse motion event does not seem to be captured right. What am I doing wrong? Thanks warrior # code below require 'wx' class MyFrame < Wx::Frame def initialize super(nil, -1, "My Frame", :size => [300,300]) @my_panel = Wx::Panel.new(self, -1) evt_motion(){ |event| on_move(event)} Wx::StaticText.new(@my_panel, -1, :label => "Pos:", :pos => [10, 12]) @posCtrl = Wx::TextCtrl.new(@my_panel, -1, "",:pos => [40, 10]) show end def on_move(event) @pos = event.get_position @posCtrl.change_value("#{@pos}") end end Wx::App.run{MyFrame.new} From alex at pressure.to Mon Mar 31 16:28:25 2008 From: alex at pressure.to (Alex Fenton) Date: Mon, 31 Mar 2008 21:28:25 +0100 Subject: [wxruby-users] Mouse motion example - help In-Reply-To: <77d2136d0803311001q38fe28bfpe974c1c5155fceb5@mail.gmail.com> References: <77d2136d0803311001q38fe28bfpe974c1c5155fceb5@mail.gmail.com> Message-ID: <47F14969.8000504@pressure.to> Ajithkumar Warrier wrote: > I am trying out this example adapted from the wxpython book, but the > mouse motion event does not seem to be captured right. The mouse movement event is directed to the topmost window. So you either need to specify that mouse events are captured by the Frame, or call the event handler upon the panel which is topmost. If you think this is different to wxPython, could you post/point to the example you mention please? > # code below > require 'wx' > > class MyFrame < Wx::Frame > def initialize > super(nil, -1, "My Frame", :size => [300,300]) > @my_panel = Wx::Panel.new(self, -1) > evt_motion(){ |event| on_move(event)} > Either: @my_panel.evt_motion { | e | on_move(e) } or capture_mouse evt_motion :on_move > Wx::StaticText.new(@my_panel, -1, :label => "Pos:", :pos => [10, 12]) > @posCtrl = Wx::TextCtrl.new(@my_panel, -1, "",:pos => [40, 10]) > show > end > > def on_move(event) > @pos = event.get_position > @posCtrl.change_value("#{@pos}") > end > end > Wx::App.run{MyFrame.new} cheeers alex From awarrier at berkeley.edu Mon Mar 31 16:37:55 2008 From: awarrier at berkeley.edu (Ajithkumar Warrier) Date: Mon, 31 Mar 2008 13:37:55 -0700 Subject: [wxruby-users] Mouse motion example - help In-Reply-To: <47F14969.8000504@pressure.to> References: <77d2136d0803311001q38fe28bfpe974c1c5155fceb5@mail.gmail.com> <47F14969.8000504@pressure.to> Message-ID: <77d2136d0803311337o18e4b97fy608665cc4ed0374e@mail.gmail.com> Thanks, your suggestion worked. I missed out on the fact that I had to bind the mouse motion to the panel and not to MyFrame. So, @my_panel.evt_motion worked exactly as needed. On Mon, Mar 31, 2008 at 1:28 PM, Alex Fenton wrote: > Ajithkumar Warrier wrote: > > I am trying out this example adapted from the wxpython book, but the > > mouse motion event does not seem to be captured right. > The mouse movement event is directed to the topmost window. So you > either need to specify that mouse events are captured by the Frame, or > call the event handler upon the panel which is topmost. > > If you think this is different to wxPython, could you post/point to the > example you mention please? > > > # code below > > require 'wx' > > > > class MyFrame < Wx::Frame > > def initialize > > super(nil, -1, "My Frame", :size => [300,300]) > > @my_panel = Wx::Panel.new(self, -1) > > evt_motion(){ |event| on_move(event)} > > > Either: > > @my_panel.evt_motion { | e | on_move(e) } > > or > > capture_mouse > evt_motion :on_move > > > Wx::StaticText.new(@my_panel, -1, :label => "Pos:", :pos => [10, 12]) > > @posCtrl = Wx::TextCtrl.new(@my_panel, -1, "",:pos => [40, 10]) > > show > > end > > > > def on_move(event) > > @pos = event.get_position > > @posCtrl.change_value("#{@pos}") > > end > > end > > Wx::App.run{MyFrame.new} > > cheeers > alex > > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >