From roys at mindspring.com Mon Aug 1 00:35:37 2005 From: roys at mindspring.com (Roy Sutton) Date: Mon Aug 1 00:30:00 2005 Subject: [Wxruby-users] SWIG compilation In-Reply-To: <42ED85FB.8020303@qualitycode.com> References: <42EC510F.1030305@mindspring.com> <42ECF816.8030009@qualitycode.com> <42ED3A5E.8070905@mindspring.com> <42ED85FB.8020303@qualitycode.com> Message-ID: <42EDA699.1030406@mindspring.com> OK, my problems are entirely related to swigging wx.i. When I swig it, I don't get the #define SWIG_GLOBAL 1 line and all the defs for the missing externals. If I unpack the .cpp and .h files and touch them I can get the library to compile. I'll do some more work with it this week. Roy Kevin Smith wrote: > Roy Sutton wrote: > >> I was a baaaaad boy. I just overlaid my last tarball with the most >> recent one. I really /should/ know better. I completely wiped my >> wxruby2 directory, but saved my modified rakemswin. It still doesn't >> work and still callls swig during compilation. It swigs the >> following file now: >> >> swig -runtime -w401 -w801 -w515 -c++ -ruby -o src/wx.cpp swig/wx.i >> SWIG(1): Warning(120): -c, -runtime, -noruntime command line options >> are deprecated. >> ruby swig/renamer.rb src/wx.cpp >> ruby swig/fixmainmodule.rb src/wx.cpp > > > Hm. Perhaps wx.i changed, but wx.h/cpp didn't, so my CVS didn't update > the src/ files, but rake on your system doesn't realize they haven't > changed. Ugh. Maybe I need to somehow tell CVS to check src/ in if any > files have been touched, even if they haven't changed. I wonder if > there's a way to do that on a per-directory basis. > >> The link still fails at the end with all the _SWIG_Ruby_* undefined >> external symbols. This is with Ruby 1.8. I won't have any time >> tonight to look over this and my time is somewhat limited the early >> part of the week. > > > That really sounds like it's not linking in swig itself. Can we see > the link command that's being executed? > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From jani.monoses at gmail.com Mon Aug 1 05:24:41 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Mon Aug 1 05:18:53 2005 Subject: [Wxruby-users] wxruby2: wx 2.6 only? Ubuntu wx 2.6 package? (was: Can't compile the cvs-tree) In-Reply-To: <42ECF997.60006@qualitycode.com> References: <42EBF9F2.30505@xs4all.nl> <42EC0D7B.1020907@qualitycode.com> <42ECB239.50603@xs4all.nl> <42ECF997.60006@qualitycode.com> Message-ID: <29e1155305080102245ec7440d@mail.gmail.com> > Ok. I'm almost convinced that we should go with wx 2.6. Are there any > volunteers to build an Ubuntu package that I could host? If not, I'll > have to fumble through it myself, but assuming I can get it working, > I'll drop 2.5 and everything will get much simpler. wx-2.6.1 was just uploaded to ubuntu breezy, so I think it's ok to drop 2.5 support if it eases things. Jani From jani.monoses at gmail.com Mon Aug 1 11:43:10 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Mon Aug 1 11:37:21 2005 Subject: [Wxruby-users] unicode and log messages Message-ID: <29e11553050801084362d82c6d@mail.gmail.com> Another place where utf8 fixes are needed. samples/dialogs/dialogs.rb and hit Ctrl-L or chose Log Dialog in the menu. Jani -------------- next part -------------- A non-text attachment was scrubbed... Name: ,l.diff Type: text/x-patch Size: 1352 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050801/b08924a4/l.bin From sean.m.long at gmail.com Mon Aug 1 14:25:03 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 1 14:19:13 2005 Subject: [Wxruby-users] Patch for wxRuby2 In-Reply-To: <42E86CB6.1060006@qualitycode.com> References: <42E86CB6.1060006@qualitycode.com> Message-ID: > > - Changed line 5 of wx.i from wxruby2 to wx, could not get wxruby2 to > > work. I also > > changed line 13 in fixmodule.rb to mWx and line 11 in > > fixmainmodule.rb to mWx from mWxruby2. > > Also changed mWx in functions.i and XmlResource.i > Let's figure this one out. I really want the module to be wxruby2, not > wx, so I didn't apply your changes. Perhaps you just needed to do 'rake > clean_src' to clear out all the old files that still referred to wx? Ok I found the problem and it has nothing to do with what I changed ;). The problem is the Makefile generated by extconf.rb for Windows. The problem is from create_makefile("wx") which makes the following in the Makefile: $(DEFFILE): $(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'" > $@ where TARGET is wx specified in create_makefile("wx") If I change create_makefile to create_makefile("wxruby2") it compiles smoothly, but then the generated library is wxruby2.so not wx.so. Any ideas on how to fix this correctly? Sean From sean.m.long at gmail.com Mon Aug 1 17:07:47 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 1 17:01:57 2005 Subject: [Wxruby-users] Patch for wxRuby2 In-Reply-To: References: <42E86CB6.1060006@qualitycode.com> Message-ID: I figured out a simple fix, just wanted to get some feedback on it before moving on to something else. put the following: #fix for Makefile on Windows contents = File.read("Makefile") contents = contents.gsub('Init_$(TARGET)','Init_wxruby2') File.open("Makefile","w+") do |f| f.write contents end after previous code in if $WXDIR != nil end which is in extconf.rb Sean On 8/1/05, Sean Long wrote: > > > - Changed line 5 of wx.i from wxruby2 to wx, could not get wxruby2 to > > > work. I also > > > changed line 13 in fixmodule.rb to mWx and line 11 in > > > fixmainmodule.rb to mWx from mWxruby2. > > > Also changed mWx in functions.i and XmlResource.i > > > Let's figure this one out. I really want the module to be wxruby2, not > > wx, so I didn't apply your changes. Perhaps you just needed to do 'rake > > clean_src' to clear out all the old files that still referred to wx? > > Ok I found the problem and it has nothing to do with what I changed > ;). The problem is the Makefile generated by extconf.rb for Windows. > The problem is from create_makefile("wx") which makes the following in > the Makefile: > > $(DEFFILE): > $(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'" > $@ > > where TARGET is wx specified in create_makefile("wx") > > If I change create_makefile to create_makefile("wxruby2") it compiles > smoothly, but then the generated library is wxruby2.so not wx.so. > > Any ideas on how to fix this correctly? > > Sean > From wxruby at qualitycode.com Mon Aug 1 18:33:45 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 1 18:28:06 2005 Subject: [Wxruby-users] Patch for wxRuby2 In-Reply-To: References: <42E86CB6.1060006@qualitycode.com> Message-ID: <42EEA349.2000106@qualitycode.com> Sean Long wrote: > I figured out a simple fix, just wanted to get some feedback on it > before moving on to something else. > > put the following: > #fix for Makefile on Windows > contents = File.read("Makefile") > contents = contents.gsub('Init_$(TARGET)','Init_wxruby2') > File.open("Makefile","w+") do |f| > f.write contents > end > > after previous code in > if $WXDIR != nil > > end > > which is in extconf.rb I can live with that (can you send it as a patch?)...but what would it take to persuade you to stop using extconf.rb? Kevin From sean.m.long at gmail.com Mon Aug 1 18:34:22 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 1 18:28:33 2005 Subject: [Wxruby-users] Patch for wxRuby2 In-Reply-To: References: <42E86CB6.1060006@qualitycode.com> Message-ID: Disregard the last fix, it compiled but did not actually work. I think I figured out a better solution. create_makefile("wxruby2") if $WXDIR != nil File.open("Makefile","ab+") {|f| f.print " wx.res : wx.rc \trc -I#$WXINC wx.rc " #used to install wx.rb wrapper f.print " wrapper_install: \t@$(INSTALL_PROG) ../lib/wx.rb $(RUBYLIBDIR) " } #fix for Makefile to install wx.rb wrapper contents = File.read("Makefile") contents = contents.gsub('install: $(RUBYARCHDIR)','install: wrapper_install $(RUBYARCHDIR)') File.open("Makefile","w+") do |f| f.write contents end end works great on Windows and should be 100% cross platform. Sean From sean.m.long at gmail.com Mon Aug 1 19:33:01 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 1 19:27:14 2005 Subject: [Wxruby-users] Patch for wxRuby2 In-Reply-To: References: <42E86CB6.1060006@qualitycode.com> <42EEA349.2000106@qualitycode.com> Message-ID: (resending to group, where I ment to send the first time) Not much ;) Do you compile and install with rake? If that is the way to go I will need to move some of my changes to the Windows specific rake file. On 8/1/05, Sean Long wrote: > Not much ;) > > Do you compile and install with rake? If that is the way to go I will > need to move some of my changes to the Windows specific rake file. > > Sean > > On 8/1/05, Kevin Smith wrote: > > Sean Long wrote: > > > I figured out a simple fix, just wanted to get some feedback on it > > > before moving on to something else. > > > > > > put the following: > > > #fix for Makefile on Windows > > > contents = File.read("Makefile") > > > contents = contents.gsub('Init_$(TARGET)','Init_wxruby2') > > > File.open("Makefile","w+") do |f| > > > f.write contents > > > end > > > > > > after previous code in > > > if $WXDIR != nil > > > > > > end > > > > > > which is in extconf.rb > > > > I can live with that (can you send it as a patch?)...but what would it > > take to persuade you to stop using extconf.rb? > > > > Kevin > > > From sean.m.long at gmail.com Mon Aug 1 20:36:42 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 1 20:30:52 2005 Subject: [Wxruby-users] Patch for wxRuby2 In-Reply-To: References: <42E86CB6.1060006@qualitycode.com> <42EEA349.2000106@qualitycode.com> Message-ID: Well I got wxruby2 compiling on Windows using rake instead of extconf.rb, so the previous few messages are no longer needed. I still need to update my local copy with changes in HEAD then I will make a patch. Sean On 8/1/05, Sean Long wrote: > (resending to group, where I ment to send the first time) > > Not much ;) > > Do you compile and install with rake? If that is the way to go I will > need to move some of my changes to the Windows specific rake file. > > On 8/1/05, Sean Long wrote: > > Not much ;) > > > > Do you compile and install with rake? If that is the way to go I will > > need to move some of my changes to the Windows specific rake file. > > > > Sean > > > > On 8/1/05, Kevin Smith wrote: > > > Sean Long wrote: > > > > I figured out a simple fix, just wanted to get some feedback on it > > > > before moving on to something else. > > > > > > > > put the following: > > > > #fix for Makefile on Windows > > > > contents = File.read("Makefile") > > > > contents = contents.gsub('Init_$(TARGET)','Init_wxruby2') > > > > File.open("Makefile","w+") do |f| > > > > f.write contents > > > > end > > > > > > > > after previous code in > > > > if $WXDIR != nil > > > > > > > > end > > > > > > > > which is in extconf.rb > > > > > > I can live with that (can you send it as a patch?)...but what would it > > > take to persuade you to stop using extconf.rb? > > > > > > Kevin > > > > > > From roys at mindspring.com Mon Aug 1 22:12:42 2005 From: roys at mindspring.com (Roy Sutton) Date: Mon Aug 1 22:07:04 2005 Subject: [Wxruby-users] Backwards compatability Message-ID: <42EED69A.3080302@mindspring.com> In doing my testing I'm wondering if maintaining backwards compatability for existing applications is important. The question boils down to this: Are there sufficient applications that are using wxRuby (pre swig) that we should expect to have to support all/most without changes or should we expect that most applications will need to learn the 'new' ways things work in wxruby2? Already, existing applications will have to change the require line. Roy From wxruby at qualitycode.com Mon Aug 1 22:20:02 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 1 22:14:21 2005 Subject: [Wxruby-users] Backwards compatability In-Reply-To: <42EED69A.3080302@mindspring.com> References: <42EED69A.3080302@mindspring.com> Message-ID: <42EED852.6040309@qualitycode.com> Roy Sutton wrote: > In doing my testing I'm wondering if maintaining backwards compatability > for existing applications is important. I believe a few incompatibilities will be inevitable. I would prefer to keep them to a minimum, and hope to document them well. Have you spotted any glaring incompatibilities so far? The README already lists a handful of relatively minor tweaks. For existing wxruby 0.6 apps, the require 'wx' thing could be worked around by having a wxruby.rb file that requires 'wx'. However, that wouldn't fix any incompatibilities, so I don't really recommend it. It might only be helpful in cases where you *can't* modify the app source code for some reason. Kevin From wxruby at qualitycode.com Mon Aug 1 22:23:41 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 1 22:18:01 2005 Subject: [Wxruby-users] Patch for wxRuby2 In-Reply-To: References: <42E86CB6.1060006@qualitycode.com> <42EEA349.2000106@qualitycode.com> Message-ID: <42EED92D.2090207@qualitycode.com> Sean Long wrote: > Well I got wxruby2 compiling on Windows using rake instead of > extconf.rb, so the previous few messages are no longer needed. I still > need to update my local copy with changes in HEAD then I will make a > patch. Sweet. >>Do you compile and install with rake? If that is the way to go I will >>need to move some of my changes to the Windows specific rake file. I don't think our rakefile has an 'install' target yet. It's on my TODO list, but I wouldn't reject a nice patch that adds it ;-) I don't think I can delete extconf.rb until we have rake install working. I'm not sure how much would be different installing on the different platforms. Perhaps we should start by having all the code independently in each platform rakefile, and once it's working on all platforms, try to merge out whatever common parts we can find. Kevin From assaph at gmail.com Mon Aug 1 22:37:48 2005 From: assaph at gmail.com (Assaph Mehr) Date: Mon Aug 1 22:31:59 2005 Subject: [Wxruby-users] Backwards compatability In-Reply-To: <42EED852.6040309@qualitycode.com> References: <42EED69A.3080302@mindspring.com> <42EED852.6040309@qualitycode.com> Message-ID: <3ff47be905080119374f73ed9c@mail.gmail.com> Caveat: I haven't done wxruby related stuff for a while. > > In doing my testing I'm wondering if maintaining backwards compatability > > for existing applications is important. > > I believe a few incompatibilities will be inevitable. I would prefer to > keep them to a minimum, and hope to document them well. Have you spotted > any glaring incompatibilities so far? The README already lists a handful > of relatively minor tweaks. Actually, if you're going from 0.x to 2.0, it's better to break as many things as necessary. It'll be a lot easier now (with an obvious major change) rather than discovering more changes later. Just my two cents. Cheers, Assaph From roys at mindspring.com Tue Aug 2 00:02:51 2005 From: roys at mindspring.com (Roy Sutton) Date: Mon Aug 1 23:57:20 2005 Subject: [Wxruby-users] Backwards compatability In-Reply-To: <42EED852.6040309@qualitycode.com> References: <42EED69A.3080302@mindspring.com> <42EED852.6040309@qualitycode.com> Message-ID: <42EEF06B.1090001@mindspring.com> I've made it through about half the old samples (the ones from wxruby). The following samples work just fine (as far as I can tell) on Windows/latest tarball without modifying anything other than the require line: CARET\CARET (Already in wxruby2 samples) ETC\TEST6 ETC\TEST7 ETC\TEST9 ETC\TEST11 ETC\TEST12 ETC\TEST13 ETC\TEST14 ETC\TEST15 ETC\EVENTS ETC\MINIMAL Roy Kevin Smith wrote: > Roy Sutton wrote: > >> In doing my testing I'm wondering if maintaining backwards >> compatability for existing applications is important. > > > I believe a few incompatibilities will be inevitable. I would prefer > to keep them to a minimum, and hope to document them well. Have you > spotted any glaring incompatibilities so far? The README already lists > a handful of relatively minor tweaks. > > For existing wxruby 0.6 apps, the require 'wx' thing could be worked > around by having a wxruby.rb file that requires 'wx'. However, that > wouldn't fix any incompatibilities, so I don't really recommend it. It > might only be helpful in cases where you *can't* modify the app source > code for some reason. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From jani.monoses at gmail.com Tue Aug 2 04:37:16 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Tue Aug 2 04:31:25 2005 Subject: [Wxruby-users] compile fix for wx2.6 Message-ID: <29e11553050802013763faec77@mail.gmail.com> building on ubuntu with wx2.6 gives only one error: an argument type has changed from long to wxBitmapType in a constructor of the wxIcon class. These changes were needed to fix the build. This brings up the question what is the status of the swig/classes/include files which were generated using the xml extract script which is no longer available in CVS. Should that script be rerun using wx2.6 headers? Jani -------------- next part -------------- A non-text attachment was scrubbed... Name: ,l.diff Type: application/octet-stream Size: 0 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050802/727b466a/l.obj From jani.monoses at gmail.com Tue Aug 2 04:39:12 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Tue Aug 2 04:33:34 2005 Subject: [Wxruby-users] wxchoice broken on linux Message-ID: <29e1155305080201397d6fa02f@mail.gmail.com> The recent changes for windows in choice.i (not the unicode change) broke the etc/choice.rb and the controls/controls.rb tests. ../samples/etc/choice.rb:12:in `initialize': No matching function for overloaded 'new_wxChoice' (ArgumentError) Jani From nochoice at xs4all.nl Tue Aug 2 07:02:28 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Tue Aug 2 06:46:48 2005 Subject: [Wxruby-users] compile fix for wx2.6 In-Reply-To: <29e11553050802013763faec77@mail.gmail.com> References: <29e11553050802013763faec77@mail.gmail.com> Message-ID: <42EF52C4.90302@xs4all.nl> Your .diff was empty so I'm re-sending it :) Jonathan Jani Monoses wrote: >building on ubuntu with wx2.6 gives only one error: >an argument type has changed from long to wxBitmapType in a >constructor of the wxIcon class. >These changes were needed to fix the build. > >This brings up the question what is the status of the >swig/classes/include files which were generated using the xml extract >script which is no longer available in CVS. >Should that script be rerun using wx2.6 headers? > >Jani > > >------------------------------------------------------------------------ > >_______________________________________________ >wxruby-users mailing list >wxruby-users@rubyforge.org >http://rubyforge.org/mailman/listinfo/wxruby-users > > -------------- next part -------------- 29c29 < long type = wxBITMAP_TYPE_ICO_RESOURCE, --- > wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE, From jani.monoses at gmail.com Tue Aug 2 07:22:48 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Tue Aug 2 07:16:58 2005 Subject: [Wxruby-users] compile fix for wx2.6 In-Reply-To: <42EF52C4.90302@xs4all.nl> References: <29e11553050802013763faec77@mail.gmail.com> <42EF52C4.90302@xs4all.nl> Message-ID: <29e11553050802042223668824@mail.gmail.com> thanks , now I know that between attaching a file and actually sending it from the web interface one must not accidentally delete said file :) I attach the original diff again, it contains a change in the .i file as well. Jani On 8/2/05, Jonathan Maasland wrote: > Your .diff was empty so I'm re-sending it :) > > Jonathan > > Jani Monoses wrote: > > >building on ubuntu with wx2.6 gives only one error: > >an argument type has changed from long to wxBitmapType in a > >constructor of the wxIcon class. > >These changes were needed to fix the build. > > > >This brings up the question what is the status of the > >swig/classes/include files which were generated using the xml extract > >script which is no longer available in CVS. > >Should that script be rerun using wx2.6 headers? > > > >Jani > > > > > >------------------------------------------------------------------------ > > > >_______________________________________________ > >wxruby-users mailing list > >wxruby-users@rubyforge.org > >http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > > > 29c29 > < long type = wxBITMAP_TYPE_ICO_RESOURCE, > --- > > wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE, > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: ,l.diff Type: text/x-patch Size: 1226 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050802/d0960984/l.bin From nochoice at xs4all.nl Tue Aug 2 08:02:33 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Tue Aug 2 07:46:51 2005 Subject: [Wxruby-users] Small fix for rake/rakelinux.rb Message-ID: <42EF60D9.40405@xs4all.nl> I just compiled wxwindows 2.6.1 with debug support. After looking at rakelinux.rb I thought, "let's set $debug to true". Setting it to true however caused a failure when linking. It was looking for the wrong libs. Removing the $debug block fixed the problem, ie. this code is no longer needed: $debug = false if($debug) $wx_libs.sub!(/lwx_gtk/, 'lwx_gtkd') end Should someone have wx installed with AND without debug-support I think it's their responsibility to correctly link wx-config to whatever they wish to use. Hope this helps Jonathan -------------- next part -------------- 14,18d13 < $debug = false < if($debug) < $wx_libs.sub!(/lwx_gtk/, 'lwx_gtkd') < end < --- rake/rakelinux.rb 2005-07-25 01:32:01.000000000 +0200 +++ ../wxr2-tree/wxruby2/rake/rakelinux.rb 2005-08-02 13:35:29.000000000 +0200 @@ -11,11 +11,6 @@ $extra_ldflags = '-shared' -$debug = false -if($debug) - $wx_libs.sub!(/lwx_gtk/, 'lwx_gtkd') -end - # this isn't implemented yet, but as of 2005-07-24 # it worked on Ubuntu with wxgtk-2.5.3 if($link_wx_statically) From sean.m.long at gmail.com Tue Aug 2 02:51:04 2005 From: sean.m.long at gmail.com (Sean Long) Date: Tue Aug 2 09:48:22 2005 Subject: [Wxruby-users] Rake patch Message-ID: This patch fixes the following: - You can now use rake to build on Windows. - You can now use rake install to install the lib, no more extconf.rb needed! This should be cross platform, I took some code for installing from the Makefile that extconf.rb generated as a basis. I have tested it on OS X and will test tomorrow on Windows, I am 95% it will work cross platform. - I did get Windows compiling correctly with module named wxruby2 instead of wx. The problem was in extconf.rb so this fix is pretty useless now. I believe that is it, trying to make smaller patches for Kevin. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: wxruby2_08_01_2005.patch Type: application/octet-stream Size: 128979 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050801/14c3f612/wxruby2_08_01_2005-0001.obj From sean.m.long at gmail.com Tue Aug 2 12:28:38 2005 From: sean.m.long at gmail.com (Sean Long) Date: Tue Aug 2 12:22:46 2005 Subject: [Wxruby-users] Re: Rake patch In-Reply-To: References: Message-ID: It does work fine on Windows. Sean On 8/1/05, Sean Long wrote: > This patch fixes the following: > > - You can now use rake to build on Windows. > - You can now use rake install to install the lib, no more extconf.rb > needed! This should be cross platform, I took some code for installing > from the Makefile that extconf.rb generated as a basis. I have tested > it on OS X and will test tomorrow on Windows, I am 95% it will work > cross platform. > - I did get Windows compiling correctly with module named wxruby2 > instead of wx. The problem was in extconf.rb so this fix is pretty > useless now. > > I believe that is it, trying to make smaller patches for Kevin. > > Sean > > > From sean.m.long at gmail.com Tue Aug 2 13:08:25 2005 From: sean.m.long at gmail.com (Sean Long) Date: Tue Aug 2 13:02:34 2005 Subject: [Wxruby-users] Patch to move XmlResource back to classes Message-ID: This patch is to move XmlResource.i back under classes. You need to remove the XmlResource.i file under the swig directory and you need to remove the Xrc.i file as it is no longer needed. I made this patch against HEAD so it includes the previous patch since HEAD has not been updated yet. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: wxruby2_08_02_2005.patch Type: application/octet-stream Size: 19477 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050802/9069901f/wxruby2_08_02_2005-0001.obj -------------- next part -------------- # Copyright 2004 by Kevin Smith # released under the wxWidgets license # as part of the wxRuby project %module(directors="1") wxXmlResource %include "../common.i" %{ #include %} %rename(LoadDialogSubclass) wxXmlResource::LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString &name); %rename(LoadPanelSubclass) wxXmlResource::LoadPanel(wxPanel *pan, wxWindow *parent, wxString &name); %rename(LoadFrameSubclass) wxXmlResource::LoadFrame(wxFrame *frame, wxWindow *parent, const wxString &name); %include "include/wxXmlResource.h" From wxruby at qualitycode.com Tue Aug 2 21:08:53 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 2 21:03:08 2005 Subject: [Wxruby-users] Backwards compatability In-Reply-To: <3ff47be905080119374f73ed9c@mail.gmail.com> References: <42EED69A.3080302@mindspring.com> <42EED852.6040309@qualitycode.com> <3ff47be905080119374f73ed9c@mail.gmail.com> Message-ID: <42F01925.4090003@qualitycode.com> Assaph Mehr wrote: > > Actually, if you're going from 0.x to 2.0, it's better to break as > many things as necessary. It'll be a lot easier now (with an obvious > major change) rather than discovering more changes later. > Just my two cents. True. But since this is just a wrapper library, theoretically we shouldn't need to break much now, or later. We are taking advantage of this shift to jump from wx 2.4 to wx 2.6, and also to rename the shared library files. We'll also probably drop a few classes that were wrapped in wxRuby 0.6 but have better alternatives available in the ruby standard library. Cheers, Kevin From wxruby at qualitycode.com Tue Aug 2 22:21:06 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 2 22:15:26 2005 Subject: [Wxruby-users] wxruby2: wx 2.6 only? Ubuntu wx 2.6 package? In-Reply-To: <29e1155305080102245ec7440d@mail.gmail.com> References: <42EBF9F2.30505@xs4all.nl> <42EC0D7B.1020907@qualitycode.com> <42ECB239.50603@xs4all.nl> <42ECF997.60006@qualitycode.com> <29e1155305080102245ec7440d@mail.gmail.com> Message-ID: <42F02A12.6000901@qualitycode.com> Jani Monoses wrote: > wx-2.6.1 was just uploaded to ubuntu breezy, so I think it's ok to > drop 2.5 support if it eases things. > Ok. I'm convinced. Tonight I upgraded my system to 2.6.1 (using the wx official tarball source). Later, when I upgrade to Breezy, I'll switch back to using the official Ubuntu packages. wxruby2 will only support wx 2.6+ Thanks, Kevin From wxruby at qualitycode.com Tue Aug 2 22:22:07 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 2 22:16:22 2005 Subject: [Wxruby-users] compile fix for wx2.6 In-Reply-To: <29e11553050802042223668824@mail.gmail.com> References: <29e11553050802013763faec77@mail.gmail.com> <42EF52C4.90302@xs4all.nl> <29e11553050802042223668824@mail.gmail.com> Message-ID: <42F02A4F.6010002@qualitycode.com> Thanks to both of you. I have applied this fix and checked it in. Oddly, I had earlier tried doing what I thought was exactly the same thing on my own, and I had lots of trouble with it. Must have been a tiny typo somewhere. Anyway, this patch worked perfectly. Kevin Jani Monoses wrote: > thanks , > now I know that between attaching a file and actually sending it from > the web interface one must not accidentally delete said file :) > I attach the original diff again, it contains a change in the .i file as well. > > Jani > > On 8/2/05, Jonathan Maasland wrote: > >>Your .diff was empty so I'm re-sending it :) >> >>Jonathan >> >>Jani Monoses wrote: >> >> >>>building on ubuntu with wx2.6 gives only one error: >>>an argument type has changed from long to wxBitmapType in a >>>constructor of the wxIcon class. >>>These changes were needed to fix the build. >>> >>>This brings up the question what is the status of the >>>swig/classes/include files which were generated using the xml extract >>>script which is no longer available in CVS. >>>Should that script be rerun using wx2.6 headers? >>> >>>Jani >>> >>> >>>------------------------------------------------------------------------ >>> >>>_______________________________________________ >>>wxruby-users mailing list >>>wxruby-users@rubyforge.org >>>http://rubyforge.org/mailman/listinfo/wxruby-users >>> >>> >> >> >> >>29c29 >>< long type = wxBITMAP_TYPE_ICO_RESOURCE, >>--- >> >>> wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE, >> >> >> >> >>------------------------------------------------------------------------ >> >>diff -rN -u old-wxwork/swig/classes/Icon.i new-wxwork/swig/classes/Icon.i >>--- old-wxwork/swig/classes/Icon.i 2005-08-02 14:17:08.000000000 +0300 >>+++ new-wxwork/swig/classes/Icon.i 2005-08-02 14:17:08.000000000 +0300 >>@@ -7,7 +7,7 @@ >> >> %ignore wxIcon::wxIcon(); >> %ignore wxIcon::wxIcon(const wxIcon& icon); >>-%ignore wxIcon::wxIcon(void* data, int type, int width, int height, int depth = -1); >>+%ignore wxIcon::wxIcon(void* data, wxBitmapType type, int width, int height, int depth = -1); >> %ignore wxIcon::wxIcon(const char bits[], int width, int height, int depth = 1); >> %ignore wxIcon::wxIcon(int width, int height, int depth = -1); >> %ignore wxIcon::wxIcon(char** bits); >>diff -rN -u old-wxwork/swig/classes/include/wxIcon.h new-wxwork/swig/classes/include/wxIcon.h >>--- old-wxwork/swig/classes/include/wxIcon.h 2005-08-02 14:17:08.000000000 +0300 >>+++ new-wxwork/swig/classes/include/wxIcon.h 2005-08-02 14:17:09.000000000 +0300 >>@@ -26,7 +26,7 @@ >> >> // from resource/file >> wxIcon(const wxString& name, >>- long type = wxBITMAP_TYPE_ICO_RESOURCE, >>+ wxBitmapType type = wxBITMAP_TYPE_ICO_RESOURCE, >> int desiredWidth = -1, int desiredHeight = -1); >> >> wxIcon(const wxIconLocation& loc); >> >> >> >>------------------------------------------------------------------------ >> >>_______________________________________________ >>wxruby-users mailing list >>wxruby-users@rubyforge.org >>http://rubyforge.org/mailman/listinfo/wxruby-users From wxruby at qualitycode.com Tue Aug 2 22:43:54 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 2 22:38:09 2005 Subject: [Wxruby-users] Rake patch In-Reply-To: References: Message-ID: <42F02F6A.6070806@qualitycode.com> Sean Long wrote: > This patch fixes the following: > > - You can now use rake to build on Windows. > - You can now use rake install to install the lib, no more extconf.rb > needed! This should be cross platform, I took some code for installing > from the Makefile that extconf.rb generated as a basis. I have tested > it on OS X and will test tomorrow on Windows, I am 95% it will work > cross platform. > - I did get Windows compiling correctly with module named wxruby2 > instead of wx. The problem was in extconf.rb so this fix is pretty > useless now. > > I believe that is it, trying to make smaller patches for Kevin. I appreciate your efforts to create smaller patches, but this still ended up being a HUGE patch, including a wide variety of changes to files in swig/classes and swig/classes/include. And, unfortunately, it includes some changes I don't want to take, such as restoring the deprecated Sizer::Remove methods that I had removed. So I really don't want to apply the whole patch because safely backing out the stuff I don't want is going to be difficult. As I said before, I really haven't worked much with patches, either as a creator (contributor) or receiver (maintainer). So I'm not sure what to suggest. I just know that if a patch contains more than a couple files, it is probably trying to do to much and should be split up. Can you submit one diff for extconf.rb, and a second that only includes rakefile and the rake/ directory? Each of the .i or wx*.h files that you want to change should be its own diff. If that's too painful for you, let's try to find some other approach. This is one of the main reasons that I want to (eventually) move away from CVS and start using a distributed SCM tool. Each contributor should have full SCM capabilities, and we should be able to pull patches from each other. Thanks (and sorry to be a pain about this), Kevin From wxruby at qualitycode.com Tue Aug 2 23:06:07 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 2 23:00:25 2005 Subject: [Wxruby-users] Patch to move XmlResource back to classes In-Reply-To: References: Message-ID: <42F0349F.7020208@qualitycode.com> Sean Long wrote: > This patch is to move XmlResource.i back under classes. I applied this manually. Hopefully I got it right. Thanks, Kevin From wxruby at qualitycode.com Tue Aug 2 23:06:27 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 2 23:00:40 2005 Subject: [Wxruby-users] unicode and log messages In-Reply-To: <29e11553050801084362d82c6d@mail.gmail.com> References: <29e11553050801084362d82c6d@mail.gmail.com> Message-ID: <42F034B3.7000108@qualitycode.com> Jani Monoses wrote: > Another place where utf8 fixes are needed. > samples/dialogs/dialogs.rb and hit Ctrl-L or chose Log Dialog in the menu. Applied. Thanks! Kevin From wxruby at qualitycode.com Tue Aug 2 23:06:59 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 2 23:01:12 2005 Subject: [Wxruby-users] Small fix for rake/rakelinux.rb In-Reply-To: <42EF60D9.40405@xs4all.nl> References: <42EF60D9.40405@xs4all.nl> Message-ID: <42F034D3.8010405@qualitycode.com> Jonathan Maasland wrote: > Should someone have wx installed with AND without debug-support I think > it's their responsibility to correctly link wx-config to whatever they > wish to use. I agree. Applied. Thanks! Kevin From wxruby at qualitycode.com Tue Aug 2 23:22:22 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 2 23:16:38 2005 Subject: [Wxruby-users] wxchoice broken on linux In-Reply-To: <29e1155305080201397d6fa02f@mail.gmail.com> References: <29e1155305080201397d6fa02f@mail.gmail.com> Message-ID: <42F0386E.8070408@qualitycode.com> Jani Monoses wrote: > The recent changes for windows in choice.i (not the unicode change) > broke the etc/choice.rb and the controls/controls.rb tests. > ../samples/etc/choice.rb:12:in `initialize': No matching function for > overloaded 'new_wxChoice' (ArgumentError) On my system, with the latest build, it gets past that, but gives an error on line 13: kevins@aria:~/work/wxruby2/lib$ ruby ../samples/etc/choice.rb Our Initialize was called Their Initialize returned 1 ../samples/etc/choice.rb:13:in `append': No matching function for overloaded 'wxControlWithItems_Append' (ArgumentError) from ../samples/etc/choice.rb:13:in `initialize' from ../samples/etc/choice.rb:51:in `new' from ../samples/etc/choice.rb:51:in `on_init' from ../samples/etc/choice.rb:59:in `main_loop' from ../samples/etc/choice.rb:59 Seems to be the longstanding problem where SWIG can't correctly distinguish between overloaded methods. Might be solveable with typemaps. Or in some cases %rename's like has been done with wxPython. I haven't looked into this case yet. But if you're still seeing a problem on line 12 with the latest build, I really want to know why. Thanks, Kevin From roys at mindspring.com Tue Aug 2 23:43:55 2005 From: roys at mindspring.com (Roy Sutton) Date: Tue Aug 2 23:38:13 2005 Subject: [Wxruby-users] Latest tarball Message-ID: <42F03D7B.9090501@mindspring.com> The latest tarball won't compile on Windows: src/Functions.cpp(582) : error C2664: 'wxLogWarning' : cannot convert parameter 1 from 'const class wxWCharBuffer' to 'const char *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called src/Functions.cpp(592) : error C2665: 'wxLogStatus' : none of the 2 overloads can convert parameter 1 from type 'class wxFrame *' src/Functions.cpp(596) : error C2665: 'wxLogStatus' : none of the 2 overloads can convert parameter 1 from type 'const class wxWCharBuffer' src/Functions.cpp(606) : error C2664: 'wxLogWarning' : cannot convert parameter 1 from 'const class wxWCharBuffer' to 'const char *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called src/Functions.cpp(614) : error C2664: 'wxLogError' : cannot convert parameter 1 from 'const class wxWCharBuffer' to 'const char *' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Exception `RuntimeError' at c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] rake aborted! Command failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] [Clean install this time. :)] I was on my way to sleep when I saw the e-mails so I thought I'd try a compile. Sorry I have no fixes for this. From roys at mindspring.com Wed Aug 3 00:53:53 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 3 00:48:05 2005 Subject: [Wxruby-users] Latest tarball In-Reply-To: <42F03D7B.9090501@mindspring.com> References: <42F03D7B.9090501@mindspring.com> Message-ID: <42F04DE1.6000402@mindspring.com> Well, I ended up staying up to look at this. I did got it to compile by adding the following in before each line: wxString item(STR2CSTR(str),wxConvUTF8); Then replacing the requisite parts with 'item' Roy Sutton wrote: > The latest tarball won't compile on Windows: > > src/Functions.cpp(582) : error C2664: 'wxLogWarning' : cannot convert > parameter 1 from 'const class wxWCharBuffer' to 'const char *' > No user-defined-conversion operator available that can perform > this conversion, or the operator cannot be called > src/Functions.cpp(592) : error C2665: 'wxLogStatus' : none of the 2 > overloads can convert parameter 1 from type 'class wxFrame *' > src/Functions.cpp(596) : error C2665: 'wxLogStatus' : none of the 2 > overloads can convert parameter 1 from type 'const class wxWCharBuffer' > src/Functions.cpp(606) : error C2664: 'wxLogWarning' : cannot convert > parameter 1 from 'const class wxWCharBuffer' to 'const char *' > No user-defined-conversion operator available that can perform > this conversion, or the operator cannot be called > src/Functions.cpp(614) : error C2664: 'wxLogError' : cannot convert > parameter 1 from 'const class wxWCharBuffer' to 'const char *' > No user-defined-conversion operator available that can perform > this conversion, or the operator cannot be called > Exception `RuntimeError' at > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command > failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] > rake aborted! > Command failed with status (2): [cl.exe -c > -IC:\RubyDev\wxWidgets-2.6.1/inc...] > > [Clean install this time. :)] I was on my way to sleep when I saw the > e-mails so I thought I'd try a compile. Sorry I have no fixes for this. > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From sean.m.long at gmail.com Wed Aug 3 02:25:57 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 3 02:20:05 2005 Subject: [Wxruby-users] Rake patch In-Reply-To: <42F02F6A.6070806@qualitycode.com> References: <42F02F6A.6070806@qualitycode.com> Message-ID: The patch was strange because my local working copy got corrupted and I had to checkout a fresh copy and move over the changes. Here is a patch that only has the changes to rake for install and getting compiling working on Windows. I am not going to send a patch for the extconf.rb since the rake changes render it obsolete. Sean On 8/2/05, Kevin Smith wrote: > Sean Long wrote: > > This patch fixes the following: > > > > - You can now use rake to build on Windows. > > - You can now use rake install to install the lib, no more extconf.rb > > needed! This should be cross platform, I took some code for installing > > from the Makefile that extconf.rb generated as a basis. I have tested > > it on OS X and will test tomorrow on Windows, I am 95% it will work > > cross platform. > > - I did get Windows compiling correctly with module named wxruby2 > > instead of wx. The problem was in extconf.rb so this fix is pretty > > useless now. > > > > I believe that is it, trying to make smaller patches for Kevin. > > I appreciate your efforts to create smaller patches, but this still > ended up being a HUGE patch, including a wide variety of changes to > files in swig/classes and swig/classes/include. And, unfortunately, it > includes some changes I don't want to take, such as restoring the > deprecated Sizer::Remove methods that I had removed. So I really don't > want to apply the whole patch because safely backing out the stuff I > don't want is going to be difficult. > > As I said before, I really haven't worked much with patches, either as a > creator (contributor) or receiver (maintainer). So I'm not sure what to > suggest. I just know that if a patch contains more than a couple files, > it is probably trying to do to much and should be split up. > > Can you submit one diff for extconf.rb, and a second that only includes > rakefile and the rake/ directory? Each of the .i or wx*.h files that you > want to change should be its own diff. If that's too painful for you, > let's try to find some other approach. > > This is one of the main reasons that I want to (eventually) move away > from CVS and start using a distributed SCM tool. Each contributor should > have full SCM capabilities, and we should be able to pull patches from > each other. > > Thanks (and sorry to be a pain about this), > > Kevin > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: wxRuby2_rake_install.patch Type: application/octet-stream Size: 4236 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050802/81209ffd/wxRuby2_rake_install-0001.obj From wxruby at qualitycode.com Wed Aug 3 09:45:24 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 3 09:39:46 2005 Subject: [Wxruby-users] Rake patch In-Reply-To: References: <42F02F6A.6070806@qualitycode.com> Message-ID: <42F0CA74.4070202@qualitycode.com> Sean Long wrote: > The patch was strange because my local working copy got corrupted and > I had to checkout a fresh copy and move over the changes. Ah. > Here is a patch that only has the changes to rake for install and getting > compiling working on Windows. I am not going to send a patch for the > extconf.rb since the rake changes render it obsolete. Ok. That installed cleanly. I then refactored it a bit, and fixed a problem when the target install directory didn't already exist. I have officially deprecated extconf.rb, and plan to remove it from the project after about a week, unless someone raises an objection. Thanks! Kevin From roys at mindspring.com Wed Aug 3 10:43:47 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 3 10:38:04 2005 Subject: [Wxruby-users] Rake patch In-Reply-To: <42F0CA74.4070202@qualitycode.com> References: <42F02F6A.6070806@qualitycode.com> <42F0CA74.4070202@qualitycode.com> Message-ID: <42F0D823.1070208@mindspring.com> The new rake file seems to be working OK. I had to compile several libraries that aren't actually needed by the project (yet). Specifically: wxbase26[d]_net.lib [deprecated for Ruby net functions?] wxbase26[d]_odbc.lib wxmsw26[d]_dbgrid.lib wxmsw26d_media.lib wxregexd.lib [deprecated for Ruby regex functions?] Roy Kevin Smith wrote: > Sean Long wrote: > >> The patch was strange because my local working copy got corrupted and >> I had to checkout a fresh copy and move over the changes. > > > Ah. > >> Here is a patch that only has the changes to rake for install and >> getting >> compiling working on Windows. I am not going to send a patch for the >> extconf.rb since the rake changes render it obsolete. > > > Ok. That installed cleanly. I then refactored it a bit, and fixed a > problem when the target install directory didn't already exist. > > I have officially deprecated extconf.rb, and plan to remove it from > the project after about a week, unless someone raises an objection. > > Thanks! > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Wed Aug 3 17:00:44 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 3 16:55:01 2005 Subject: [Wxruby-users] [Fwd: Re: [wx-dev] Followup on "wxWindows Library Licence, Version 3.1"] Message-ID: <42F1307C.3040408@qualitycode.com> Good news regarding the wx licensing concern that came up here a couple weeks ago. See also: http://wxwidgets.org/newlicen.htm Kevin -------- Original Message -------- Subject: Re: [wx-dev] Followup on "wxWindows Library Licence, Version 3.1" Date: Wed, 03 Aug 2005 21:44:34 +0100 From: Julian Smart To: wx-dev@lists.wxwidgets.org CC: Kevin Smith Hi, I've made the manual & site versions of the license consistent (basically changed "the user's" to "your") and bumped to version 3.1. Hopefully that's fixed it. Thanks, Julian From sean.m.long at gmail.com Wed Aug 3 17:50:32 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 3 17:44:39 2005 Subject: [Wxruby-users] patch for Icon Message-ID: I just checked out a fresh copy and had to tweak wxIcon.h to get it to compile on Mac OS X and windows. The problem is with: wxIcon(const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_XPM, int desiredWidth=-1, int desiredHeight=-1); that signature is only used on GTK on other systems it is: wxIcon(const wxString& name, long type = wxBITMAP_TYPE_ICO_RESOURCE, int desiredWidth = -1, int desiredHeight = -1); So I wrapped this in a #ifdef __WXGTK__ #else #endif I also had to change: wxLogWarning(wxConvUTF8.cMB2WC(StringValuePtr(str))); I don't know about other systems but on Windows wxLogWarning and wxLogStatus only take const char *formatString and that is what the docs show also. Kevin the refactored install works great also. I will be out of town for 5 days starting tomorrow so if you need any clarification email me back quick. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: wxruby_icon_and_functions.patch Type: application/octet-stream Size: 3220 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050803/55673429/wxruby_icon_and_functions.obj From sean.m.long at gmail.com Wed Aug 3 18:04:10 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 3 17:58:17 2005 Subject: [Wxruby-users] patch for xrcid Message-ID: Somewhere along the way the xrcid function got removed from Functions.i, this will add it back. Kevin I hope you like these small patches, you are going to get a lot. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: wxRuby2_xrcid.patch Type: application/octet-stream Size: 2329 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050803/029c9e37/wxRuby2_xrcid.obj From sean.m.long at gmail.com Wed Aug 3 18:06:30 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 3 18:00:38 2005 Subject: [Wxruby-users] patch for text ctrl Message-ID: This is to add back the << operator to TextCtrl it got removed somewhere along the way. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: wxRuby2_textctrl.patch Type: application/octet-stream Size: 1082 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050803/6702dab5/wxRuby2_textctrl.obj From wxruby at qualitycode.com Wed Aug 3 21:04:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 3 20:58:52 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: References: Message-ID: <42F1699F.1050203@qualitycode.com> This one needs more work. I have not applied it yet. The icon changes won't compile on my box at all. I'll try to figure out why. These log changes appear to be reverting changes that I checked in just a day or two ago that Jani said were necessary. I haven't looked closely enough to see what is going on, so can either of you (or anyone else) clarify? Thanks, Kevin Sean Long wrote: > I just checked out a fresh copy and had to tweak wxIcon.h to get it to > compile on Mac OS X and windows. The problem is with: > > wxIcon(const wxString& filename, > wxBitmapType type = wxBITMAP_TYPE_XPM, > int desiredWidth=-1, int desiredHeight=-1); > > that signature is only used on GTK on other systems it is: > > wxIcon(const wxString& name, > long type = wxBITMAP_TYPE_ICO_RESOURCE, > int desiredWidth = -1, int desiredHeight = -1); > > So I wrapped this in a #ifdef __WXGTK__ #else #endif > > I also had to change: > > wxLogWarning(wxConvUTF8.cMB2WC(StringValuePtr(str))); > > I don't know about other systems but on Windows wxLogWarning and > wxLogStatus only take const char *formatString and that is what the > docs show also. > > Kevin the refactored install works great also. > > I will be out of town for 5 days starting tomorrow so if you need any > clarification email me back quick. > > > Sean > > > ------------------------------------------------------------------------ > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From wxruby at qualitycode.com Wed Aug 3 21:24:06 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 3 21:18:24 2005 Subject: [Wxruby-users] patch for xrcid In-Reply-To: References: Message-ID: <42F16E36.7080300@qualitycode.com> Sean Long wrote: > Somewhere along the way the xrcid function got removed from > Functions.i, this will add it back. I don't think we can blindly cast from char* to const wxChar *, due to unicode issues. After removing the logXxx portions of this patch, I refactored it some and changed to using a local wxString temporary variable. It's in. I'm not sure how to test this one, so I'm sure you'll let me know if I messed it up. Here's my proof that at least it doesn't crash: kevins@aria:~/work/wxruby2$ irb irb(main):001:0> require 'wx' => true irb(main):002:0> Wx::xrcid("Hello") => 103 irb(main):003:0> Wx::xrcid("ielfjelsfelifj") => 104 irb(main):004:0> Wx::xrcid("OK") => 105 irb(main):005:0> exit kevins@aria:~/work/wxruby2$ > Kevin I hope you like these small patches, you are going to get a lot. :-) I love getting patches from people! It makes my job SOOO much easier. And I would much rather deal with many small patches than a few large ones. So keep them coming! Thanks, Kevin From wxruby at qualitycode.com Wed Aug 3 21:32:41 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 3 21:27:00 2005 Subject: [Wxruby-users] patch for text ctrl In-Reply-To: References: Message-ID: <42F17039.1010101@qualitycode.com> Sean Long wrote: > This is to add back the << operator to TextCtrl it got removed > somewhere along the way. This one wouldn't compile for me. Looks like another unicode issue. I changed one line to: *ptr << wxString(StringValuePtr(value), wxConvUTF8); and now it seems ok, so I checked it in. I don't have a working TextCtrl sample on my system yet, so I couldn't test it :-( One question: Should we raise an exception if none of the types match, instead of returning silently? Kevin From wxruby at qualitycode.com Wed Aug 3 21:38:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 3 21:32:48 2005 Subject: [Wxruby-users] patch for text ctrl In-Reply-To: <42F17039.1010101@qualitycode.com> References: <42F17039.1010101@qualitycode.com> Message-ID: <42F17197.1040203@qualitycode.com> Kevin Smith wrote: > and now it seems ok, so I checked it in. I don't have a working TextCtrl > sample on my system yet, so I couldn't test it :-( Doh! I spoke too soon. Your patch also removed a %ignore line, and without that, I can't construct any TextCtrl objects. I re-inserted the ignore, and was able to at lesat construct a TextCtrl (although I still don't have a good sample that I can use for testing because Notebook isn't supported on Linux yet. NOW it's in. Kevin From roys at mindspring.com Wed Aug 3 21:52:15 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 3 21:46:35 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: <42F1699F.1050203@qualitycode.com> References: <42F1699F.1050203@qualitycode.com> Message-ID: <42F174CF.3060607@mindspring.com> I can't speak to the icon changes. The log file changes appear to be a different take on the same thing I tried. The changes you checked in will not compile on Windows at all so I can't imagine we want to go that route. Is there a different declaration under older/different versions of wxWindows? Kevin Smith wrote: > This one needs more work. I have not applied it yet. > > The icon changes won't compile on my box at all. I'll try to figure > out why. > > These log changes appear to be reverting changes that I checked in > just a day or two ago that Jani said were necessary. I haven't looked > closely enough to see what is going on, so can either of you (or > anyone else) clarify? > > Thanks, > > Kevin > > > Sean Long wrote: > >> I just checked out a fresh copy and had to tweak wxIcon.h to get it to >> compile on Mac OS X and windows. The problem is with: >> >> wxIcon(const wxString& filename, wxBitmapType type >> = wxBITMAP_TYPE_XPM, >> int desiredWidth=-1, int desiredHeight=-1); >> >> that signature is only used on GTK on other systems it is: >> >> wxIcon(const wxString& name, >> long type = wxBITMAP_TYPE_ICO_RESOURCE, >> int desiredWidth = -1, int desiredHeight = -1); >> So I wrapped this in a #ifdef __WXGTK__ #else #endif >> >> I also had to change: >> >> wxLogWarning(wxConvUTF8.cMB2WC(StringValuePtr(str))); >> >> I don't know about other systems but on Windows wxLogWarning and >> wxLogStatus only take const char *formatString and that is what the >> docs show also. >> >> Kevin the refactored install works great also. >> >> I will be out of town for 5 days starting tomorrow so if you need any >> clarification email me back quick. >> >> >> Sean >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Wed Aug 3 23:48:38 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 3 23:42:53 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: <42F174CF.3060607@mindspring.com> References: <42F1699F.1050203@qualitycode.com> <42F174CF.3060607@mindspring.com> Message-ID: <42F19016.7040706@qualitycode.com> Roy Sutton wrote: > I can't speak to the icon changes. The log file changes appear to be a > different take on the same thing I tried. The changes you checked in > will not compile on Windows at all so I can't imagine we want to go that > route. Is there a different declaration under older/different versions > of wxWindows? Possible, but I'm using wx 2.6.1 here, so I doubt it's an API difference that we are hitting. It is probably a compiler pickiness issue, a platform datatype mismatch, or a unicode/non-unicode thing. Can you try changing this: wxLogWarning(wxConvUTF8.cMB2WC(StringValuePtr(str))); to something like this: wxLogWarning(wxString(StringValuePtr(str), wxConvUTF8)); It looks like a good pattern because it creates a local wxString that will get cleaned up on function exit, and it avoids any question of char* vs const char* vs wxChar* etc. It seemed to work over in TextCtrl. I'll look at this more in a day or two, but any feedback on this would be appreciated. Thanks, Kevin From roys at mindspring.com Wed Aug 3 23:50:16 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 3 23:44:28 2005 Subject: [Wxruby-users] Old Samples Message-ID: <42F19078.1070305@mindspring.com> One of the failure modes for the old samples is that the application will close right away. This appears to be caused by calling show(TRUE) inside of a frame's initialize. Before I dig too far into it, is such a thing disallowed now? I don't see anything inherently wrong with it. If it's supposed to work then I'll dig into it further. There's also the other problem I've seen with old samples where the program refuses to shut down when you try to close it. Roy From roys at mindspring.com Wed Aug 3 23:52:12 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 3 23:46:23 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: <42F19016.7040706@qualitycode.com> References: <42F1699F.1050203@qualitycode.com> <42F174CF.3060607@mindspring.com> <42F19016.7040706@qualitycode.com> Message-ID: <42F190EC.3060309@mindspring.com> I've tried that before, although I did use a temporary variable. It does seem to work although I didn't actually test logging functionality, only compilation. I can try something later to see if it works. Kevin Smith wrote: > Roy Sutton wrote: > >> I can't speak to the icon changes. The log file changes appear to be >> a different take on the same thing I tried. The changes you checked >> in will not compile on Windows at all so I can't imagine we want to >> go that route. Is there a different declaration under >> older/different versions of wxWindows? > > > Possible, but I'm using wx 2.6.1 here, so I doubt it's an API > difference that we are hitting. It is probably a compiler pickiness > issue, a platform datatype mismatch, or a unicode/non-unicode thing. > > Can you try changing this: > wxLogWarning(wxConvUTF8.cMB2WC(StringValuePtr(str))); > > to something like this: > wxLogWarning(wxString(StringValuePtr(str), wxConvUTF8)); > > It looks like a good pattern because it creates a local wxString that > will get cleaned up on function exit, and it avoids any question of > char* vs const char* vs wxChar* etc. It seemed to work over in TextCtrl. > > I'll look at this more in a day or two, but any feedback on this would > be appreciated. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Thu Aug 4 00:39:52 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 4 00:34:06 2005 Subject: [Wxruby-users] swigwin Message-ID: <42F19C18.8010809@mindspring.com> Anyone on the list have some pointers for getting swig working properly on Windows? Anytime I reswig a file it breaks wx.cpp. I'm sure I've got a setup problem but I haven't been able to put my finger on it yet. Roy From nochoice at xs4all.nl Thu Aug 4 09:29:54 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Thu Aug 4 09:13:57 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: <42F19016.7040706@qualitycode.com> References: <42F1699F.1050203@qualitycode.com> <42F174CF.3060607@mindspring.com> <42F19016.7040706@qualitycode.com> Message-ID: <42F21852.6050008@xs4all.nl> I'm getting the same error when compiling the current tree: src/Functions.cpp: In function `void log_message(int, VALUE*, long unsigned int)': src/Functions.cpp:583: error: cannot convert `const wxWCharBuffer' to `const wxChar*' for argument `1' to `void wxLogWarning(const wxChar*, ...)' Applying your (ad-hoc) suggested fix didn't work either :( On a sidenote: Before the update I finally had some samples up n running, after the update I got a segfault :( I'm unsure whether it's related to this issue (I commented out the offending lines), but it's definitely something newly checked-in. Running the program through gbd doesn't help either....I still get alot of mumbo-jumbo Sorry I couldn't help you out any further here, Jonathan Kevin Smith wrote: > Roy Sutton wrote: > >> I can't speak to the icon changes. The log file changes appear to be >> a different take on the same thing I tried. The changes you checked >> in will not compile on Windows at all so I can't imagine we want to >> go that route. Is there a different declaration under >> older/different versions of wxWindows? > > > Possible, but I'm using wx 2.6.1 here, so I doubt it's an API > difference that we are hitting. It is probably a compiler pickiness > issue, a platform datatype mismatch, or a unicode/non-unicode thing. > > Can you try changing this: > wxLogWarning(wxConvUTF8.cMB2WC(StringValuePtr(str))); > > to something like this: > wxLogWarning(wxString(StringValuePtr(str), wxConvUTF8)); > > It looks like a good pattern because it creates a local wxString that > will get cleaned up on function exit, and it avoids any question of > char* vs const char* vs wxChar* etc. It seemed to work over in TextCtrl. > > I'll look at this more in a day or two, but any feedback on this would > be appreciated. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > From wxruby at qualitycode.com Thu Aug 4 09:23:01 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 4 09:17:17 2005 Subject: [Wxruby-users] swigwin In-Reply-To: <42F19C18.8010809@mindspring.com> References: <42F19C18.8010809@mindspring.com> Message-ID: <42F216B5.8040308@qualitycode.com> Roy Sutton wrote: > Anyone on the list have some pointers for getting swig working properly > on Windows? Anytime I reswig a file it breaks wx.cpp. I'm sure I've > got a setup problem but I haven't been able to put my finger on it yet. Sorry I didn't have a chance to look at this sooner. It definitely looks like a swig version problem. I'm still using 1.3.22 (because that's what's in Ubuntu stable/Hoary). The message you posted earlier showed this: > swig -runtime -w401 -w801 -w515 -c++ -ruby -o src/wx.cpp swig/wx.i > SWIG(1): Warning(120): -c, -runtime, -noruntime command line options are deprecated. > ruby swig/renamer.rb src/wx.cpp > ruby swig/fixmainmodule.rb src/wx.cpp And -runtime is what we use with wx.i and not with the other modules. It looks like there is no way to have .i files that would work with both swig 1.3.22 and 1.3.23 (or later) due to this change in swig. My new plan is to add a test in the rakefile that attempts to run 'swig -version'. If it can't find it, or if the version is not 1.3.22, then avoid creating the swig tasks. This way, it will just use the files in src/ even if the .i files are newer. At some point, we can figure out how to make it work with 1.3.24, and the rakefile can adjust accordingly. I certainly wouldn't complain if someone else got to this before I have a chance to :-) Kevin From wxruby at qualitycode.com Thu Aug 4 09:25:14 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 4 09:19:24 2005 Subject: [Wxruby-users] Old Samples In-Reply-To: <42F19078.1070305@mindspring.com> References: <42F19078.1070305@mindspring.com> Message-ID: <42F2173A.4040709@qualitycode.com> Roy Sutton wrote: > One of the failure modes for the old samples is that the application > will close right away. This appears to be caused by calling show(TRUE) > inside of a frame's initialize. Before I dig too far into it, is such a > thing disallowed now? I don't see anything inherently wrong with it. > If it's supposed to work then I'll dig into it further. I haven't seen that myself. Can you point to a sample that does it? > There's also > the other problem I've seen with old samples where the program refuses > to shut down when you try to close it. I have noticed that some of our samples don't even have a Close box in the window frame, on my system. Fortunately, they have a File/Exit command I can use instead. But really all our samples should include a main window close button. If that's not what you're seeing, can you point to a sample where I could see the problem you're describing? Thanks, Kevin From jani.monoses at gmail.com Thu Aug 4 09:36:26 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Thu Aug 4 09:30:32 2005 Subject: [Wxruby-users] swigwin In-Reply-To: <42F216B5.8040308@qualitycode.com> References: <42F19C18.8010809@mindspring.com> <42F216B5.8040308@qualitycode.com> Message-ID: <29e1155305080406362895cbdc@mail.gmail.com> > At some point, we can figure out how to make it work with 1.3.24, and > the rakefile can adjust accordingly. It swigs and works fine for me with 1.3.24 if I delete the -runtime flag. Jani From wxruby at qualitycode.com Thu Aug 4 09:42:39 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 4 09:36:53 2005 Subject: [Wxruby-users] swigwin In-Reply-To: <29e1155305080406362895cbdc@mail.gmail.com> References: <42F19C18.8010809@mindspring.com> <42F216B5.8040308@qualitycode.com> <29e1155305080406362895cbdc@mail.gmail.com> Message-ID: <42F21B4F.5030301@qualitycode.com> Jani Monoses wrote: >>At some point, we can figure out how to make it work with 1.3.24, and >>the rakefile can adjust accordingly. > > > It swigs and works fine for me with 1.3.24 if I delete the -runtime flag. Very odd. The swig folks claimed at one point that since -runtime and -noruntime are ignored by 1.3.24, it would make no difference whether you had them or not. I wonder why that's not true. You still have the -noruntime flag for the class file swigs, right? Do you get warnings that it is deprecated? Kevin From jani.monoses at gmail.com Thu Aug 4 09:46:10 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Thu Aug 4 09:40:15 2005 Subject: [Wxruby-users] swigwin In-Reply-To: <42F21B4F.5030301@qualitycode.com> References: <42F19C18.8010809@mindspring.com> <42F216B5.8040308@qualitycode.com> <29e1155305080406362895cbdc@mail.gmail.com> <42F21B4F.5030301@qualitycode.com> Message-ID: <29e115530508040646eda4aea@mail.gmail.com> On 8/4/05, Kevin Smith wrote: > Jani Monoses wrote: > >>At some point, we can figure out how to make it work with 1.3.24, and > >>the rakefile can adjust accordingly. > > > > > > It swigs and works fine for me with 1.3.24 if I delete the -runtime flag. Sorry, it worked even with that flag too. It just warns that's why I removed it. Ocassionally it said SWIG_RubyInitRuntime missing when starting the apps but usually a rebuild fixed that. Jani From roys at mindspring.com Thu Aug 4 10:11:52 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 4 10:06:04 2005 Subject: [Wxruby-users] swigwin In-Reply-To: <29e115530508040646eda4aea@mail.gmail.com> References: <42F19C18.8010809@mindspring.com> <42F216B5.8040308@qualitycode.com> <29e1155305080406362895cbdc@mail.gmail.com> <42F21B4F.5030301@qualitycode.com> <29e115530508040646eda4aea@mail.gmail.com> Message-ID: <42F22228.80408@mindspring.com> I thought I'd try reswigging everything from scratch with a 'rake reswig' then a 'rake'. If I reswig then I can't compile Icon.cpp with the following error: src/Icon.cpp(1207) : error C2666: 'wxIcon::wxIcon' : 2 overloads have similar conversions Exception `RuntimeError' at c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] I'll check into this later. From roys at mindspring.com Thu Aug 4 10:18:38 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 4 10:12:57 2005 Subject: [Wxruby-users] Old Samples In-Reply-To: <42F2173A.4040709@qualitycode.com> References: <42F19078.1070305@mindspring.com> <42F2173A.4040709@qualitycode.com> Message-ID: <42F223BE.1050203@mindspring.com> The following old samples hang on exit (on windows): etc\test4 etc\test17 etc\test18 The following old samples exit as soon as they start: checklist\checklist dialogs\dialogs etc\b1.rb I have a much more comprehensive list of the problems with the old samples. Just not enough time to type it all up right now. Kevin Smith wrote: > Roy Sutton wrote: > >> One of the failure modes for the old samples is that the application >> will close right away. This appears to be caused by calling >> show(TRUE) inside of a frame's initialize. Before I dig too far into >> it, is such a thing disallowed now? I don't see anything inherently >> wrong with it. If it's supposed to work then I'll dig into it further. > > > I haven't seen that myself. Can you point to a sample that does it? > >> There's also the other problem I've seen with old samples where the >> program refuses to shut down when you try to close it. > > > I have noticed that some of our samples don't even have a Close box in > the window frame, on my system. Fortunately, they have a File/Exit > command I can use instead. But really all our samples should include a > main window close button. > > If that's not what you're seeing, can you point to a sample where I > could see the problem you're describing? > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Thu Aug 4 21:02:04 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 4 20:56:19 2005 Subject: [Wxruby-users] swigwin In-Reply-To: <42F22228.80408@mindspring.com> References: <42F19C18.8010809@mindspring.com> <42F216B5.8040308@qualitycode.com> <29e1155305080406362895cbdc@mail.gmail.com> <42F21B4F.5030301@qualitycode.com> <29e115530508040646eda4aea@mail.gmail.com> <42F22228.80408@mindspring.com> Message-ID: <42F2BA8C.5020706@qualitycode.com> Roy Sutton wrote: > I thought I'd try reswigging everything from scratch with a 'rake > reswig' then a 'rake'. Good. I was going to suggest that. It probably isn't safe to only reswig some of the files if you are using a different version of swig. > If I reswig then I can't compile Icon.cpp with the following error: > > src/Icon.cpp(1207) : error C2666: 'wxIcon::wxIcon' : 2 overloads have > similar conversions > Exception `RuntimeError' at > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command > failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] Hm. I've never seen anything like that. Can you post line 1207 with some context so we can see what's failing? My Icon.cpp only has 1093 lines total. Swig has been a great tool, but I'm not happy with the way the swig project is managed. They go too long between releases, and tend to break too much stuff too often (like the -runtime deprecation). Hopefully we can figure something out. Kevin From wxruby at qualitycode.com Thu Aug 4 21:58:08 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 4 21:52:21 2005 Subject: [Wxruby-users] Copyrights and licenses in wxruby2 Message-ID: <42F2C7B0.9040704@qualitycode.com> Greetings all, Recently I noticed that although the wxruby2 LICENSE file contains a simple MIT-style license, the actual source files (mostly .i and .rb) still referred to the older "wxWidgets license". I have updated all the source files to be consistent with the intended LICENSE. Another issue is the copyright. Almost all the files (still) had my name as the copyright holder. Because this software is released under a very liberal license, it's not a huge deal. I mean, it would be pretty hard for someone to use it in a way that's not allowed. So it's unlikely that we would actually want to sue someone for misuse of the code. But it seems like there is still value in having all the code copyrighted by one person (or legal entity), in case a license change or clarification needs to be made later. Assuming there are no objections, I will continue to be the copyright holder for all the wxruby2 files. That means that anyone who submits a patch or other code is assigning me the copyrights to that code. If you have any concerns about that, feel free to discuss them with me on- or off-list. Not counting samples (see below), there was one file (Mac.i) which did not have any copyright. I inserted the same copyright/license in that file as all the others. Nick created that entire file, so I want his blessing for me to take that copyright. (Are you listening, Nick?) Most of the samples have no copyright. That's because they were pulled from wxruby1, and most were originally translated from C++ to Ruby by Park Heesob. Over time, I would like us to rewrite the samples from scratch, using a modern wxruby style, and hopefully also giving some of them friendlier UI's. With some, it's not obvious how to exercise their functionality. Kevin From roys at mindspring.com Thu Aug 4 23:04:42 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 4 22:59:00 2005 Subject: [Wxruby-users] swigwin In-Reply-To: <42F2BA8C.5020706@qualitycode.com> References: <42F19C18.8010809@mindspring.com> <42F216B5.8040308@qualitycode.com> <29e1155305080406362895cbdc@mail.gmail.com> <42F21B4F.5030301@qualitycode.com> <29e115530508040646eda4aea@mail.gmail.com> <42F22228.80408@mindspring.com> <42F2BA8C.5020706@qualitycode.com> Message-ID: <42F2D74A.7060007@mindspring.com> Line 1207 reads: result = (wxIcon *)new wxIcon((wxString const &)*arg2,arg3,arg4); This is in function _wrap_new_wxIcon__SWIG_1(int argc, VALUE *argv, VALUE self) Kevin Smith wrote: >> If I reswig then I can't compile Icon.cpp with the following error: >> >> src/Icon.cpp(1207) : error C2666: 'wxIcon::wxIcon' : 2 overloads have >> similar conversions >> Exception `RuntimeError' at >> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command >> failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] > > > Hm. I've never seen anything like that. Can you post line 1207 with > some context so we can see what's failing? My Icon.cpp only has 1093 > lines total. From roys at mindspring.com Thu Aug 4 23:23:12 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 4 23:17:24 2005 Subject: [Wxruby-users] swigwin In-Reply-To: <42F2D74A.7060007@mindspring.com> References: <42F19C18.8010809@mindspring.com> <42F216B5.8040308@qualitycode.com> <29e1155305080406362895cbdc@mail.gmail.com> <42F21B4F.5030301@qualitycode.com> <29e115530508040646eda4aea@mail.gmail.com> <42F22228.80408@mindspring.com> <42F2BA8C.5020706@qualitycode.com> <42F2D74A.7060007@mindspring.com> Message-ID: <42F2DBA0.2050602@mindspring.com> If I cast arg3 as a long it will compile. I'm /pretty/ sure that: wxIcon::wxIcon(const wxString& iconfile, long flags, int desiredWidth, int desiredHeight) Is the wxIcon constructor that's desired. Roy Sutton wrote: > Line 1207 reads: > > result = (wxIcon *)new wxIcon((wxString const &)*arg2,arg3,arg4); > > This is in function _wrap_new_wxIcon__SWIG_1(int argc, VALUE *argv, > VALUE self) > > Kevin Smith wrote: > >>> If I reswig then I can't compile Icon.cpp with the following error: >>> >>> src/Icon.cpp(1207) : error C2666: 'wxIcon::wxIcon' : 2 overloads >>> have similar conversions >>> Exception `RuntimeError' at >>> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command >>> failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] >> >> >> >> Hm. I've never seen anything like that. Can you post line 1207 with >> some context so we can see what's failing? My Icon.cpp only has 1093 >> lines total. > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Thu Aug 4 23:33:07 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 4 23:27:21 2005 Subject: [Wxruby-users] wxruby2 retooling Message-ID: <42F2DDF3.2090409@qualitycode.com> I finally gave up on swig 1.3.22, since it seems to be causing too many problems. Ubuntu breezy will have 1.3.24, so I'm retargeting wxruby2 to swig 1.3.24+. At the moment, I have 1.3.25 on my system, since that's the current release. I'm finding all kinds of problems with the post-processors we have that clean up the .cpp files that swig creates. The post-processors were always pretty hackish, and the swig upgrade has exposed this flaw. Basically, I'm going to rework the post-processors one-by-one until they work with swig 1.3.25. It will probably take several days, so don't expect any other wxruby2 progress until this is done. Honestly, I recommend that everyone stop fiddling with wxruby2 until this is resolved. Kevin From roys at mindspring.com Thu Aug 4 23:39:48 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 4 23:33:58 2005 Subject: [Wxruby-users] Next swig problem Message-ID: <42F2DF84.5010903@mindspring.com> After getting past the icon problem I ran into my next problem: SpinCtrl.cpp src/SpinCtrl.cpp(1141) : error C2065: 'cWxSpinCtrl' : undeclared identifier src/SpinCtrl.cpp(1141) : error C2228: left of '.klass' must have class/struct/union type src/SpinCtrl.cpp(1147) : error C2371: 'cWxSpinCtrl' : redefinition; different basic types ... The reason for this is the way it trying to use something before declaring it: extern "C" void PostInit_wxSpinCtrl(void) { #ifndef __WXGTK__ rb_define_method(cWxSpinCtrl.klass, "set_selection", VALUEFUNC(_wrap_wxSpinCtrl_SetSelection), -1); #endif } extern swig_class cWxControl; swig_class cWxSpinCtrl; If I move the PostInit part down below the declaration all works fine (compilation wise). From roys at mindspring.com Thu Aug 4 23:55:15 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 4 23:49:25 2005 Subject: [Wxruby-users] Success! Message-ID: <42F2E323.2030303@mindspring.com> After re-swigging everything, manually correcting errors in the files mentioned before (and Functions.cpp) the library compiled and linked! This gets me over the hump of the reswig of wx.i I was getting before. Hopefully this will mean I can make some progress playing with things now. Although given Kevin's recent e-mail about reworking the post-swig code... Roy From roys at mindspring.com Fri Aug 5 02:17:45 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 5 02:11:56 2005 Subject: [Wxruby-users] Validator Message-ID: <42F30489.2090007@mindspring.com> For whatever reason I decided to implement the validator class tonight. It's my first go at implementing the class. My first run at it looked pretty good. I just added a generic .i for it and it all compiled. Sadly, the samples didn't work because the base Validator class can't actually be used as a validator! You have to derive from GenericValidator. I thought the way to get around this might be to include both wxValidator.h and wxGenericValidator.h into the Validator.i file. I'm a bit unclear on how one might specify that Validator in Ruby refers to wxGenericValidator. Something to dig into this weekend I suppose. Another thing I'm a bit unclear on is the whole (directors="1"). I'll investigate that this weekend, too. Finally, one last little problem. It appears the C->ruby renamer isn't handling names like centreX properly. centreX should be converted to centre_x as I understand it. The un_camelcase function in renamer.rb apparenly only uncamelcases if the first characters are uppercase. Thoughts? Roy From wxruby at qualitycode.com Sat Aug 6 11:45:57 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 6 11:40:19 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <42F2DDF3.2090409@qualitycode.com> References: <42F2DDF3.2090409@qualitycode.com> Message-ID: <42F4DB35.7080909@qualitycode.com> Kevin Smith wrote: > Basically, I'm going to rework the post-processors one-by-one until they > work with swig 1.3.25. It will probably take several days, so don't > expect any other wxruby2 progress until this is done. Ok. I finally got it to swig, compile, link, and run at least a couple of the samples on my system (Ubuntu, swig 1.3.25, wx 2.6.1). It's checked in, and I would appreciate reports of whether it builds on other platforms. I haven't yet re-enabled the "fixdeleting" post-processor, which attempted to improve memory management (avoid leaks and/or crashes due to double-freeing). I'll try to get to that this weekend. Even without that, I think it's good enough that anyone who wants to can start hacking again. I'm much happier with the post-processing now, although it's still a bit messy in spots. There were several cases where the post-processing wasn't finding the code fragments that it wanted to modify, so those changes weren't even being performed. Now, they complain if they couldn't find their targets. Honestly, I don't see how the previous wxruby2 code could have worked with SWIG 1.3.24 or later. After I re-integrate fixdeleting, I'll take a look at the latest stuff Roy sent, including trying to come up with a better unicode typemap. Kevin From nochoice at xs4all.nl Sat Aug 6 17:34:46 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Sat Aug 6 18:01:08 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <42F4DB35.7080909@qualitycode.com> References: <42F2DDF3.2090409@qualitycode.com> <42F4DB35.7080909@qualitycode.com> Message-ID: <42F52CF6.5040906@xs4all.nl> Nice work Kevin! Good to see you are making alot of progress. I'd really like to help you out more but unfortunately I haven't yet found the time to investigate Swig. Atm I can only dl the source tree and share my results. So here goes: (I did a clean/new checkout btw just to be sure) Executing the rake command immediatly fails on my machine: ---- SWIG Version 1.3.24 Copyright (c) 1995-1998 University of Utah and the Regents of the University of California Copyright (c) 1998-2004 University of Chicago Compiled with i686-pc-linux-gnu-g++ [i686-pc-linux-gnu] Please see http://www.swig.org for reporting bugs and further information undefined method `>=' for nil:NilClass ./rake/rakewx.rb:21:in `have_good_swig' ./rake/rakewx.rb:251:in `create_internal_swig_tasks' ./rakefile:58 /usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load' /usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load_rakefile' /usr/lib/ruby/site_ruby/1.8/rake.rb:1274:in `run' /usr/bin/rake:8 rake aborted! Don't know how to build task 'default' ---- Looking at the function have_good_swig I'm actually a bit puzzled. When I run irb and execute `swig -version` it neatly prints the output but the result is actually an empty string! Adding a simple return false before the original return starts the compilation without a snag though :) (it shouldn't actually but it does....) ((my first noob attempt was "return false unless version" which of course translates to "return false")) Unfortunately the compilation fails miserably. I added the errors as an attachment because it's a really really long list :(( I hope these errors are caused because I'm using Swig 1.3.24, if you'd like I could update to 1.3.25 and try again. Lots of friendly greetings, Jonathan Kevin Smith wrote: > Kevin Smith wrote: > >> Basically, I'm going to rework the post-processors one-by-one until >> they work with swig 1.3.25. It will probably take several days, so >> don't expect any other wxruby2 progress until this is done. > > > Ok. I finally got it to swig, compile, link, and run at least a couple > of the samples on my system (Ubuntu, swig 1.3.25, wx 2.6.1). It's > checked in, and I would appreciate reports of whether it builds on > other platforms. > > I haven't yet re-enabled the "fixdeleting" post-processor, which > attempted to improve memory management (avoid leaks and/or crashes due > to double-freeing). I'll try to get to that this weekend. Even without > that, I think it's good enough that anyone who wants to can start > hacking again. > > I'm much happier with the post-processing now, although it's still a > bit messy in spots. There were several cases where the post-processing > wasn't finding the code fragments that it wanted to modify, so those > changes weren't even being performed. Now, they complain if they > couldn't find their targets. > > Honestly, I don't see how the previous wxruby2 code could have worked > with SWIG 1.3.24 or later. > > After I re-integrate fixdeleting, I'll take a look at the latest stuff > Roy sent, including trying to come up with a better unicode typemap. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > -------------- next part -------------- i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/ToolBar.o src/ToolBar.cpp src/ToolBar.cpp: In member function `virtual void SwigDirector_wxToolBar::OnRightClick(int, float, float)': src/ToolBar.cpp:1136: warning: passing `float' for converting 2 of `virtual void wxToolBarBase::OnRightClick(int, long int, long int)' src/ToolBar.cpp:1136: warning: passing `float' for converting 3 of `virtual void wxToolBarBase::OnRightClick(int, long int, long int)' src/ToolBar.cpp: In function `VALUE _wrap_wxToolBar_FindToolForPosition(int, VALUE*, long unsigned int)': src/ToolBar.cpp:2407: warning: passing `float' for converting 1 of `virtual wxToolBarToolBase* wxToolBar::FindToolForPosition(int, int) const' src/ToolBar.cpp:2407: warning: passing `float' for converting 2 of `virtual wxToolBarToolBase* wxToolBar::FindToolForPosition(int, int) const' src/ToolBar.cpp: In function `VALUE _wrap_wxToolBar_OnRightClick(int, VALUE*, long unsigned int)': src/ToolBar.cpp:3118: warning: passing `float' for converting 2 of `virtual void wxToolBarBase::OnRightClick(int, long int, long int)' src/ToolBar.cpp:3118: warning: passing `float' for converting 3 of `virtual void wxToolBarBase::OnRightClick(int, long int, long int)' i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/ToolTip.o src/ToolTip.cpp i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/TreeEvent.o src/TreeEvent.cpp i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/UpdateUIEvent.o src/UpdateUIEvent.cpp i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/Window.o src/Window.cpp i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/WindowDC.o src/WindowDC.cpp i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/WindowDisabler.o src/WindowDisabler.cpp i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/XmlResource.o src/XmlResource.cpp i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/wx.o src/wx.cpp src/wx.cpp:30: error: parse error before `<<' token src/wx.cpp:31: error: missing ';' before right brace src/wx.cpp:41: error: parse error before `==' token In file included from src/wx.cpp:117: /usr/lib/ruby/1.8/i686-linux/ruby.h:699: error: parse error before `}' token src/wx.cpp:237: error: parse error before `<<' token src/wx.cpp:253:1: warning: "SWIG_RUNTIME_VERSION" redefined src/wx.cpp:240:1: warning: this is the location of the previous definition src/wx.cpp:326: error: parse error before `<<' token src/wx.cpp:334: error: 'swig_converter_func' is used as a type, but is not defined as a type. src/wx.cpp:337: error: parse error before `}' token src/wx.cpp:337: error: declaration does not declare anything src/wx.cpp:350: error: parse error before `>>' token src/wx.cpp:359: error: parse error before `!=' token src/wx.cpp:376: error: `tb' was not declared in this scope src/wx.cpp:376: error: `tb' was not declared in this scope src/wx.cpp:377: error: `nb' was not declared in this scope src/wx.cpp:378: error: parse error before `while' src/wx.cpp:379: error: ISO C++ forbids declaration of `ne' with no type src/wx.cpp:379: error: conflicting types for `int*ne' src/wx.cpp:377: error: previous declaration as `const char*ne' src/wx.cpp:379: error: parse error before `++' token src/wx.cpp:382: error: ISO C++ forbids declaration of `equiv' with no type src/wx.cpp:382: error: `nb' was not declared in this scope src/wx.cpp:382: error: `tb' was not declared in this scope src/wx.cpp:382: error: `SWIG_TypeNameComp' was not declared in this scope src/wx.cpp:383: error: parse error before `if' src/wx.cpp:401: error: ISO C++ forbids declaration of `tc' with no type src/wx.cpp:401: error: `tl' was not declared in this scope src/wx.cpp:402: error: parse error before `while' src/wx.cpp:415: error: ISO C++ forbids declaration of `head' with no type src/wx.cpp:416: error: ISO C++ forbids declaration of `next' with no type src/wx.cpp:416: error: conflicting types for `int next' src/wx.cpp:335: error: previous declaration as `swig_cast_info*next' src/wx.cpp:416: error: base operand of `->' is not a pointer src/wx.cpp:417: error: parse error before `goto' src/wx.cpp:425: error: parse error before `!=' token src/wx.cpp: In function `int SWIG_TypeEquiv(const char*, const char*)': src/wx.cpp:445: error: parse error before `>>' token src/wx.cpp:447: error: `SWIG_TypeNameComp' undeclared (first use this function) src/wx.cpp:447: error: (Each undeclared identifier is reported only once for each function it appears in.) src/wx.cpp: At global scope: src/wx.cpp:453: error: parse error before `<<' token src/wx.cpp:456: error: ISO C++ forbids declaration of `tl' with no type src/wx.cpp:456: error: `ti' was not declared in this scope src/wx.cpp:459: error: syntax error before `:' token src/wx.cpp:461: error: ISO C++ forbids declaration of `tc' with no type src/wx.cpp:461: error: redefinition of `int tc' src/wx.cpp:401: error: `int tc' previously defined here src/wx.cpp:461: error: `ti' was not declared in this scope src/wx.cpp:463: error: parse error before `while' src/wx.cpp:465: error: syntax error before `->' token src/wx.cpp:466: error: ISO C++ forbids declaration of `head' with no type src/wx.cpp:466: error: redefinition of `int head' src/wx.cpp:415: error: `int head' previously declared here src/wx.cpp:467: error: syntax error before `++' token src/wx.cpp:476: error: redefinition of `const char*te' src/wx.cpp:376: error: `const char*te' previously defined here src/wx.cpp:476: error: `tb' was not declared in this scope src/wx.cpp:476: error: `tb' was not declared in this scope src/wx.cpp:477: error: conflicting types for `const char*ne' src/wx.cpp:379: error: previous declaration as `int*ne' src/wx.cpp:477: error: `nb' was not declared in this scope src/wx.cpp:478: error: parse error before `while' src/wx.cpp:479: error: ISO C++ forbids declaration of `ne' with no type src/wx.cpp:479: error: conflicting types for `int*ne' src/wx.cpp:477: error: previous declaration as `const char*ne' src/wx.cpp:479: error: parse error before `++' token src/wx.cpp:482: error: ISO C++ forbids declaration of `equiv' with no type src/wx.cpp:482: error: redefinition of `int equiv' src/wx.cpp:382: error: `int equiv' previously defined here src/wx.cpp:482: error: `nb' was not declared in this scope src/wx.cpp:482: error: `tb' was not declared in this scope src/wx.cpp:482: error: `SWIG_TypeNameComp' was not declared in this scope src/wx.cpp:483: error: parse error before `if' src/wx.cpp:488: error: syntax error before `->' token src/wx.cpp:504: error: ISO C++ forbids declaration of `s' with no type src/wx.cpp:504: error: `ty' was not declared in this scope src/wx.cpp:505: error: parse error before `do' src/wx.cpp:509: error: syntax error before `->' token src/wx.cpp:514: error: syntax error before `->' token src/wx.cpp:516: error: syntax error before `->' token src/wx.cpp:517: error: syntax error before `->' token src/wx.cpp:520: error: ISO C++ forbids declaration of `s' with no type src/wx.cpp:520: error: redefinition of `int s' src/wx.cpp:504: error: `int s' previously defined here src/wx.cpp:520: error: base operand of `->' is not a pointer src/wx.cpp:521: error: parse error before `}' token src/wx.cpp:552: error: syntax error before `->' token src/wx.cpp:552: error: syntax error before `->' token src/wx.cpp:552: error: syntax error before `->' token src/wx.cpp:552: error: syntax error before `->' token src/wx.cpp:552: error: ISO C++ forbids declaration of `iter' with no type src/wx.cpp:552: error: base operand of `->' is not a pointer src/wx.cpp:552: error: parse error before `}' token src/wx.cpp: In function `swig_cast_info* SWIG_TypeCheckStruct(swig_type_info*, swig_type_info*)': src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:558: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:559: error: parse error before `>>' token src/wx.cpp: At global scope: src/wx.cpp:622: error: parse error before `<<' token src/wx.cpp:632: error: syntax error before `->' token src/wx.cpp:637: error: ISO C++ forbids declaration of `cast' with no type src/wx.cpp:637: error: base operand of `->' is not a pointer src/wx.cpp:638: error: parse error before `}' token src/wx.cpp:662: error: ISO C++ forbids declaration of `ty' with no type src/wx.cpp:662: error: base operand of `->' is not a pointer src/wx.cpp:663: error: parse error before `==' token src/wx.cpp:672: error: base operand of `->' is not a pointer src/wx.cpp:672: error: register name not specified for `size_t r' src/wx.cpp:673: error: parse error before `do' src/wx.cpp:676: error: base operand of `->' is not a pointer src/wx.cpp:676: error: `i' was not declared in this scope src/wx.cpp:677: error: parse error before `if' src/wx.cpp:695: error: ISO C++ forbids declaration of `iter' with no type src/wx.cpp:695: error: redefinition of `int iter' src/wx.cpp:552: error: `int iter' previously defined here src/wx.cpp:695: error: base operand of `->' is not a pointer src/wx.cpp:696: error: parse error before `}' token src/wx.cpp: In function `swig_type_info* SWIG_TypeQueryModule(swig_module_info*, swig_module_info*, const char*)': src/wx.cpp:714: error: `SWIG_MangledTypeQueryModule' undeclared (first use this function) src/wx.cpp:729: error: parse error before `>>' token src/wx.cpp: At global scope: src/wx.cpp:736: error: parse error before `<<' token src/wx.cpp:745: error: syntax error before `->' token src/wx.cpp:746: error: ISO C++ forbids declaration of `equiv' with no type src/wx.cpp:746: error: redefinition of `int equiv' src/wx.cpp:482: error: `int equiv' previously defined here src/wx.cpp:746: error: `ti' was not declared in this scope src/wx.cpp:747: error: parse error before `while' src/wx.cpp:753: error: ISO C++ forbids declaration of `tc' with no type src/wx.cpp:753: error: redefinition of `int tc' src/wx.cpp:461: error: `int tc' previously defined here src/wx.cpp:753: error: base operand of `->' is not a pointer src/wx.cpp:754: error: parse error before `}' token src/wx.cpp:756: error: ISO C++ forbids declaration of `equiv' with no type src/wx.cpp:756: error: redefinition of `int equiv' src/wx.cpp:746: error: `int equiv' previously defined here src/wx.cpp:756: error: base operand of `->' is not a pointer src/wx.cpp:757: error: parse error before `}' token src/wx.cpp:769: error: `ptr' was not declared in this scope src/wx.cpp:770: error: `sz' was not declared in this scope src/wx.cpp:771: error: register name not specified for `unsigned char uu' src/wx.cpp:772: error: parse error before `==' token src/wx.cpp:779: error: conflicting types for `const unsigned char*u' src/wx.cpp:769: error: previous declaration as `unsigned char*u' src/wx.cpp:779: error: `ptr' was not declared in this scope src/wx.cpp:780: error: redefinition of `const unsigned char*eu' src/wx.cpp:770: error: `const unsigned char*eu' previously defined here src/wx.cpp:780: error: `sz' was not declared in this scope src/wx.cpp:780: error: register name not specified for `const unsigned char*eu' src/wx.cpp:781: error: parse error before `>>' token src/wx.cpp:782: error: syntax error before `!=' token src/wx.cpp:784: error: parse error before `++' token src/wx.cpp:785: error: parse error before `++' token src/wx.cpp:797: error: redefinition of `const unsigned char*eu' src/wx.cpp:780: error: `const unsigned char*eu' previously defined here src/wx.cpp:797: error: `sz' was not declared in this scope src/wx.cpp:797: error: register name not specified for `const unsigned char*eu' src/wx.cpp:798: error: parse error before `==' token src/wx.cpp:805: error: redefinition of `const unsigned char*eu' src/wx.cpp:797: error: `const unsigned char*eu' previously defined here src/wx.cpp:805: error: `sz' was not declared in this scope src/wx.cpp:805: error: register name not specified for `const unsigned char*eu' src/wx.cpp:806: error: parse error before `>>' token src/wx.cpp:807: error: syntax error before `!=' token src/wx.cpp:810: error: redefinition of `unsigned char uu' src/wx.cpp:771: error: `unsigned char uu' previously declared here src/wx.cpp:810: error: register name not specified for `unsigned char uu' src/wx.cpp:811: error: parse error before `==' token src/wx.cpp:813: error: redefinition of `unsigned char uu' src/wx.cpp:810: error: `unsigned char uu' previously defined here src/wx.cpp:813: error: register name not specified for `unsigned char uu' src/wx.cpp:814: error: parse error before `>>' token src/wx.cpp:821: error: ISO C++ forbids declaration of `d' with no type src/wx.cpp:821: error: `c' was not declared in this scope src/wx.cpp:822: error: parse error before `if' src/wx.cpp:828: error: ISO C++ forbids declaration of `u' with no type src/wx.cpp:828: error: conflicting types for `int*u' src/wx.cpp:779: error: previous declaration as `const unsigned char*u' src/wx.cpp:829: error: parse error before `}' token src/wx.cpp:843: error: conflicting types for `swig_type_info*tc' src/wx.cpp:753: error: previous declaration as `int tc' src/wx.cpp:844: error: parse error before `if' src/wx.cpp:851: error: ISO C++ forbids declaration of `tc' with no type src/wx.cpp:851: error: conflicting types for `int tc' src/wx.cpp:843: error: previous declaration as `swig_type_info*tc' src/wx.cpp:851: error: base operand of `->' is not a pointer src/wx.cpp:852: error: parse error before `}' token src/wx.cpp:854: error: ISO C++ forbids declaration of `equiv' with no type src/wx.cpp:854: error: redefinition of `int equiv' src/wx.cpp:756: error: `int equiv' previously defined here src/wx.cpp:854: error: base operand of `->' is not a pointer src/wx.cpp:855: error: parse error before `}' token src/wx.cpp: In function `char* SWIG_PackVoidPtr(char*, void*, const char*, unsigned int)': src/wx.cpp:866: error: `SWIG_PackData' undeclared (first use this function) src/wx.cpp: In function `const char* SWIG_UnpackVoidPtr(const char*, void**, const char*)': src/wx.cpp:882: error: `SWIG_UnpackData' undeclared (first use this function) src/wx.cpp: In function `char* SWIG_PackDataName(char*, void*, unsigned int, const char*, unsigned int)': src/wx.cpp:891: error: `SWIG_PackData' undeclared (first use this function) src/wx.cpp: In function `const char* SWIG_UnpackDataName(const char*, void*, unsigned int, const char*)': src/wx.cpp:910: error: `SWIG_UnpackData' undeclared (first use this function) src/wx.cpp: At global scope: src/wx.cpp:914: error: parse error before `}' token src/wx.cpp:940:1: warning: "SWIGEXPORT" redefined src/wx.cpp:99:1: warning: this is the location of the previous definition src/wx.cpp:946: error: parse error before `==' token src/wx.cpp:954: error: parse error before `++' token src/wx.cpp:955: error: ISO C++ forbids declaration of `r' with no type src/wx.cpp:955: error: conflicting types for `int r' src/wx.cpp:672: error: previous declaration as `size_t r' src/wx.cpp:955: error: `ptr' was not declared in this scope src/wx.cpp:955: error: `SWIG_PackData' was not declared in this scope src/wx.cpp:956: error: parse error before `if' src/wx.cpp:957: error: `name' was not declared in this scope src/wx.cpp:957: error: ISO C++ forbids declaration of `strcpy' with no type src/wx.cpp:957: error: `int strcpy' redeclared as different kind of symbol /usr/include/string.h:83: error: previous declaration of `char* strcpy(char*, const char*)' src/wx.cpp:957: error: initializer list being treated as compound expression src/wx.cpp:958: error: parse error before `return' src/wx.cpp: In function `const char* SWIG_UnpackVoidPtr(const char*, void**, const char*)': src/wx.cpp:962: error: redefinition of `const char* SWIG_UnpackVoidPtr(const char*, void**, const char*)' src/wx.cpp:873: error: `const char* SWIG_UnpackVoidPtr(const char*, void**, const char*)' previously defined here src/wx.cpp:962: error: redefinition of `const char* SWIG_UnpackVoidPtr(const char*, void**, const char*)' src/wx.cpp:873: error: `const char* SWIG_UnpackVoidPtr(const char*, void**, const char*)' previously defined here src/wx.cpp:971: error: `SWIG_UnpackData' undeclared (first use this function) src/wx.cpp: In function `char* SWIG_PackDataName(char*, void*, unsigned int, const char*, unsigned int)': src/wx.cpp:975: error: redefinition of `char* SWIG_PackDataName(char*, void*, unsigned int, const char*, unsigned int)' src/wx.cpp:886: error: `char* SWIG_PackDataName(char*, void*, unsigned int, const char*, unsigned int)' previously defined here src/wx.cpp:975: error: redefinition of `char* SWIG_PackDataName(char*, void*, unsigned int, const char*, unsigned int)' src/wx.cpp:886: error: `char* SWIG_PackDataName(char*, void*, unsigned int, const char*, unsigned int)' previously defined here src/wx.cpp:980: error: `SWIG_PackData' undeclared (first use this function) src/wx.cpp: In function `const char* SWIG_UnpackDataName(const char*, void*, unsigned int, const char*)': src/wx.cpp:990: error: redefinition of `const char* SWIG_UnpackDataName(const char*, void*, unsigned int, const char*)' src/wx.cpp:901: error: `const char* SWIG_UnpackDataName(const char*, void*, unsigned int, const char*)' previously defined here src/wx.cpp:990: error: redefinition of `const char* SWIG_UnpackDataName(const char*, void*, unsigned int, const char*)' src/wx.cpp:901: error: `const char* SWIG_UnpackDataName(const char*, void*, unsigned int, const char*)' previously defined here src/wx.cpp:999: error: `SWIG_UnpackData' undeclared (first use this function) src/wx.cpp: At global scope: src/wx.cpp:1001: error: parse error before `>>' token src/wx.cpp:1010: error: `swig_type_list' was not declared in this scope src/wx.cpp: In function `swig_type_info* SWIG_TypeRegister(swig_type_info*)': src/wx.cpp:1016: error: `SWIG_TypeRegisterTL' undeclared (first use this function) src/wx.cpp: In function `swig_type_info* SWIG_TypeQuery(const char*)': src/wx.cpp:1022: error: `SWIG_TypeQueryTL' undeclared (first use this function) src/wx.cpp: In function `void SWIG_TypeClientData(swig_type_info*, void*)': src/wx.cpp:1028: error: `SWIG_TypeClientDataTL' undeclared (first use this function) src/wx.cpp: In function `void SWIG_PropagateClientData(swig_type_info*)': src/wx.cpp:1038: error: `SWIG_PropagateClientDataTL' undeclared (first use this function) src/wx.cpp: At global scope: src/wx.cpp:1042: error: parse error before `}' token src/wx.cpp: In function `void SWIG_Ruby_InitRuntime()': src/wx.cpp:1117: error: `_mSWIG' undeclared (first use this function) src/wx.cpp: In function `int SWIG_Ruby_ConvertPtr(long unsigned int, void**, swig_type_info*, int)': src/wx.cpp:1224: error: `SWIG_TypeCheck' undeclared (first use this function) src/wx.cpp:1231: error: `SWIG_TypeCast' undeclared (first use this function) src/wx.cpp: In function `int SWIG_Ruby_CheckConvert(long unsigned int, swig_type_info*)': src/wx.cpp:1252: error: `SWIG_TypeCheck' undeclared (first use this function) src/wx.cpp: In function `VALUE SWIG_Ruby_NewPackedObj(void*, int, swig_type_info*)': src/wx.cpp:1261: error: `SWIG_PackData' undeclared (first use this function) src/wx.cpp:1262: error: `strcpy' cannot be used as a function src/wx.cpp: In function `void SWIG_Ruby_ConvertPacked(long unsigned int, void*, int, swig_type_info*, int)': src/wx.cpp:1269: error: parse error before `<<' token src/wx.cpp:1272: error: parse error before `==' token src/wx.cpp:1274: error: redeclaration of `const char*c' src/wx.cpp:1271: error: `const char*c' previously declared here src/wx.cpp:1274: error: declaration of `const char*c' src/wx.cpp:1271: error: conflicts with previous declaration `const char*c' src/wx.cpp:1275: error: parse error before `>>' token src/wx.cpp:1282: error: `SWIG_UnpackData' undeclared (first use this function) src/wx.cpp:1284: error: `SWIG_TypeCheck' undeclared (first use this function) src/wx.cpp: At global scope: src/wx.cpp:1321: error: parse error before `}' token src/wx.cpp:1335:1: warning: "SWIGTYPE_p_int" redefined src/wx.cpp:1332:1: warning: this is the location of the previous definition src/wx.cpp:1336:1: warning: "SWIGTYPE_p_unsigned_long" redefined src/wx.cpp:1329:1: warning: this is the location of the previous definition src/wx.cpp:1338:1: warning: "SWIGTYPE_p_wxWindow" redefined src/wx.cpp:1330:1: warning: this is the location of the previous definition src/wx.cpp:1340: error: `swig_types' was not declared in this scope src/wx.cpp:1343: error: parse error before `>>' token In file included from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3/bits/char_traits.h:45, from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3/string:47, from /usr/include/wx-2.6/wx/string.h:170, from /usr/include/wx-2.6/wx/memory.h:20, from /usr/include/wx-2.6/wx/object.h:25, from /usr/include/wx-2.6/wx/wx.h:16, from src/wx.cpp:1372: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3/cstring:81: error: ` strcpy' is already declared in this scope src/wx.cpp:1620: error: parse error before `<<' token src/wx.cpp:1631: error: parse error before `if' src/wx.cpp:1639: error: ISO C++ forbids declaration of `arg3' with no type src/wx.cpp:1639: error: redefinition of `int arg3' src/wx.cpp:1624: error: `int arg3' previously declared here src/wx.cpp:1639: error: `argv' was not declared in this scope src/wx.cpp:1639: error: `argv' was not declared in this scope src/wx.cpp:1639: error: `argv' was not declared in this scope src/wx.cpp:1640: error: `argv' was not declared in this scope src/wx.cpp:1640: error: `swig_types' was not declared in this scope src/wx.cpp:1640: error: ISO C++ forbids declaration of `SWIG_Ruby_ConvertPtr' with no type src/wx.cpp:1640: error: `int SWIG_Ruby_ConvertPtr' redeclared as different kind of symbol src/wx.cpp:1197: error: previous declaration of `int SWIG_Ruby_ConvertPtr(long unsigned int, void**, swig_type_info*, int)' src/wx.cpp:1640: error: initializer list being treated as compound expression src/wx.cpp:1641: error: ISO C++ forbids declaration of `arg5' with no type src/wx.cpp:1641: error: redefinition of `int arg5' src/wx.cpp:1626: error: `int arg5' previously declared here src/wx.cpp:1641: error: `argv' was not declared in this scope src/wx.cpp:1641: error: `argv' was not declared in this scope src/wx.cpp:1641: error: `argv' was not declared in this scope src/wx.cpp:1642: error: ISO C++ forbids declaration of `arg6' with no type src/wx.cpp:1642: error: redefinition of `int arg6' src/wx.cpp:1627: error: `int arg6' previously declared here src/wx.cpp:1642: error: `argv' was not declared in this scope src/wx.cpp:1642: error: `argv' was not declared in this scope src/wx.cpp:1642: error: `argv' was not declared in this scope src/wx.cpp:1643: error: ISO C++ forbids declaration of `result' with no type src/wx.cpp:1643: error: redefinition of `int result' src/wx.cpp:1628: error: `int result' previously declared here src/wx.cpp:1643: error: `arg1' was not declared in this scope src/wx.cpp:1645: error: ISO C++ forbids declaration of `vresult' with no type src/wx.cpp:1645: error: conflicting types for `int vresult' src/wx.cpp:1629: error: previous declaration as `VALUE vresult' src/wx.cpp:1646: error: parse error before `return' src/wx.cpp: In function `VALUE _wrap_wxMessageBox__SWIG_1(int, VALUE*, long unsigned int)': src/wx.cpp:1669: error: `swig_types' undeclared (first use this function) src/wx.cpp:1669: error: `SWIG_Ruby_ConvertPtr' cannot be used as a function src/wx.cpp: In function `VALUE _wrap_wxMessageBox__SWIG_2(int, VALUE*, long unsigned int)': src/wx.cpp:1696: error: `SWIG_Ruby_ConvertPtr' cannot be used as a function src/wx.cpp: In function `VALUE _wrap_wxMessageBox__SWIG_5(int, VALUE*, long unsigned int)': src/wx.cpp:1752: error: parse error before `==' token src/wx.cpp:1763: error: parse error before `>>' token src/wx.cpp:1767: error: parse error before `<<' token src/wx.cpp:1773: error: `arg1' undeclared (first use this function) src/wx.cpp:1779: error: `SWIG_Ruby_ConvertPtr' cannot be used as a function src/wx.cpp: In function `VALUE _wrap_wxMessageBox__SWIG_1(int, VALUE*, long unsigned int)': src/wx.cpp:1790: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_1(int, VALUE*, long unsigned int)' src/wx.cpp:1651: error: `VALUE _wrap_wxMessageBox__SWIG_1(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp:1790: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_1(int, VALUE*, long unsigned int)' src/wx.cpp:1651: error: `VALUE _wrap_wxMessageBox__SWIG_1(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp:1808: error: `SWIG_Ruby_ConvertPtr' cannot be used as a function src/wx.cpp: In function `VALUE _wrap_wxMessageBox__SWIG_2(int, VALUE*, long unsigned int)': src/wx.cpp:1818: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_2(int, VALUE*, long unsigned int)' src/wx.cpp:1679: error: `VALUE _wrap_wxMessageBox__SWIG_2(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp:1818: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_2(int, VALUE*, long unsigned int)' src/wx.cpp:1679: error: `VALUE _wrap_wxMessageBox__SWIG_2(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp:1835: error: `SWIG_Ruby_ConvertPtr' cannot be used as a function src/wx.cpp: In function `VALUE _wrap_wxMessageBox__SWIG_3(int, VALUE*, long unsigned int)': src/wx.cpp:1844: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_3(int, VALUE*, long unsigned int)' src/wx.cpp:1705: error: `VALUE _wrap_wxMessageBox__SWIG_3(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp:1844: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_3(int, VALUE*, long unsigned int)' src/wx.cpp:1705: error: `VALUE _wrap_wxMessageBox__SWIG_3(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp: In function `VALUE _wrap_wxMessageBox__SWIG_4(int, VALUE*, long unsigned int)': src/wx.cpp:1868: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_4(int, VALUE*, long unsigned int)' src/wx.cpp:1729: error: `VALUE _wrap_wxMessageBox__SWIG_4(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp:1868: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_4(int, VALUE*, long unsigned int)' src/wx.cpp:1729: error: `VALUE _wrap_wxMessageBox__SWIG_4(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp: In function `VALUE _wrap_wxMessageBox__SWIG_5(int, VALUE*, long unsigned int)': src/wx.cpp:1890: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_5(int, VALUE*, long unsigned int)' src/wx.cpp:1751: error: `VALUE _wrap_wxMessageBox__SWIG_5(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp:1890: error: redefinition of `VALUE _wrap_wxMessageBox__SWIG_5(int, VALUE*, long unsigned int)' src/wx.cpp:1751: error: `VALUE _wrap_wxMessageBox__SWIG_5(int, VALUE*, long unsigned int)' previously defined here src/wx.cpp:1896: error: parse error before `>>' token src/wx.cpp: In function `VALUE _wrap_wxMessageBox(int, VALUE*, long unsigned int)': src/wx.cpp:1923: error: call of overloaded `_wrap_wxMessageBox__SWIG_5(int&, VALUE*&, VALUE&)' is ambiguous src/wx.cpp:1751: error: candidates are: VALUE _wrap_wxMessageBox__SWIG_5(int, VALUE*, long unsigned int) src/wx.cpp:1890: error: VALUE _wrap_wxMessageBox__SWIG_5(int, VALUE*, long unsigned int) src/wx.cpp:1936: error: call of overloaded `_wrap_wxMessageBox__SWIG_4(int&, VALUE*&, VALUE&)' is ambiguous src/wx.cpp:1729: error: candidates are: VALUE _wrap_wxMessageBox__SWIG_4(int, VALUE*, long unsigned int) src/wx.cpp:1868: error: VALUE _wrap_wxMessageBox__SWIG_4(int, VALUE*, long unsigned int) src/wx.cpp:1954: error: call of overloaded `_wrap_wxMessageBox__SWIG_3(int&, VALUE*&, VALUE&)' is ambiguous src/wx.cpp:1705: error: candidates are: VALUE _wrap_wxMessageBox__SWIG_3(int, VALUE*, long unsigned int) src/wx.cpp:1844: error: VALUE _wrap_wxMessageBox__SWIG_3(int, VALUE*, long unsigned int) src/wx.cpp:1975: error: `SWIG_Ruby_ConvertPtr' cannot be used as a function src/wx.cpp:1978: error: call of overloaded `_wrap_wxMessageBox__SWIG_2(int&, VALUE*&, VALUE&)' is ambiguous src/wx.cpp:1679: error: candidates are: VALUE _wrap_wxMessageBox__SWIG_2(int, VALUE*, long unsigned int) src/wx.cpp:1818: error: VALUE _wrap_wxMessageBox__SWIG_2(int, VALUE*, long unsigned int) src/wx.cpp:2000: error: `SWIG_Ruby_ConvertPtr' cannot be used as a function src/wx.cpp:2007: error: call of overloaded `_wrap_wxMessageBox__SWIG_1(int&, VALUE*&, VALUE&)' is ambiguous src/wx.cpp:1651: error: candidates are: VALUE _wrap_wxMessageBox__SWIG_1(int, VALUE*, long unsigned int) src/wx.cpp:1790: error: VALUE _wrap_wxMessageBox__SWIG_1(int, VALUE*, long unsigned int) src/wx.cpp:2030: error: `SWIG_Ruby_ConvertPtr' cannot be used as a function src/wx.cpp:2041: error: `_wrap_wxMessageBox__SWIG_0' undeclared (first use this function) src/wx.cpp: At global scope: src/wx.cpp:2058: error: parse error before `<<' token src/wx.cpp:2060: error: too many initializers for `swig_type_info' src/wx.cpp:2060: error: too many initializers for `swig_type_info' src/wx.cpp:2060: error: too many initializers for `swig_type_info' src/wx.cpp:2060: error: cannot convert `const char*' to ` swig_type_info*(*)(void**)' in initialization src/wx.cpp:2061: error: too many initializers for `swig_type_info' src/wx.cpp:2061: error: too many initializers for `swig_type_info' src/wx.cpp:2061: error: too many initializers for `swig_type_info' src/wx.cpp:2061: error: cannot convert `const char*' to ` swig_type_info*(*)(void**)' in initialization src/wx.cpp:2062: error: too many initializers for `swig_type_info' src/wx.cpp:2062: error: too many initializers for `swig_type_info' src/wx.cpp:2062: error: too many initializers for `swig_type_info' src/wx.cpp:2062: error: cannot convert `const char*' to ` swig_type_info*(*)(void**)' in initialization src/wx.cpp:2063: error: parse error before `==' token src/wx.cpp:2066: error: conflicting types for `swig_type_info _swigt__p_wxString' src/wx.cpp:2061: error: previous declaration as `swig_type_info _swigt__p_wxString[3]' src/wx.cpp:2067: error: conflicting types for `swig_type_info _swigt__p_wxWindow' src/wx.cpp:2060: error: previous declaration as `swig_type_info _swigt__p_wxWindow[3]' src/wx.cpp:2074: error: cannot convert `swig_type_info (*)[3]' to ` swig_type_info*' in initialization src/wx.cpp:2075: error: parse error before `>>' token src/wx.cpp:2086: error: elements of array `swig_cast_info _swigc__p_unsigned_long[]' have incomplete type src/wx.cpp:2086: error: storage size of `_swigc__p_unsigned_long' isn't known src/wx.cpp:2086: error: storage size of `_swigc__p_unsigned_long' isn't known src/wx.cpp:2087: error: elements of array `swig_cast_info _swigc__p_wxString[]' have incomplete type src/wx.cpp:2087: error: storage size of `_swigc__p_wxString' isn't known src/wx.cpp:2087: error: storage size of `_swigc__p_wxString' isn't known src/wx.cpp:2088: error: elements of array `swig_cast_info _swigc__p_wxWindow[]' have incomplete type src/wx.cpp:2088: error: storage size of `_swigc__p_wxWindow' isn't known src/wx.cpp:2088: error: storage size of `_swigc__p_wxWindow' isn't known src/wx.cpp:2091: error: `_swigc__p_int' was not declared in this scope src/wx.cpp:2095: error: parse error before `>>' token src/wx.cpp: In function `void SWIG_InitializeModule(void*)': src/wx.cpp:2180: error: `SWIG_MangledTypeQueryModule' undeclared (first use this function) src/wx.cpp:2191: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2196: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2199: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2205: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2206: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2211: error: cannot increment a pointer to incomplete type ` swig_cast_info' src/wx.cpp: In function `void SWIG_PropagateClientData()': src/wx.cpp:2237: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2238: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2238: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2239: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp:2241: error: invalid use of undefined type `struct swig_cast_info' src/wx.cpp:322: error: forward declaration of `struct swig_cast_info' src/wx.cpp: At global scope: src/wx.cpp:2255: error: syntax error before `void' src/wx.cpp:2258: error: ISO C++ forbids declaration of `SWIG_Ruby_InitRuntime' with no type src/wx.cpp:2258: error: new declaration `int SWIG_Ruby_InitRuntime()' src/wx.cpp:1114: error: ambiguates old declaration `void SWIG_Ruby_InitRuntime()' src/wx.cpp:2259: error: ISO C++ forbids declaration of `mWxruby2' with no type src/wx.cpp:2261: error: ISO C++ forbids declaration of `SWIG_InitializeModule' with no type src/wx.cpp:2261: error: `int SWIG_InitializeModule' redeclared as different kind of symbol src/wx.cpp:2147: error: previous declaration of `void SWIG_InitializeModule(void*)' src/wx.cpp:2262: error: parse error before `for' src/wx.cpp:2262: error: parse error before `;' token src/wx.cpp:2262: error: syntax error before `++' token src/wx.cpp:2270: error: ISO C++ forbids declaration of `InitializeOtherModules' with no type src/wx.cpp:2270: error: new declaration `int InitializeOtherModules()' src/wx.cpp:2269: error: ambiguates old declaration `void InitializeOtherModules()' src/wx.cpp:2272: error: ISO C++ forbids declaration of `rb_define_const' with no type src/wx.cpp:2272: error: `int rb_define_const' redeclared as different kind of symbol /usr/lib/ruby/1.8/i686-linux/ruby.h:486: error: previous declaration of `void rb_define_const(long unsigned int, const char*, long unsigned int)' src/wx.cpp:2272: error: initializer list being treated as compound expression src/wx.cpp:2273: error: ISO C++ forbids declaration of ` rb_define_module_function' with no type src/wx.cpp:2273: error: `int rb_define_module_function' redeclared as different kind of symbol /usr/lib/ruby/1.8/i686-linux/ruby.h:491: error: previous declaration of `void rb_define_module_function(long unsigned int, const char*, VALUE (*)(...), int)' src/wx.cpp:2273: error: initializer list being treated as compound expression src/wx.cpp:2274: error: parse error before `}' token src/wx.cpp: In function `void InitializeOtherModules()': src/wx.cpp:2278: error: new declaration `void InitializeOtherModules()' src/wx.cpp:2270: error: ambiguates old declaration `int InitializeOtherModules()' src/wx.cpp:2066: confused by earlier errors, bailing out rake aborted! Command failed with status (1): [i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/in...] From wxruby at qualitycode.com Sat Aug 6 18:27:22 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 6 18:21:45 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <42F52CF6.5040906@xs4all.nl> References: <42F2DDF3.2090409@qualitycode.com> <42F4DB35.7080909@qualitycode.com> <42F52CF6.5040906@xs4all.nl> Message-ID: <42F5394A.2090008@qualitycode.com> Jonathan Maasland wrote: > Nice work Kevin! Good to see you are making alot of progress. Thanks! > I'd really > like to help you out more but unfortunately I haven't yet found the time > to investigate Swig. Atm I can only dl the source tree and share my > results. So here goes: That's still very helpful. Probably more so than most folks realize. > Executing the rake command immediatly fails on my machine: > ---- > SWIG Version 1.3.24 > Copyright (c) 1995-1998 > University of Utah and the Regents of the University of California > Copyright (c) 1998-2004 > University of Chicago > Compiled with i686-pc-linux-gnu-g++ [i686-pc-linux-gnu] > > Please see http://www.swig.org for reporting bugs and further information > undefined method `>=' for nil:NilClass > ./rake/rakewx.rb:21:in `have_good_swig' > ./rake/rakewx.rb:251:in `create_internal_swig_tasks' > ./rakefile:58 > /usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load' > /usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load_rakefile' > /usr/lib/ruby/site_ruby/1.8/rake.rb:1274:in `run' > /usr/bin/rake:8 > rake aborted! > Don't know how to build task 'default' > ---- > > Looking at the function have_good_swig I'm actually a bit puzzled. > When I run irb and execute `swig -version` it neatly prints the output > but the result is actually an empty string! Whoa. That seems really weird to me. Here's what I see in irb: kevins@aria:~/work/wxruby2$ irb irb(main):001:0> `swig -version` => "\nSWIG Version 1.3.25\nCopyright (c) 1995-1998\nUniversity of Utah and the Regents of the University of California\nCopyright (c) 1998-2005\nUniversity of Chicago\nCompiled with g++ [i686-pc-linux-gnu]\n\nPlease see http://www.swig.org for reporting bugs and further information\n" irb(main):002:0> You're saying you see something like => nil as the result there? If anyone can explain why the `command` isn't stuffing the output into the return value, I'd like to hear it. What distro are you using? > Adding a simple return false > before the original return starts the compilation without a snag though > :) (it shouldn't actually but it does....) Actually, it should. Swig is optional, and as long as you haven't modified any rakefiles or swig input files (mostly .i), it should just start compiling the source code. > Unfortunately the compilation fails miserably. Actually, it wasn't all that miserable. > I hope these errors are caused because I'm using Swig 1.3.24, if you'd > like I could update to 1.3.25 and try again. I don't think so, especially since you didn't even run swig. Or, if you did, try re-getting the source (be sure to re-get all the src/ files). I just checked in a change to the rakefile that should believe that your system doesn't have swig, and therefore the standard src/ files should be used. > ------------------------------------------------------------------------ > (snipped some warnings that I want to eliminate eventually, but are ok for now) > i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/wx.o src/wx.cpp > src/wx.cpp:30: error: parse error before `<<' token > src/wx.cpp:31: error: missing ';' before right brace > src/wx.cpp:41: error: parse error before `==' token > In file included from src/wx.cpp:117: > /usr/lib/ruby/1.8/i686-linux/ruby.h:699: error: parse error before `}' token Hmmmm. Can you show me your src/wx.cpp lines 1 through 50? My line 30 is a comment. It's not worth looking at the rest of the errors until we figure this one out. Most likely, solving this one will solve the rest. Thanks, Kevin From nochoice at xs4all.nl Sun Aug 7 05:14:47 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Sun Aug 7 04:58:27 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <42F5394A.2090008@qualitycode.com> References: <42F2DDF3.2090409@qualitycode.com> <42F4DB35.7080909@qualitycode.com> <42F52CF6.5040906@xs4all.nl> <42F5394A.2090008@qualitycode.com> Message-ID: <42F5D107.2090304@xs4all.nl> Hey Kevin, I'm running Gentoo here so all programs are downloaded and compiled using emerge. Relevant: ruby 1.8.2 (2004-12-25) wxGTK2.6.1 with Unicode and debug support Swig 1.3.24 I just redid a complete checkout (no update) of the source-tree The compilation process now throws alot less errors, it doesn't finish correctly though: ---- i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o obj/Functions.o src/Functions.cpp src/Functions.cpp: In function `void log_message(int, VALUE*, long unsigned int)': src/Functions.cpp:940: error: cannot convert `const wxWCharBuffer' to `const wxChar*' for argument `1' to `void wxLogWarning(const wxChar*, ...)' src/Functions.cpp: In function `void log_status(int, VALUE*, long unsigned int) ': src/Functions.cpp:950: error: no matching function for call to `wxLogStatus( wxFrame*&, const wxWCharBuffer)' /usr/include/wx-2.6/wx/log.h:502: error: candidates are: void wxLogStatus(const wxChar*, ...) /usr/include/wx-2.6/wx/log.h:508: error: void wxLogStatus(wxFrame*, const wxChar*, ...) src/Functions.cpp:954: error: no matching function for call to `wxLogStatus( const wxWCharBuffer)' /usr/include/wx-2.6/wx/log.h:502: error: candidates are: void wxLogStatus(const wxChar*, ...) /usr/include/wx-2.6/wx/log.h:508: error: void wxLogStatus(wxFrame*, const wxChar*, ...) src/Functions.cpp: In function `void log_warning(int, VALUE*, long unsigned int)': src/Functions.cpp:964: error: cannot convert `const wxWCharBuffer' to `const wxChar*' for argument `1' to `void wxLogWarning(const wxChar*, ...)' src/Functions.cpp: In function `void log_error(int, VALUE*, long unsigned int) ': src/Functions.cpp:972: error: cannot convert `const wxWCharBuffer' to `const wxChar*' for argument `1' to `void wxLogError(const wxChar*, ...)' rake aborted! Command failed with status (1): [i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/in...] ---- Also pasting the first 52 lines of src/wx.cpp at your request: ----- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.25 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. * ----------------------------------------------------------------------------- */ #define SWIG_DIRECTORS #ifdef __cplusplus template class SwigValueWrapper { T *tt; public: SwigValueWrapper() : tt(0) { } SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } SwigValueWrapper(const T& t) : tt(new T(t)) { } ~SwigValueWrapper() { delete tt; } SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } operator T&() const { return *tt; } T *operator&() { return tt; } private: SwigValueWrapper& operator=(const SwigValueWrapper& rhs); }; #endif /*********************************************************************** * * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ************************************************************************/ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) # define SWIGINLINE inline # else # define SWIGINLINE # endif #endif ----- My irb-session (testing the backquote) looks like this: ---- [jonathan@weatherlight] ruby-1.8.2 $ irb irb(main):001:0> `swig -version` SWIG Version 1.3.24 Copyright (c) 1995-1998 University of Utah and the Regents of the University of California Copyright (c) 1998-2004 University of Chicago Compiled with i686-pc-linux-gnu-g++ [i686-pc-linux-gnu] Please see http://www.swig.org for reporting bugs and further information => "" irb(main):002:0> ---- Really, really weird.... Sorry for the long mail, but I hope I've given you all the necessary info. Hoping it helps! Jonathan Kevin Smith wrote: > Jonathan Maasland wrote: > >> Nice work Kevin! Good to see you are making alot of progress. > > > Thanks! > >> I'd really >> like to help you out more but unfortunately I haven't yet found the time >> to investigate Swig. Atm I can only dl the source tree and share my >> results. So here goes: > > > That's still very helpful. Probably more so than most folks realize. > >> Executing the rake command immediatly fails on my machine: >> ---- >> SWIG Version 1.3.24 >> Copyright (c) 1995-1998 >> University of Utah and the Regents of the University of California >> Copyright (c) 1998-2004 >> University of Chicago >> Compiled with i686-pc-linux-gnu-g++ [i686-pc-linux-gnu] >> >> Please see http://www.swig.org for reporting bugs and further >> information >> undefined method `>=' for nil:NilClass >> ./rake/rakewx.rb:21:in `have_good_swig' >> ./rake/rakewx.rb:251:in `create_internal_swig_tasks' >> ./rakefile:58 >> /usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load' >> /usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load_rakefile' >> /usr/lib/ruby/site_ruby/1.8/rake.rb:1274:in `run' >> /usr/bin/rake:8 >> rake aborted! >> Don't know how to build task 'default' >> ---- >> >> Looking at the function have_good_swig I'm actually a bit puzzled. >> When I run irb and execute `swig -version` it neatly prints the output >> but the result is actually an empty string! > > > Whoa. That seems really weird to me. Here's what I see in irb: > > kevins@aria:~/work/wxruby2$ irb > irb(main):001:0> `swig -version` > => "\nSWIG Version 1.3.25\nCopyright (c) 1995-1998\nUniversity of Utah > and the Regents of the University of California\nCopyright (c) > 1998-2005\nUniversity of Chicago\nCompiled with g++ > [i686-pc-linux-gnu]\n\nPlease see http://www.swig.org for reporting > bugs and further information\n" > irb(main):002:0> > > You're saying you see something like > => nil > > as the result there? If anyone can explain why the `command` isn't > stuffing the output into the return value, I'd like to hear it. What > distro are you using? > >> Adding a simple return false >> before the original return starts the compilation without a snag though >> :) (it shouldn't actually but it does....) > > > Actually, it should. Swig is optional, and as long as you haven't > modified any rakefiles or swig input files (mostly .i), it should just > start compiling the source code. > >> Unfortunately the compilation fails miserably. > > > Actually, it wasn't all that miserable. > >> I hope these errors are caused because I'm using Swig 1.3.24, if you'd >> like I could update to 1.3.25 and try again. > > > I don't think so, especially since you didn't even run swig. Or, if > you did, try re-getting the source (be sure to re-get all the src/ > files). I just checked in a change to the rakefile that should believe > that your system doesn't have swig, and therefore the standard src/ > files should be used. > >> ------------------------------------------------------------------------ >> > > (snipped some warnings that I want to eliminate eventually, but are ok > for now) > >> i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 >> -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ >> -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 >> -march=i686 -fPIC -Wno-unused-function -I >> /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux >> -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I >> /usr/lib/ruby/1.8/i686-linux -I . -o obj/wx.o src/wx.cpp >> src/wx.cpp:30: error: parse error before `<<' token >> src/wx.cpp:31: error: missing ';' before right brace >> src/wx.cpp:41: error: parse error before `==' token >> In file included from src/wx.cpp:117: >> /usr/lib/ruby/1.8/i686-linux/ruby.h:699: error: parse error before >> `}' token > > > Hmmmm. Can you show me your src/wx.cpp lines 1 through 50? My line 30 > is a comment. > > It's not worth looking at the rest of the errors until we figure this > one out. Most likely, solving this one will solve the rest. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > From ruby at portfolio16.de Sun Aug 7 11:13:29 2005 From: ruby at portfolio16.de (Tobias Gruetzmacher) Date: Sun Aug 7 11:07:36 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <42F5D107.2090304@xs4all.nl> References: <42F2DDF3.2090409@qualitycode.com> <42F4DB35.7080909@qualitycode.com> <42F52CF6.5040906@xs4all.nl> <42F5394A.2090008@qualitycode.com> <42F5D107.2090304@xs4all.nl> Message-ID: <20050807151329.GB16633@portfolio16.de> Hi, On Sun, Aug 07, 2005 at 11:14:47AM +0200, Jonathan Maasland wrote: > irb(main):001:0> `swig -version` irb(main):001:0> `swig -version` SWIG Version 1.3.24 Copyright (c) 1995-1998 University of Utah and the Regents of the University of California Copyright (c) 1998-2004 University of Chicago Compiled with g++ [i686-pc-linux-gnu] Please see http://www.swig.org for reporting bugs and further information => "" irb(main):002:0> `swig -version 2>&1` => "\nSWIG Version 1.3.24\nCopyright (c) 1995-1998\nUniversity of Utah and the Regents of the University of California\nCopyright (c) 1998-2004\nUniversity of Chicago\nCompiled with g++ [i686-pc-linux-gnu]\n\nPlease see http://www.swig.org for reporting bugs and further information\n" irb(main):003:0> The output goes to STDERR, maybe this was changed in later versions? Greetings Tobi -- GPG-Key 0xE2BEA341 - signed/encrypted mail preferred My, oh so small, homepage: http://portfolio16.de/ http://www.fli4l.de/ - ISDN- & DSL-Router on one disk! Registered FLI4L-User #00000003 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050807/0652c7ce/attachment.bin From roys at mindspring.com Sun Aug 7 12:06:48 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 7 12:01:01 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <20050807151329.GB16633@portfolio16.de> References: <42F2DDF3.2090409@qualitycode.com> <42F4DB35.7080909@qualitycode.com> <42F52CF6.5040906@xs4all.nl> <42F5394A.2090008@qualitycode.com> <42F5D107.2090304@xs4all.nl> <20050807151329.GB16633@portfolio16.de> Message-ID: <42F63198.5060509@mindspring.com> On WinXP I get: irb(main):001:0> `swig -version` => "\nSWIG Version 1.3.25\nCopyright (c) 1995-1998\nUniversity of Utah and the Regents of the University of California\nCopyright (c) 1998-2005\nUniversity of Chicago\nCompiled with g++ [i686-pc-mingw32]\n\nPlease see http://www.swig.org for reporting bugs and further information\n" irb(main):002:0> `swig -version 2>&1` => "\nSWIG Version 1.3.25\nCopyright (c) 1995-1998\nUniversity of Utah and the Regents of the University of California\nCopyright (c) 1998-2005\nUniversity of Chicago\nCompiled with g++ [i686-pc-mingw32]\n\nPlease see http://www.swig.org for reporting bugs and further information\n" irb(main):003:0> So, the 'fix' on the second attempt should work fine either way. Tobias Gruetzmacher wrote: >Hi, > >On Sun, Aug 07, 2005 at 11:14:47AM +0200, Jonathan Maasland wrote: > > >>irb(main):001:0> `swig -version` >> >> >irb(main):001:0> `swig -version` > >SWIG Version 1.3.24 >Copyright (c) 1995-1998 >University of Utah and the Regents of the University of California >Copyright (c) 1998-2004 >University of Chicago >Compiled with g++ [i686-pc-linux-gnu] > >Please see http://www.swig.org for reporting bugs and further >information >=> "" >irb(main):002:0> `swig -version 2>&1` >=> "\nSWIG Version 1.3.24\nCopyright (c) 1995-1998\nUniversity of Utah >and the Regents of the University of California\nCopyright (c) >1998-2004\nUniversity of Chicago\nCompiled with g++ >[i686-pc-linux-gnu]\n\nPlease see http://www.swig.org for reporting bugs >and further information\n" >irb(main):003:0> > >The output goes to STDERR, maybe this was changed in later versions? > >Greetings Tobi > > > >------------------------------------------------------------------------ > >_______________________________________________ >wxruby-users mailing list >wxruby-users@rubyforge.org >http://rubyforge.org/mailman/listinfo/wxruby-users > > From roys at mindspring.com Sun Aug 7 12:22:44 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 7 12:16:54 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <42F5D107.2090304@xs4all.nl> References: <42F2DDF3.2090409@qualitycode.com> <42F4DB35.7080909@qualitycode.com> <42F52CF6.5040906@xs4all.nl> <42F5394A.2090008@qualitycode.com> <42F5D107.2090304@xs4all.nl> Message-ID: <42F63554.80502@mindspring.com> Fixing the wxLog* errors is pretty straightforward. There have been several posts on it over the last week or so. Just go back and take a look. Basically, change those lines to be like: wxLogWarning(wxString(StringValuePtr(str),wxConvUTF8)); Roy Jonathan Maasland wrote: >Hey Kevin, > >I'm running Gentoo here so all programs are downloaded and compiled >using emerge. >Relevant: > ruby 1.8.2 (2004-12-25) > wxGTK2.6.1 with Unicode and debug support > Swig 1.3.24 >I just redid a complete checkout (no update) of the source-tree > >The compilation process now throws alot less errors, it doesn't finish >correctly though: >---- >i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 >-I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 >-D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC >-Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I >/usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I >/usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o >obj/Functions.o src/Functions.cpp >src/Functions.cpp: In function `void log_message(int, VALUE*, long unsigned > int)': >src/Functions.cpp:940: error: cannot convert `const wxWCharBuffer' to `const > wxChar*' for argument `1' to `void wxLogWarning(const wxChar*, ...)' >src/Functions.cpp: In function `void log_status(int, VALUE*, long >unsigned int) > ': >src/Functions.cpp:950: error: no matching function for call to `wxLogStatus( > wxFrame*&, const wxWCharBuffer)' >/usr/include/wx-2.6/wx/log.h:502: error: candidates are: void >wxLogStatus(const > wxChar*, ...) >/usr/include/wx-2.6/wx/log.h:508: error: void > wxLogStatus(wxFrame*, const wxChar*, ...) >src/Functions.cpp:954: error: no matching function for call to `wxLogStatus( > const wxWCharBuffer)' >/usr/include/wx-2.6/wx/log.h:502: error: candidates are: void >wxLogStatus(const > wxChar*, ...) >/usr/include/wx-2.6/wx/log.h:508: error: void > wxLogStatus(wxFrame*, const wxChar*, ...) >src/Functions.cpp: In function `void log_warning(int, VALUE*, long unsigned > int)': >src/Functions.cpp:964: error: cannot convert `const wxWCharBuffer' to `const > wxChar*' for argument `1' to `void wxLogWarning(const wxChar*, ...)' >src/Functions.cpp: In function `void log_error(int, VALUE*, long >unsigned int) > ': >src/Functions.cpp:972: error: cannot convert `const wxWCharBuffer' to `const > wxChar*' for argument `1' to `void wxLogError(const wxChar*, ...)' >rake aborted! >Command failed with status (1): [i686-pc-linux-gnu-g++ -c >-I/usr/lib/wx/in...] >---- > >Also pasting the first 52 lines of src/wx.cpp at your request: >----- >/* >---------------------------------------------------------------------------- > * This file was automatically generated by SWIG (http://www.swig.org). > * Version 1.3.25 > * > * This file is not intended to be easily readable and contains a number of > * coding conventions designed to improve portability and efficiency. Do >not make > * changes to this file unless you know what you are doing--modify the SWIG > * interface file instead. > * >----------------------------------------------------------------------------- >*/ > >#define SWIG_DIRECTORS > >#ifdef __cplusplus >template class SwigValueWrapper { > T *tt; >public: > SwigValueWrapper() : tt(0) { } > SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new >T(*rhs.tt)) { } > SwigValueWrapper(const T& t) : tt(new T(t)) { } > ~SwigValueWrapper() { delete tt; } > SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); >return *this; } > operator T&() const { return *tt; } > T *operator&() { return tt; } >private: > SwigValueWrapper& operator=(const SwigValueWrapper& rhs); >}; >#endif > >/*********************************************************************** > * > * This section contains generic SWIG labels for method/variable > * declarations/attributes, and other compiler dependent labels. > * > ************************************************************************/ > >/* template workaround for compilers that cannot correctly implement the >C++ standard */ >#ifndef SWIGTEMPLATEDISAMBIGUATOR ># if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) ># define SWIGTEMPLATEDISAMBIGUATOR template ># else ># define SWIGTEMPLATEDISAMBIGUATOR ># endif >#endif > >/* inline attribute */ >#ifndef SWIGINLINE ># if defined(__cplusplus) || (defined(__GNUC__) && >!defined(__STRICT_ANSI__)) ># define SWIGINLINE inline ># else ># define SWIGINLINE ># endif >#endif >----- > > >My irb-session (testing the backquote) looks like this: >---- >[jonathan@weatherlight] ruby-1.8.2 $ irb >irb(main):001:0> `swig -version` > >SWIG Version 1.3.24 >Copyright (c) 1995-1998 >University of Utah and the Regents of the University of California >Copyright (c) 1998-2004 >University of Chicago >Compiled with i686-pc-linux-gnu-g++ [i686-pc-linux-gnu] > >Please see http://www.swig.org for reporting bugs and further information >=> "" >irb(main):002:0> >---- >Really, really weird.... > >Sorry for the long mail, but I hope I've given you all the necessary info. > >Hoping it helps! >Jonathan > >Kevin Smith wrote: > > > >>Jonathan Maasland wrote: >> >> >> >>>Nice work Kevin! Good to see you are making alot of progress. >>> >>> >>Thanks! >> >> >> >>>I'd really >>>like to help you out more but unfortunately I haven't yet found the time >>>to investigate Swig. Atm I can only dl the source tree and share my >>>results. So here goes: >>> >>> >>That's still very helpful. Probably more so than most folks realize. >> >> >> >>>Executing the rake command immediatly fails on my machine: >>>---- >>>SWIG Version 1.3.24 >>>Copyright (c) 1995-1998 >>>University of Utah and the Regents of the University of California >>>Copyright (c) 1998-2004 >>>University of Chicago >>>Compiled with i686-pc-linux-gnu-g++ [i686-pc-linux-gnu] >>> >>>Please see http://www.swig.org for reporting bugs and further >>>information >>>undefined method `>=' for nil:NilClass >>>./rake/rakewx.rb:21:in `have_good_swig' >>>./rake/rakewx.rb:251:in `create_internal_swig_tasks' >>>./rakefile:58 >>>/usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load' >>>/usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load_rakefile' >>>/usr/lib/ruby/site_ruby/1.8/rake.rb:1274:in `run' >>>/usr/bin/rake:8 >>>rake aborted! >>>Don't know how to build task 'default' >>>---- >>> >>>Looking at the function have_good_swig I'm actually a bit puzzled. >>>When I run irb and execute `swig -version` it neatly prints the output >>>but the result is actually an empty string! >>> >>> >>Whoa. That seems really weird to me. Here's what I see in irb: >> >>kevins@aria:~/work/wxruby2$ irb >>irb(main):001:0> `swig -version` >>=> "\nSWIG Version 1.3.25\nCopyright (c) 1995-1998\nUniversity of Utah >>and the Regents of the University of California\nCopyright (c) >>1998-2005\nUniversity of Chicago\nCompiled with g++ >>[i686-pc-linux-gnu]\n\nPlease see http://www.swig.org for reporting >>bugs and further information\n" >>irb(main):002:0> >> >>You're saying you see something like >>=> nil >> >>as the result there? If anyone can explain why the `command` isn't >>stuffing the output into the return value, I'd like to hear it. What >>distro are you using? >> >> >> >>>Adding a simple return false >>>before the original return starts the compilation without a snag though >>>:) (it shouldn't actually but it does....) >>> >>> >>Actually, it should. Swig is optional, and as long as you haven't >>modified any rakefiles or swig input files (mostly .i), it should just >>start compiling the source code. >> >> >> >>>Unfortunately the compilation fails miserably. >>> >>> >>Actually, it wasn't all that miserable. >> >> >> >>>I hope these errors are caused because I'm using Swig 1.3.24, if you'd >>>like I could update to 1.3.25 and try again. >>> >>> >>I don't think so, especially since you didn't even run swig. Or, if >>you did, try re-getting the source (be sure to re-get all the src/ >>files). I just checked in a change to the rakefile that should believe >>that your system doesn't have swig, and therefore the standard src/ >>files should be used. >> >> >> >>>------------------------------------------------------------------------ >>> >>> >>> >>(snipped some warnings that I want to eliminate eventually, but are ok >>for now) >> >> >> >>>i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 >>>-I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ >>>-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 >>>-march=i686 -fPIC -Wno-unused-function -I >>>/usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux >>>-I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I >>>/usr/lib/ruby/1.8/i686-linux -I . -o obj/wx.o src/wx.cpp >>>src/wx.cpp:30: error: parse error before `<<' token >>>src/wx.cpp:31: error: missing ';' before right brace >>>src/wx.cpp:41: error: parse error before `==' token >>>In file included from src/wx.cpp:117: >>>/usr/lib/ruby/1.8/i686-linux/ruby.h:699: error: parse error before >>>`}' token >>> >>> >>Hmmmm. Can you show me your src/wx.cpp lines 1 through 50? My line 30 >>is a comment. >> >>It's not worth looking at the rest of the errors until we figure this >>one out. Most likely, solving this one will solve the rest. >> >>Thanks, >> >>Kevin >>_______________________________________________ >>wxruby-users mailing list >>wxruby-users@rubyforge.org >>http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> >> > >_______________________________________________ >wxruby-users mailing list >wxruby-users@rubyforge.org >http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > From roys at mindspring.com Sun Aug 7 19:19:22 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 7 19:13:33 2005 Subject: [Wxruby-users] Can't rake without swig Message-ID: <42F696FA.80401@mindspring.com> You can't rake without swig now. I keep swig out of my path so I can do a build without swig to be sure it works with the download. Exception `Errno::ENOENT' at ./rake/rakewx.rb:20 - No such file or directory - swig -version No such file or directory - swig -version ./rake/rakewx.rb:20:in ``' ./rake/rakewx.rb:20:in `have_good_swig' ./rake/rakewx.rb:254:in `create_internal_swig_tasks' Perhaps this will work better: def have_good_swig begin version = `#{$swig_cmd} -version`.strip.split("\n")[0] rescue SystemCallError end if(!version) return false end return (version >= "SWIG Version 1.3.25" && version < "SWIG Version 2") end Roy From roys at mindspring.com Sun Aug 7 19:25:37 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 7 19:19:47 2005 Subject: [Wxruby-users] Icon problem still exists on latest tarball Message-ID: <42F69871.709@mindspring.com> Icon.cpp still errors with: src/Icon.cpp(1200) : error C2666: 'wxIcon::wxIcon' : 2 overloads have similar conversions I'll now re-swig everything and see how it goes. Roy From roys at mindspring.com Sun Aug 7 20:59:08 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 7 20:53:18 2005 Subject: [Wxruby-users] Reswigged link error Message-ID: <42F6AE5C.3050206@mindspring.com> After reswigging I get link problems: Functions.obj : error LNK2001: unresolved external symbol _mWxruby2 Mac.obj : error LNK2001: unresolved external symbol _mWxruby2 Events.obj : error LNK2001: unresolved external symbol _mWxruby2 ... Which is intriguing since it seems to be defined in wx.cpp From roys at mindspring.com Sun Aug 7 21:07:24 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 7 21:01:33 2005 Subject: [Wxruby-users] Reswigged link error In-Reply-To: <42F6AE5C.3050206@mindspring.com> References: <42F6AE5C.3050206@mindspring.com> Message-ID: <42F6B04C.6060505@mindspring.com> A little investigation shows that, contrary to previous swigging, the line: extern VALUE mWxruby2; gets included inside of an extern "C" section as opposed to where it used to get placed. I'll investigate the old swig code to see what may have kept that sane. Roy Roy Sutton wrote: > After reswigging I get link problems: > > Functions.obj : error LNK2001: unresolved external symbol _mWxruby2 > Mac.obj : error LNK2001: unresolved external symbol _mWxruby2 > Events.obj : error LNK2001: unresolved external symbol _mWxruby2 > ... > > Which is intriguing since it seems to be defined in wx.cpp > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Sun Aug 7 21:44:18 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 7 21:38:49 2005 Subject: [Wxruby-users] Can't rake without swig In-Reply-To: <42F696FA.80401@mindspring.com> References: <42F696FA.80401@mindspring.com> Message-ID: <42F6B8F2.7020806@qualitycode.com> Roy Sutton wrote: > You can't rake without swig now. I keep swig out of my path so I can do > a build without swig to be sure it works with the download. Hm. I actually tested that case. I guess ruby on MSWin behaves a bit differently than on Linux when the command doesn't exist. > Perhaps this will work better: > > def have_good_swig > begin > version = `#{$swig_cmd} -version`.strip.split("\n")[0] > rescue SystemCallError > end > if(!version) > return false > end > return (version >= "SWIG Version 1.3.25" && version < "SWIG Version 2") > end Thanks. Changed and committed. Kevin From wxruby at qualitycode.com Sun Aug 7 21:47:23 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 7 21:41:50 2005 Subject: [Wxruby-users] Reswigged link error In-Reply-To: <42F6B04C.6060505@mindspring.com> References: <42F6AE5C.3050206@mindspring.com> <42F6B04C.6060505@mindspring.com> Message-ID: <42F6B9AB.4010105@qualitycode.com> Roy Sutton wrote: > A little investigation shows that, contrary to previous swigging, the line: > > extern VALUE mWxruby2; > > gets included inside of an extern "C" section as opposed to where it > used to get placed. I'll investigate the old swig code to see what may > have kept that sane. My error. Well, my change anyway. It works fine for me on Linux having the extern be inside a "C" block but the declaration itself be out in C++ land. Doing it the new way simplified the post-processing somewhat. I'll see if I can find a simple way to get it back out to C++ ville, and if not I'll just go back to the ickier way. Thanks, Kevin From roys at mindspring.com Sun Aug 7 22:07:24 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 7 22:01:33 2005 Subject: [Wxruby-users] Reswigged link error In-Reply-To: <42F6B9AB.4010105@qualitycode.com> References: <42F6AE5C.3050206@mindspring.com> <42F6B04C.6060505@mindspring.com> <42F6B9AB.4010105@qualitycode.com> Message-ID: <42F6BE5C.9070905@mindspring.com> What about just declaring mWxruby2 in wx.cpp as extern "C"? Doesn't -have- to be a CPP variable, does it? Kevin Smith wrote: > Roy Sutton wrote: > >> A little investigation shows that, contrary to previous swigging, the >> line: >> >> extern VALUE mWxruby2; >> >> gets included inside of an extern "C" section as opposed to where it >> used to get placed. I'll investigate the old swig code to see what >> may have kept that sane. > > > My error. Well, my change anyway. It works fine for me on Linux having > the extern be inside a "C" block but the declaration itself be out in > C++ land. > > Doing it the new way simplified the post-processing somewhat. I'll see > if I can find a simple way to get it back out to C++ ville, and if not > I'll just go back to the ickier way. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Sun Aug 7 22:28:37 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 7 22:23:06 2005 Subject: [Wxruby-users] Reswigged link error In-Reply-To: <42F6BE5C.9070905@mindspring.com> References: <42F6AE5C.3050206@mindspring.com> <42F6B04C.6060505@mindspring.com> <42F6B9AB.4010105@qualitycode.com> <42F6BE5C.9070905@mindspring.com> Message-ID: <42F6C355.6070202@qualitycode.com> Roy Sutton wrote: > What about just declaring mWxruby2 in wx.cpp as extern "C"? > > Doesn't -have- to be a CPP variable, does it? I think it probably does. I found a pretty reasonable fix though, and it's checked in now. You'll have to reswig everything. It does still get a seg fault when exiting an app, because I haven't re-integrated fixdeleting.rb yet. That's next. Kevin From wxruby at qualitycode.com Mon Aug 8 00:09:46 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 8 00:04:21 2005 Subject: [Wxruby-users] wxruby2 swig retooling "complete" Message-ID: <42F6DB0A.40903@qualitycode.com> I just re-integrated fixdeleting.rb, the last of the post-processors. Running minimal.rb no longer segfaults on exit. Running dialogs.rb and immediately exiting doesn't segfault, but bringing up a dialog and then exiting does. So there are still memory problems, but fewer than yesterday :-/ I'm not sure how it compares to last week. I probably won't have much time to work on wxruby for a few days. I'll try to sneak in a little time to fix up the unicode stuff at least, and any other patches that have been or will be submitted. Cheers, Kevin From nochoice at xs4all.nl Mon Aug 8 07:26:08 2005 From: nochoice at xs4all.nl (Jonathan Maasland) Date: Mon Aug 8 07:09:39 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <42F63554.80502@mindspring.com> References: <42F2DDF3.2090409@qualitycode.com> <42F4DB35.7080909@qualitycode.com> <42F52CF6.5040906@xs4all.nl> <42F5394A.2090008@qualitycode.com> <42F5D107.2090304@xs4all.nl> <42F63554.80502@mindspring.com> Message-ID: <42F74150.4040505@xs4all.nl> Thanks! I'd previously tried that solution and it didn't work. With the current tree it does work :) Guess something changed....(or I'm losing my mind ;) ) Jonathan Roy Sutton wrote: > Fixing the wxLog* errors is pretty straightforward. There have been > several posts on it over the last week or so. Just go back and take a > look. > > Basically, change those lines to be like: > > wxLogWarning(wxString(StringValuePtr(str),wxConvUTF8)); > > Roy > > Jonathan Maasland wrote: > >> Hey Kevin, >> >> I'm running Gentoo here so all programs are downloaded and compiled >> using emerge. >> Relevant: >> ruby 1.8.2 (2004-12-25) >> wxGTK2.6.1 with Unicode and debug support >> Swig 1.3.24 >> I just redid a complete checkout (no update) of the source-tree >> >> The compilation process now throws alot less errors, it doesn't finish >> correctly though: >> ---- >> i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 >> -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 >> -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 -march=i686 -fPIC >> -Wno-unused-function -I /usr/lib/ruby/site_ruby/1.8 -I >> /usr/lib/ruby/site_ruby/1.8/i686-linux -I /usr/lib/ruby/site_ruby -I >> /usr/lib/ruby/1.8 -I /usr/lib/ruby/1.8/i686-linux -I . -o >> obj/Functions.o src/Functions.cpp >> src/Functions.cpp: In function `void log_message(int, VALUE*, long >> unsigned >> int)': >> src/Functions.cpp:940: error: cannot convert `const wxWCharBuffer' to >> `const >> wxChar*' for argument `1' to `void wxLogWarning(const wxChar*, ...)' >> src/Functions.cpp: In function `void log_status(int, VALUE*, long >> unsigned int) >> ': >> src/Functions.cpp:950: error: no matching function for call to >> `wxLogStatus( >> wxFrame*&, const wxWCharBuffer)' >> /usr/include/wx-2.6/wx/log.h:502: error: candidates are: void >> wxLogStatus(const >> wxChar*, ...) >> /usr/include/wx-2.6/wx/log.h:508: error: void >> wxLogStatus(wxFrame*, const wxChar*, ...) >> src/Functions.cpp:954: error: no matching function for call to >> `wxLogStatus( >> const wxWCharBuffer)' >> /usr/include/wx-2.6/wx/log.h:502: error: candidates are: void >> wxLogStatus(const >> wxChar*, ...) >> /usr/include/wx-2.6/wx/log.h:508: error: void >> wxLogStatus(wxFrame*, const wxChar*, ...) >> src/Functions.cpp: In function `void log_warning(int, VALUE*, long >> unsigned >> int)': >> src/Functions.cpp:964: error: cannot convert `const wxWCharBuffer' to >> `const >> wxChar*' for argument `1' to `void wxLogWarning(const wxChar*, ...)' >> src/Functions.cpp: In function `void log_error(int, VALUE*, long >> unsigned int) >> ': >> src/Functions.cpp:972: error: cannot convert `const wxWCharBuffer' to >> `const >> wxChar*' for argument `1' to `void wxLogError(const wxChar*, ...)' >> rake aborted! >> Command failed with status (1): [i686-pc-linux-gnu-g++ -c >> -I/usr/lib/wx/in...] >> ---- >> >> Also pasting the first 52 lines of src/wx.cpp at your request: >> ----- >> /* >> ---------------------------------------------------------------------------- >> >> * This file was automatically generated by SWIG (http://www.swig.org). >> * Version 1.3.25 >> * >> * This file is not intended to be easily readable and contains a >> number of >> * coding conventions designed to improve portability and efficiency. Do >> not make >> * changes to this file unless you know what you are doing--modify the >> SWIG >> * interface file instead. >> * >> ----------------------------------------------------------------------------- >> >> */ >> >> #define SWIG_DIRECTORS >> >> #ifdef __cplusplus >> template class SwigValueWrapper { >> T *tt; >> public: >> SwigValueWrapper() : tt(0) { } >> SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new >> T(*rhs.tt)) { } >> SwigValueWrapper(const T& t) : tt(new T(t)) { } >> ~SwigValueWrapper() { delete tt; } >> SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); >> return *this; } >> operator T&() const { return *tt; } >> T *operator&() { return tt; } >> private: >> SwigValueWrapper& operator=(const SwigValueWrapper& rhs); >> }; >> #endif >> >> /*********************************************************************** >> * >> * This section contains generic SWIG labels for method/variable >> * declarations/attributes, and other compiler dependent labels. >> * >> ************************************************************************/ >> >> >> /* template workaround for compilers that cannot correctly implement the >> C++ standard */ >> #ifndef SWIGTEMPLATEDISAMBIGUATOR >> # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) >> # define SWIGTEMPLATEDISAMBIGUATOR template >> # else >> # define SWIGTEMPLATEDISAMBIGUATOR >> # endif >> #endif >> >> /* inline attribute */ >> #ifndef SWIGINLINE >> # if defined(__cplusplus) || (defined(__GNUC__) && >> !defined(__STRICT_ANSI__)) >> # define SWIGINLINE inline >> # else >> # define SWIGINLINE >> # endif >> #endif >> ----- >> >> >> My irb-session (testing the backquote) looks like this: >> ---- >> [jonathan@weatherlight] ruby-1.8.2 $ irb >> irb(main):001:0> `swig -version` >> >> SWIG Version 1.3.24 >> Copyright (c) 1995-1998 >> University of Utah and the Regents of the University of California >> Copyright (c) 1998-2004 >> University of Chicago >> Compiled with i686-pc-linux-gnu-g++ [i686-pc-linux-gnu] >> >> Please see http://www.swig.org for reporting bugs and further >> information >> => "" >> irb(main):002:0> >> ---- >> Really, really weird.... >> >> Sorry for the long mail, but I hope I've given you all the necessary >> info. >> >> Hoping it helps! >> Jonathan >> >> Kevin Smith wrote: >> >> >> >>> Jonathan Maasland wrote: >>> >>> >>> >>>> Nice work Kevin! Good to see you are making alot of progress. >>> >>> Thanks! >>> >>> >>> >>>> I'd really >>>> like to help you out more but unfortunately I haven't yet found the >>>> time >>>> to investigate Swig. Atm I can only dl the source tree and share my >>>> results. So here goes: >>>> >>> >>> That's still very helpful. Probably more so than most folks realize. >>> >>> >>> >>>> Executing the rake command immediatly fails on my machine: >>>> ---- >>>> SWIG Version 1.3.24 >>>> Copyright (c) 1995-1998 >>>> University of Utah and the Regents of the University of California >>>> Copyright (c) 1998-2004 >>>> University of Chicago >>>> Compiled with i686-pc-linux-gnu-g++ [i686-pc-linux-gnu] >>>> >>>> Please see http://www.swig.org for reporting bugs and further >>>> information >>>> undefined method `>=' for nil:NilClass >>>> ./rake/rakewx.rb:21:in `have_good_swig' >>>> ./rake/rakewx.rb:251:in `create_internal_swig_tasks' >>>> ./rakefile:58 >>>> /usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load' >>>> /usr/lib/ruby/site_ruby/1.8/rake.rb:1225:in `load_rakefile' >>>> /usr/lib/ruby/site_ruby/1.8/rake.rb:1274:in `run' >>>> /usr/bin/rake:8 >>>> rake aborted! >>>> Don't know how to build task 'default' >>>> ---- >>>> >>>> Looking at the function have_good_swig I'm actually a bit puzzled. >>>> When I run irb and execute `swig -version` it neatly prints the output >>>> but the result is actually an empty string! >>>> >>> >>> Whoa. That seems really weird to me. Here's what I see in irb: >>> >>> kevins@aria:~/work/wxruby2$ irb >>> irb(main):001:0> `swig -version` >>> => "\nSWIG Version 1.3.25\nCopyright (c) 1995-1998\nUniversity of Utah >>> and the Regents of the University of California\nCopyright (c) >>> 1998-2005\nUniversity of Chicago\nCompiled with g++ >>> [i686-pc-linux-gnu]\n\nPlease see http://www.swig.org for reporting >>> bugs and further information\n" >>> irb(main):002:0> >>> >>> You're saying you see something like >>> => nil >>> >>> as the result there? If anyone can explain why the `command` isn't >>> stuffing the output into the return value, I'd like to hear it. What >>> distro are you using? >>> >>> >>> >>>> Adding a simple return false >>>> before the original return starts the compilation without a snag >>>> though >>>> :) (it shouldn't actually but it does....) >>>> >>> >>> Actually, it should. Swig is optional, and as long as you haven't >>> modified any rakefiles or swig input files (mostly .i), it should just >>> start compiling the source code. >>> >>> >>> >>>> Unfortunately the compilation fails miserably. >>> >>> Actually, it wasn't all that miserable. >>> >>> >>> >>>> I hope these errors are caused because I'm using Swig 1.3.24, if you'd >>>> like I could update to 1.3.25 and try again. >>>> >>> >>> I don't think so, especially since you didn't even run swig. Or, if >>> you did, try re-getting the source (be sure to re-get all the src/ >>> files). I just checked in a change to the rakefile that should believe >>> that your system doesn't have swig, and therefore the standard src/ >>> files should be used. >>> >>> >>> >>>> ------------------------------------------------------------------------ >>>> >>>> >>>> >>> >>> (snipped some warnings that I want to eliminate eventually, but are ok >>> for now) >>> >>> >>> >>>> i686-pc-linux-gnu-g++ -c -I/usr/lib/wx/include/gtk2-ansi-debug-2.6 >>>> -I/usr/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ >>>> -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 -O2 >>>> -march=i686 -fPIC -Wno-unused-function -I >>>> /usr/lib/ruby/site_ruby/1.8 -I /usr/lib/ruby/site_ruby/1.8/i686-linux >>>> -I /usr/lib/ruby/site_ruby -I /usr/lib/ruby/1.8 -I >>>> /usr/lib/ruby/1.8/i686-linux -I . -o obj/wx.o src/wx.cpp >>>> src/wx.cpp:30: error: parse error before `<<' token >>>> src/wx.cpp:31: error: missing ';' before right brace >>>> src/wx.cpp:41: error: parse error before `==' token >>>> In file included from src/wx.cpp:117: >>>> /usr/lib/ruby/1.8/i686-linux/ruby.h:699: error: parse error before >>>> `}' token >>>> >>> >>> Hmmmm. Can you show me your src/wx.cpp lines 1 through 50? My line 30 >>> is a comment. >>> >>> It's not worth looking at the rest of the errors until we figure this >>> one out. Most likely, solving this one will solve the rest. >>> >>> Thanks, >>> >>> Kevin >>> _______________________________________________ >>> wxruby-users mailing list >>> wxruby-users@rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wxruby-users >>> >>> >>> >> >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> >> >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > From curt at hibbs.com Mon Aug 8 10:35:27 2005 From: curt at hibbs.com (Curt Hibbs) Date: Mon Aug 8 10:29:29 2005 Subject: [Wxruby-users] [Fwd: Re: FXRuby or wxRuby?] Message-ID: <42F76DAF.5080107@hibbs.com> This was just posted on ruby-talk. I'd hate to let this go without any rebuttal or explanation. Can someone (more qualified than me) please compose a response? Thanks, Curt -------- Original Message -------- Subject: Re: FXRuby or wxRuby? Date: Mon, 8 Aug 2005 23:20:24 +0900 From: olof sivertsson Reply-To: ruby-talk@ruby-lang.org To: ruby-talk@ruby-lang.org (ruby-talk ML) References: My experience with wxRuby has not been very pleasent. The main obstacle was bad docs, even the docs at wx's main site are confusing. The wx API interface seems rather bloated in general and this translates over to wxRuby. We also had problems getting the sizers to work as we wanted, and things working on windows and not working on Linux etc. The final nail in the coffin was when we hit the (known) bugs and had to code around them. So we switched to ruby-gtk2 and use glade to draw our GUI's and connect signals to events. The API is wonderful, everything works as expected. Good docs. We redid our entire GUI (ok, it's a small app) in just 10 hours. Linux is the main platform for it, although it might be possible to run in win as well with some work. http://ruby-gnome2.sourceforge.jp/ QtRuby also seems to have a nice API, but I haven't gotten it to work. http://developer.kde.org/language-bindings/ruby/ Never tried FXRuby, mainly because it looks just plain ugly. (But looking plain ugly on all platforms is better than wx that works on some platforms and not others...) Cheers, Olof From wxruby at qualitycode.com Mon Aug 8 14:43:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 8 14:37:43 2005 Subject: [Wxruby-users] [Fwd: Re: FXRuby or wxRuby?] In-Reply-To: <42F76DAF.5080107@hibbs.com> References: <42F76DAF.5080107@hibbs.com> Message-ID: <42F7A7D3.7010009@qualitycode.com> Curt Hibbs wrote: > This was just posted on ruby-talk. I'd hate to let this go without any > rebuttal or explanation. Can someone (more qualified than me) please > compose a response? My opinions inline, below... > olof sivertsson wrote: > My experience with wxRuby has not been very pleasent. I am very sorry to hear that. wxRuby is still definitely a beta-quality product. Until recently, only a few people have contributed much code to the project, so it has evolved rather slowly. There seems to be some good momentum now, with several people submitting code patches, so hopefully this will change. > The main obstacle was bad docs, Understandable. We have been focused on getting the basic code working as a first step. I would rate the documentation as about average for a FLOSS project. Definitely better than many, but still rough. > even the docs at wx's main site are confusing. I think there is a lack of good examples and tutorials, but otherwise I have found the wx docs to be pretty complete. I would be interested to know which parts are confusing. > The wx API interface seems rather bloated in general and this > translates over to wxRuby. True. Solving this will be our next phase, after we get a basic wrapper working. That's the approach that FXRuby took as well, since the FOX API was a bit heavy. Once we have wxRuby working, we can add lots of Ruby sugar on top to make the API much more pleasant. The wx API is definitely not the cleanest of the GUI toolkits. That's partly due to its maturity (10+ years), and partly due to its use of native widgets where possible. > We also had problems getting the sizers to work as we wanted, Sizers can be a challenge. Perhaps that's the part of the wx docs that you found confusing, and I would probably agree. The sizer API is a bit odd, and some of the docs still describe the deprecated mechanism that was replaced by sizers. It will be interesting to see if we can cook up some really cool ruby-ish API improvements for sizers. At a minimum, we can create several good examples. > and things working on windows and not working on Linux etc. There are a few features that are only available on specific platforms due to native-widget issues. Not many, though. Generally, wx itself works very well across multiple platforms. wxRuby probably has more issues at this point, but we plan to fix them. > The final nail in the coffin was when we hit the (known) > bugs and had to code around them. Yup. I sure wish wxRuby could have made faster progress. > So we switched to ruby-gtk2 That's a fine toolkit, and I'm glad it is working for you. It isn't really fully cross-platform, so it's not directly comparable. > QtRuby also seems to have a nice API, but I haven't gotten it to work. > http://developer.kde.org/language-bindings/ruby/ I haven't tried QtRuby, but also has different strengths and weaknesses compared to wxRuby. Qt has much more restrictive licensing for example. > Never tried FXRuby, mainly because it looks just plain ugly. (But > looking plain ugly on all platforms is better than wx that works on > some platforms and not others...) FXRuby is a great toolkit, and probably the one I would recommend to anyone who needs a full-featured cross-platform GUI toolkit today. The main reason I choose to work on wxRuby instead is because FOX doesn't use native widgets. And of course there are still other toolkits that weren't mentioned here. Each has some advantages and disadvantages. Kevin From curt at hibbs.com Mon Aug 8 15:50:44 2005 From: curt at hibbs.com (Curt Hibbs) Date: Mon Aug 8 15:44:55 2005 Subject: [Wxruby-users] [Fwd: Re: FXRuby or wxRuby?] In-Reply-To: <42F7A7D3.7010009@qualitycode.com> References: <42F76DAF.5080107@hibbs.com> <42F7A7D3.7010009@qualitycode.com> Message-ID: <42F7B794.7040006@hibbs.com> Thanks, I'll forward this to ruby-talk. Curt Kevin Smith wrote: > Curt Hibbs wrote: > >> This was just posted on ruby-talk. I'd hate to let this go without any >> rebuttal or explanation. Can someone (more qualified than me) please >> compose a response? > > > My opinions inline, below... > > > olof sivertsson wrote: > >> My experience with wxRuby has not been very pleasent. > > > I am very sorry to hear that. wxRuby is still definitely a beta-quality > product. Until recently, only a few people have contributed much code to > the project, so it has evolved rather slowly. There seems to be some > good momentum now, with several people submitting code patches, so > hopefully this will change. > >> The main obstacle was bad docs, > > > Understandable. We have been focused on getting the basic code working > as a first step. I would rate the documentation as about average for a > FLOSS project. Definitely better than many, but still rough. > >> even the docs at wx's main site are confusing. > > > I think there is a lack of good examples and tutorials, but otherwise I > have found the wx docs to be pretty complete. I would be interested to > know which parts are confusing. > >> The wx API interface seems rather bloated in general and this >> translates over to wxRuby. > > > True. Solving this will be our next phase, after we get a basic wrapper > working. That's the approach that FXRuby took as well, since the FOX API > was a bit heavy. > > Once we have wxRuby working, we can add lots of Ruby sugar on top to > make the API much more pleasant. The wx API is definitely not the > cleanest of the GUI toolkits. That's partly due to its maturity (10+ > years), and partly due to its use of native widgets where possible. > >> We also had problems getting the sizers to work as we wanted, > > > Sizers can be a challenge. Perhaps that's the part of the wx docs that > you found confusing, and I would probably agree. The sizer API is a bit > odd, and some of the docs still describe the deprecated mechanism that > was replaced by sizers. It will be interesting to see if we can cook up > some really cool ruby-ish API improvements for sizers. At a minimum, we > can create several good examples. > >> and things working on windows and not working on Linux etc. > > > There are a few features that are only available on specific platforms > due to native-widget issues. Not many, though. Generally, wx itself > works very well across multiple platforms. wxRuby probably has more > issues at this point, but we plan to fix them. > >> The final nail in the coffin was when we hit the (known) >> bugs and had to code around them. > > > Yup. I sure wish wxRuby could have made faster progress. > >> So we switched to ruby-gtk2 > > > That's a fine toolkit, and I'm glad it is working for you. It isn't > really fully cross-platform, so it's not directly comparable. > >> QtRuby also seems to have a nice API, but I haven't gotten it to work. >> http://developer.kde.org/language-bindings/ruby/ > > > I haven't tried QtRuby, but also has different strengths and weaknesses > compared to wxRuby. Qt has much more restrictive licensing for example. > >> Never tried FXRuby, mainly because it looks just plain ugly. (But >> looking plain ugly on all platforms is better than wx that works on >> some platforms and not others...) > > > FXRuby is a great toolkit, and probably the one I would recommend to > anyone who needs a full-featured cross-platform GUI toolkit today. The > main reason I choose to work on wxRuby instead is because FOX doesn't > use native widgets. > > And of course there are still other toolkits that weren't mentioned > here. Each has some advantages and disadvantages. > > Kevin > From wxruby at qualitycode.com Tue Aug 9 09:22:49 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 9 09:17:06 2005 Subject: [Wxruby-users] wxruby2 retooling In-Reply-To: <42F63554.80502@mindspring.com> References: <42F2DDF3.2090409@qualitycode.com> <42F4DB35.7080909@qualitycode.com> <42F52CF6.5040906@xs4all.nl> <42F5394A.2090008@qualitycode.com> <42F5D107.2090304@xs4all.nl> <42F63554.80502@mindspring.com> Message-ID: <42F8AE29.8080600@qualitycode.com> Roy Sutton wrote: > Fixing the wxLog* errors is pretty straightforward. There have been > several posts on it over the last week or so. Just go back and take a > look. > > Basically, change those lines to be like: > > wxLogWarning(wxString(StringValuePtr(str),wxConvUTF8)); This change has now been committed. Thanks, Kevin From wxruby at qualitycode.com Tue Aug 9 09:32:36 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 9 09:26:49 2005 Subject: [Wxruby-users] Validator In-Reply-To: <42F30489.2090007@mindspring.com> References: <42F30489.2090007@mindspring.com> Message-ID: <42F8B074.4000008@qualitycode.com> Roy Sutton wrote: > For whatever reason I decided to implement the validator class tonight. Cool. Validators are an important part of wx. I look forward to getting your patch when it's ready. > It's my first go at implementing the class. My first run at it looked > pretty good. I just added a generic .i for it and it all compiled. > Sadly, the samples didn't work because the base Validator class can't > actually be used as a validator! You have to derive from > GenericValidator. I thought the way to get around this might be to > include both wxValidator.h and wxGenericValidator.h into the Validator.i > file. I'm a bit unclear on how one might specify that Validator in Ruby > refers to wxGenericValidator. Something to dig into this weekend I > suppose. There is a weird file in swig/classes/include named parents.i, which contains a map of all the classes to their parents. One of the swig post-processors uses this to adjust the ruby class parentage. I think this file (and events.rb which is in the same directory) should move to swig/ but I don't have immediate plans to do so. > Another thing I'm a bit unclear on is the whole (directors="1"). I'll > investigate that this weekend, too. Most classes should have directors. These allow two-way calling which facilitates overriding virtual methods and having callbacks. They are necessary in most cases for proper memory management. If you get compile errors with directors enabled, you'll probably need to disable them for that class, as you can see in Bitmap.i. This would be if the class has no virtual methods at all. Note that two lines are required to disable directors...one tells swig, and the other tells our post-procesor. > Finally, one last little problem. It appears the C->ruby renamer isn't > handling names like centreX properly. centreX should be converted to > centre_x as I understand it. The un_camelcase function in renamer.rb > apparenly only uncamelcases if the first characters are uppercase. > Thoughts? I haven't confirmed what you are saying, but based on your description I agree with you. Since that's ruby code and not C++, I'm hoping you or any of several other folks on this list should be able to submit a patch :-) Thanks again, Kevin From wxruby at qualitycode.com Tue Aug 9 09:53:12 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 9 09:47:26 2005 Subject: [Wxruby-users] wxruby2 release goals Message-ID: <42F8B548.5000104@qualitycode.com> Greetings all, The recent ruby-talk posting about wx (cross-posted here by Curt) made it clear that we need to release some code soon, to present a public image of moving forward. Thus, my first goal is to release a "preview" version of wxruby2 as soon as we have a version that builds and can run the minimal sample on all three major platforms (Linux, MS Win, Mac OSX). This would include binaries for Windows and Mac, and I would LOVE it if we could have it available in gem form and/or as RPMs or DEBs for Linux distros. Volunteers? After that, I plan to focus on unicode support and memory management. It would be great if other folks could work on adding support for more classes (and any important missing methods), and especially on improving our samples. I still hope we can do a wxruby2 1.0 release within the next couple months, but it will require help from you. Thanks, Kevin From jani.monoses at gmail.com Tue Aug 9 10:25:02 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Tue Aug 9 10:19:00 2005 Subject: [Wxruby-users] wxruby2 release goals In-Reply-To: <42F8B548.5000104@qualitycode.com> References: <42F8B548.5000104@qualitycode.com> Message-ID: <29e11553050809072566ec828a@mail.gmail.com> Hi Kevin, > Thus, my first goal is to release a "preview" version of wxruby2 as soon > as we have a version that builds and can run the minimal sample on all > three major platforms (Linux, MS Win, Mac OSX). This would include > binaries for Windows and Mac, and I would LOVE it if we could have it > available in gem form and/or as RPMs or DEBs for Linux distros. Volunteers? Would it be too much to run all the samples included in the first release? In the past weeks there were moments when at least half of them ran fine on linux. But if you say making them work right needs some serious work then so be it :) I volunteer for the .deb. I'll be offline next week though Jani From wxruby at qualitycode.com Tue Aug 9 10:29:39 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 9 10:23:52 2005 Subject: [Wxruby-users] Rake patch In-Reply-To: <42F0D823.1070208@mindspring.com> References: <42F02F6A.6070806@qualitycode.com> <42F0CA74.4070202@qualitycode.com> <42F0D823.1070208@mindspring.com> Message-ID: <42F8BDD3.9060700@qualitycode.com> Hi Roy, Is this still an issue? Is it something that we need to describe in the README requirements section? Thanks, Kevin Roy Sutton wrote: > The new rake file seems to be working OK. I had to compile several > libraries that aren't actually needed by the project (yet). > > Specifically: > > wxbase26[d]_net.lib [deprecated for Ruby net functions?] > wxbase26[d]_odbc.lib > wxmsw26[d]_dbgrid.lib > wxmsw26d_media.lib > wxregexd.lib [deprecated for Ruby regex functions?] > > Roy From wxruby at qualitycode.com Tue Aug 9 10:39:54 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 9 10:34:08 2005 Subject: [Wxruby-users] wxruby2 release goals In-Reply-To: <29e11553050809072566ec828a@mail.gmail.com> References: <42F8B548.5000104@qualitycode.com> <29e11553050809072566ec828a@mail.gmail.com> Message-ID: <42F8C03A.2010702@qualitycode.com> Jani Monoses wrote: > > Would it be too much to run all the samples included in the first > release? In the past weeks there were moments when at least half of > them ran fine on linux. But if you say making them work right needs > some serious work then so be it :) I'm not sure if I can resolve all memory problems that quickly, but you are probably right that it should run all of the samples that are included in the package itself (not all the samples from wxruby1). Ok. that's the real goal for the wxruby2 preview release: Run all the samples currently in the wxruby2 tree. Segfaults after choosing exit are not showstoppers. Also, if anyone submits better-written samples to replace any of the existing wxruby2 samples, that would be great. > I volunteer for the .deb. I'll be offline next week though Great. Thanks! Kevin From wxruby at qualitycode.com Tue Aug 9 10:44:09 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 9 10:38:23 2005 Subject: [Wxruby-users] [Fwd: Re: FXRuby or wxRuby?] In-Reply-To: <42F7B794.7040006@hibbs.com> References: <42F76DAF.5080107@hibbs.com> <42F7A7D3.7010009@qualitycode.com> <42F7B794.7040006@hibbs.com> Message-ID: <42F8C139.7020007@qualitycode.com> Thanks, Curt. I noticed another reply which questioned the stability of wxruby2 based on a recent "huge" commit. Although the commit was quite large, most of it was actually checking in .h and .cpp files that were generated by a newer version of swig. This change did not affect the API at all. There will undoubtedly be some small API changes to specific functions (to make them more ruby-friendly) before wxruby2 hits 1.0, but for the most part the API is quite stable. Kevin Curt Hibbs wrote: > Thanks, I'll forward this to ruby-talk. > > Curt > > Kevin Smith wrote: > >> Curt Hibbs wrote: >> >>> This was just posted on ruby-talk. I'd hate to let this go without >>> any rebuttal or explanation. Can someone (more qualified than me) >>> please compose a response? >> >> >> >> My opinions inline, below... >> >> > olof sivertsson wrote: >> >>> My experience with wxRuby has not been very pleasent. >> >> >> >> I am very sorry to hear that. wxRuby is still definitely a >> beta-quality product. Until recently, only a few people have >> contributed much code to the project, so it has evolved rather slowly. >> There seems to be some good momentum now, with several people >> submitting code patches, so hopefully this will change. >> >>> The main obstacle was bad docs, >> >> >> >> Understandable. We have been focused on getting the basic code working >> as a first step. I would rate the documentation as about average for a >> FLOSS project. Definitely better than many, but still rough. >> >>> even the docs at wx's main site are confusing. >> >> >> >> I think there is a lack of good examples and tutorials, but otherwise >> I have found the wx docs to be pretty complete. I would be interested >> to know which parts are confusing. >> >>> The wx API interface seems rather bloated in general and this >>> translates over to wxRuby. >> >> >> >> True. Solving this will be our next phase, after we get a basic >> wrapper working. That's the approach that FXRuby took as well, since >> the FOX API was a bit heavy. >> >> Once we have wxRuby working, we can add lots of Ruby sugar on top to >> make the API much more pleasant. The wx API is definitely not the >> cleanest of the GUI toolkits. That's partly due to its maturity (10+ >> years), and partly due to its use of native widgets where possible. >> >>> We also had problems getting the sizers to work as we wanted, >> >> >> >> Sizers can be a challenge. Perhaps that's the part of the wx docs that >> you found confusing, and I would probably agree. The sizer API is a >> bit odd, and some of the docs still describe the deprecated mechanism >> that was replaced by sizers. It will be interesting to see if we can >> cook up some really cool ruby-ish API improvements for sizers. At a >> minimum, we can create several good examples. >> >>> and things working on windows and not working on Linux etc. >> >> >> >> There are a few features that are only available on specific platforms >> due to native-widget issues. Not many, though. Generally, wx itself >> works very well across multiple platforms. wxRuby probably has more >> issues at this point, but we plan to fix them. >> >>> The final nail in the coffin was when we hit the (known) >>> bugs and had to code around them. >> >> >> >> Yup. I sure wish wxRuby could have made faster progress. >> >>> So we switched to ruby-gtk2 >> >> >> >> That's a fine toolkit, and I'm glad it is working for you. It isn't >> really fully cross-platform, so it's not directly comparable. >> >>> QtRuby also seems to have a nice API, but I haven't gotten it to work. >>> http://developer.kde.org/language-bindings/ruby/ >> >> >> >> I haven't tried QtRuby, but also has different strengths and >> weaknesses compared to wxRuby. Qt has much more restrictive licensing >> for example. >> >>> Never tried FXRuby, mainly because it looks just plain ugly. (But >>> looking plain ugly on all platforms is better than wx that works on >>> some platforms and not others...) >> >> >> >> FXRuby is a great toolkit, and probably the one I would recommend to >> anyone who needs a full-featured cross-platform GUI toolkit today. The >> main reason I choose to work on wxRuby instead is because FOX doesn't >> use native widgets. >> >> And of course there are still other toolkits that weren't mentioned >> here. Each has some advantages and disadvantages. >> >> Kevin >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From roys at mindspring.com Tue Aug 9 10:52:31 2005 From: roys at mindspring.com (Roy Sutton) Date: Tue Aug 9 10:46:51 2005 Subject: [Wxruby-users] Rake patch In-Reply-To: <42F8BDD3.9060700@qualitycode.com> References: <42F02F6A.6070806@qualitycode.com> <42F0CA74.4070202@qualitycode.com> <42F0D823.1070208@mindspring.com> <42F8BDD3.9060700@qualitycode.com> Message-ID: <42F8C32F.6090001@mindspring.com> This isn't an issue per se. I was just noting that all wxWindows libraries must be compiled for the new rakefile to work. I was only building as needed before. I don't think it's too much to expect people to build all needed wxWindows libraries, especially as they will probably be needed later (with the possible exception of the net and regexp libraries). Although this does bring up a question: Is debug the default build for wxRuby? Or only now before release? Will future version link against non-debug by default? Or should current version be linking against non-debug and are only linking against debug on Windows because of a bug? I do wish there were a simpler way to build them all on windows (There might be!). But that's really a wxWindows issue, not a wxRuby issue. Roy Kevin Smith wrote: > Hi Roy, > > Is this still an issue? Is it something that we need to describe in > the README requirements section? > > Thanks, > > Kevin > > > Roy Sutton wrote: > >> The new rake file seems to be working OK. I had to compile several >> libraries that aren't actually needed by the project (yet). >> >> Specifically: >> >> wxbase26[d]_net.lib [deprecated for Ruby net functions?] >> wxbase26[d]_odbc.lib >> wxmsw26[d]_dbgrid.lib >> wxmsw26d_media.lib >> wxregexd.lib [deprecated for Ruby regex functions?] >> >> Roy > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Tue Aug 9 11:18:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 9 11:12:47 2005 Subject: [Wxruby-users] DEBUG or not? (was: Rake patch) In-Reply-To: <42F8C32F.6090001@mindspring.com> References: <42F02F6A.6070806@qualitycode.com> <42F0CA74.4070202@qualitycode.com> <42F0D823.1070208@mindspring.com> <42F8BDD3.9060700@qualitycode.com> <42F8C32F.6090001@mindspring.com> Message-ID: <42F8C947.8030007@qualitycode.com> Roy Sutton wrote: > Although this does bring up a question: Is debug the default build for > wxRuby? Or only now before release? Will future version link against > non-debug by default? Or should current version be linking against > non-debug and are only linking against debug on Windows because of a bug? As soon as wxruby2 is more stable, we should default to non-DEBUG building. There should be a simple rakefile setting to choose DEBUG or not. I think it is already there, but I haven't looked or tried it recently. For now, especially with the memory problems, it is helpful to have as many people as possible running the debug version. Kevin From alex at pressure.to Tue Aug 9 12:23:47 2005 From: alex at pressure.to (Alex Fenton) Date: Tue Aug 9 12:17:33 2005 Subject: [Wxruby-users] wxruby2 release goals In-Reply-To: <42F8B548.5000104@qualitycode.com> References: <42F8B548.5000104@qualitycode.com> Message-ID: <42F8D893.3010100@pressure.to> Hi all Congrats to all on the progress so far, and thanks Kevin for leading this. Sounds like there's been major replumbing going on. > Thus, my first goal is to release a "preview" version of wxruby2 as > soon as we have a version that builds and can run the minimal sample > on all three major platforms (Linux, MS Win, Mac OSX). This would > include binaries for Windows and Mac, and I would LOVE it if we could > have it available in gem form and/or as RPMs or DEBs for Linux > distros. Volunteers? Count me in for doing a source gem (will also try a mswin32 binary one if someone compiles a .so, and will try a osx). Does anyone know how to make a OS X .dmg? I think Nick had a way of doing this but I'm not sure if it is documented somewhere? > After that, I plan to focus on unicode support and memory management. > It would be great if other folks could work on adding support for more > classes (and any important missing methods), and especially on > improving our samples. Plan to do some work on the samples. Apart from 1) # better commenting 2) removingCamelCaseMethodNames and 3) formatting line-wraps etc that is needed everywhere to put the samples in exemplary ruby style? cheers alex From ruby at portfolio16.de Tue Aug 9 15:58:27 2005 From: ruby at portfolio16.de (Tobias Gruetzmacher) Date: Tue Aug 9 15:52:31 2005 Subject: [Wxruby-users] Some patches. Message-ID: <20050809195824.GB19961@portfolio16.de> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050809/a9d9a78d/attachment-0001.bin From wxruby at qualitycode.com Wed Aug 10 00:04:35 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Tue Aug 9 23:59:01 2005 Subject: [Wxruby-users] Alternatives to CVS? (was: Some patches.) In-Reply-To: <20050809195824.GB19961@portfolio16.de> References: <20050809195824.GB19961@portfolio16.de> Message-ID: <42F97CD3.108@qualitycode.com> Tobias Gruetzmacher wrote: > OK, this are the patches: Thanks! I'll reply to the patches themselves in other emails. > PS: I hate working with CVS. Anyone interested moving to something > better? I would prefer something like Darcs or Arch. I hate CVS too, as I have mentioned several times on the list. This remains a "hot button" topic for me, so this is probably a more detailed response than you were expecting. A year or so ago, I started to shift the wxruby archives to darcs, but only one other contributor was using it. Eventually it became clear that the project would be better off staying with CVS. Perhaps things have changed now. My guess is that a year from now, wxruby *will* be using a distributed SCM tool. First off, I just don't see subversion as a worthwhile option for us. Although it is better than CVS (which it its goal), it is still centralized. So it is incrementally better, but does not solve some of the big problems, so I don't think it's worth the pain of switching. There are several distributed SCM tools, but only a couple would actually be candidates for use on the wxruby project. First, let's agree on some criteria. I can't imagine wxruby adopting an SCM tool without these features: 0. Must be distributed, and be Free Software This eliminates perforce, subversion, and some others. 1. Must have clients available for Linux, MS Windows, and Mac OS X This eliminates ArX, Bazaar (baz), GIT/cogito, GNU arch (tla), and monotone. 2. Must be "production quality" with reasonable feature set This eliminates FastCST (and some others). We are left with: - Bazaar-NG (bzr) - Codeville - darcs - Mercurial (?) - svk Of those, Codeville and svk require a cgi app on the server, which I dislike. On the other hand, Bazaar-NG, darcs, and Mercurial store their repos *inside* the working directory, which I also dislike. So none of these are ideal for me, but I would be willing to try any of them. Darcs is definitely the most mature, so I suppose it would be the default choice if nobody has strong reasons to prefer one of the others. For a small project like wxruby, darcs would probably work fine. So, I've said it before and I'll say it again: If it will make it easier for people to contribute code to wxruby, I would happily try out one of these systems. It would take at least a couple of you saying "Yes! Do it!", and also no strong/valid objections from other folks. We would also have to decide whether to set up a one-way or bidirectional CVS gateway, for backward compatibility. I don't have time to set that up and maintain it, so someone would have to volunteer to take that on, or else we would have to decide that it's not necessary. Thoughts? Kevin From jani.monoses at gmail.com Wed Aug 10 02:38:12 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Wed Aug 10 02:32:08 2005 Subject: [Wxruby-users] Alternatives to CVS? (was: Some patches.) In-Reply-To: <42F97CD3.108@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> Message-ID: <29e1155305080923386ecf2e3f@mail.gmail.com> Hi Kevin, +1 for darcs. The fact that it stores the repo inside the wd I actually find and advantage and contributes to the simplicty of darcs. Jani From sean.m.long at gmail.com Wed Aug 10 13:03:29 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 12:57:23 2005 Subject: [Wxruby-users] Alternatives to CVS? (was: Some patches.) In-Reply-To: <29e1155305080923386ecf2e3f@mail.gmail.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <29e1155305080923386ecf2e3f@mail.gmail.com> Message-ID: I have only used cvs and svn in the past and looked at the darcs site for 5 minutes and it looks pretty straight forward, looks like it is easy to install on every platform. If we are not going with a central repository then I vote for darcs. We will have to have some kind of quick howto somewhere showing the basics since it is not a widely used revision control system. Sean On 8/9/05, Jani Monoses wrote: > Hi Kevin, > > +1 for darcs. > The fact that it stores the repo inside the wd I actually find and > advantage and contributes to the simplicty of darcs. > Jani > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From sean.m.long at gmail.com Wed Aug 10 13:06:49 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 13:00:45 2005 Subject: [Wxruby-users] wxruby2 swig retooling "complete" In-Reply-To: <42F6DB0A.40903@qualitycode.com> References: <42F6DB0A.40903@qualitycode.com> Message-ID: Just tried the latest from HEAD and at least on Windows it does not work with SWIG 1.3.24. I downloaded 1.3.25 and wxRuby2 swigged just fine. I have not had time to test on Mac OS X with swig 1.3.24 so I am not sure if this is a Windows issue or an issue with SWIG < 1.3.25. Sean On 8/7/05, Kevin Smith wrote: > I just re-integrated fixdeleting.rb, the last of the post-processors. > > Running minimal.rb no longer segfaults on exit. Running dialogs.rb and > immediately exiting doesn't segfault, but bringing up a dialog and then > exiting does. > > So there are still memory problems, but fewer than yesterday :-/ I'm not > sure how it compares to last week. > > I probably won't have much time to work on wxruby for a few days. I'll > try to sneak in a little time to fix up the unicode stuff at least, and > any other patches that have been or will be submitted. > > Cheers, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From sean.m.long at gmail.com Wed Aug 10 13:52:50 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 13:46:44 2005 Subject: [Wxruby-users] more patches Message-ID: Here are a few patches 2 small changes and one a little hefty. All are to *.i files. SpinCtrl.patch - Changes cWxSpinCtrl.klass to mWxSpinCtrl in rb_define_method. Dialog.patch - Removed the %ignore wxDialog::wxDialog line, this line prevents Dialogs working with XRC. Window.i - Added special code for find_window_* methods so the correct object type is returned, this is very important when working with XRC and you want to get an object by id, name or label. With these patches I can actually run my program that I started in wxRuby 0.6, mind you it is not very involved as it is a work in progress but I am very excited. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: Dialog.patch Type: application/octet-stream Size: 468 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050810/3cb92a8b/Dialog.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: SpinCtrl.patch Type: application/octet-stream Size: 663 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050810/3cb92a8b/SpinCtrl.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Window.patch Type: application/octet-stream Size: 8514 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050810/3cb92a8b/Window.obj From sean.m.long at gmail.com Wed Aug 10 15:13:36 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 15:07:30 2005 Subject: [Wxruby-users] wxruby2 swig retooling "complete" In-Reply-To: References: <42F6DB0A.40903@qualitycode.com> Message-ID: I have Mepis Linux now installed thru VMware and SWIG 1.3.24 does not work there either, 1.3.25 does seem to work however. On Mepis 1.3.25 has to be compiled from source, small bummer but no biggy. Sean On 8/10/05, Sean Long wrote: > Just tried the latest from HEAD and at least on Windows it does not > work with SWIG 1.3.24. I downloaded 1.3.25 and wxRuby2 swigged just > fine. I have not had time to test on Mac OS X with swig 1.3.24 so I am > not sure if this is a Windows issue or an issue with SWIG < 1.3.25. > > Sean > > On 8/7/05, Kevin Smith wrote: > > I just re-integrated fixdeleting.rb, the last of the post-processors. > > > > Running minimal.rb no longer segfaults on exit. Running dialogs.rb and > > immediately exiting doesn't segfault, but bringing up a dialog and then > > exiting does. > > > > So there are still memory problems, but fewer than yesterday :-/ I'm not > > sure how it compares to last week. > > > > I probably won't have much time to work on wxruby for a few days. I'll > > try to sneak in a little time to fix up the unicode stuff at least, and > > any other patches that have been or will be submitted. > > > > Cheers, > > > > Kevin > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From sean.m.long at gmail.com Wed Aug 10 18:53:45 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 18:47:38 2005 Subject: [Wxruby-users] small patch for mdi sample Message-ID: This patch specifies a position and size for the main Frame so it looks correct when first opened and does not need to be resized. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: mdi_sample.patch Type: application/octet-stream Size: 553 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050810/ff59c215/mdi_sample.obj From sean.m.long at gmail.com Wed Aug 10 19:40:33 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 19:34:27 2005 Subject: [Wxruby-users] question on Choice.i Message-ID: Is there a reason that these lines are in Choice.i? %ignore wxChoice::wxChoice(); %ignore wxChoice::wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr); If I comment these two lines out I can run all of the sample programs. Sean From sean.m.long at gmail.com Wed Aug 10 20:36:24 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 20:30:17 2005 Subject: [Wxruby-users] wxruby2 swig retooling "complete" In-Reply-To: References: <42F6DB0A.40903@qualitycode.com> Message-ID: Mac OS X also needs SWIG 1.3.25 Sean On 8/10/05, Sean Long wrote: > I have Mepis Linux now installed thru VMware and SWIG 1.3.24 does not > work there either, 1.3.25 does seem to work however. On Mepis 1.3.25 > has to be compiled from source, small bummer but no biggy. > > Sean > > On 8/10/05, Sean Long wrote: > > Just tried the latest from HEAD and at least on Windows it does not > > work with SWIG 1.3.24. I downloaded 1.3.25 and wxRuby2 swigged just > > fine. I have not had time to test on Mac OS X with swig 1.3.24 so I am > > not sure if this is a Windows issue or an issue with SWIG < 1.3.25. > > > > Sean > > > > On 8/7/05, Kevin Smith wrote: > > > I just re-integrated fixdeleting.rb, the last of the post-processors. > > > > > > Running minimal.rb no longer segfaults on exit. Running dialogs.rb and > > > immediately exiting doesn't segfault, but bringing up a dialog and then > > > exiting does. > > > > > > So there are still memory problems, but fewer than yesterday :-/ I'm not > > > sure how it compares to last week. > > > > > > I probably won't have much time to work on wxruby for a few days. I'll > > > try to sneak in a little time to fix up the unicode stuff at least, and > > > any other patches that have been or will be submitted. > > > > > > Cheers, > > > > > > Kevin > > > _______________________________________________ > > > wxruby-users mailing list > > > wxruby-users@rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > From sean.m.long at gmail.com Wed Aug 10 21:11:46 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 21:05:40 2005 Subject: [Wxruby-users] another small patch Message-ID: This is a fix for MenuItem, on Mac OS it only has 1 constructor so the second one has #ifndef __WXMAC__ #endif around it Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: menuitem.patch Type: application/octet-stream Size: 796 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050810/de6a27f7/menuitem.obj From wxruby at qualitycode.com Wed Aug 10 22:34:10 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 10 22:28:40 2005 Subject: [Wxruby-users] Need swig 2.3.25+ (was: wxruby2 swig retooling "complete") In-Reply-To: References: <42F6DB0A.40903@qualitycode.com> Message-ID: <42FAB922.6010809@qualitycode.com> Sean Long wrote: > Mac OS X also needs SWIG 1.3.25 > > Sean > > On 8/10/05, Sean Long wrote: > >>I have Mepis Linux now installed thru VMware and SWIG 1.3.24 does not >>work there either, 1.3.25 does seem to work however. On Mepis 1.3.25 >>has to be compiled from source, small bummer but no biggy. I think it makes sense to require swig 1.3.25. I have updated the README to reflect that. Kevin From wxruby at qualitycode.com Wed Aug 10 23:03:44 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 10 22:58:16 2005 Subject: [Wxruby-users] Some patches. In-Reply-To: <20050809195824.GB19961@portfolio16.de> References: <20050809195824.GB19961@portfolio16.de> Message-ID: <42FAC010.7010405@qualitycode.com> Tobias Gruetzmacher wrote: > > OK, this are the patches: They are all committed. Very nice work! In the future, if possible, please generate patches that will apply with -p1 instead of -p0. I don't know why -p1 is the standard, but some patch manipulation tools won't work with -p0 patches. Thanks, Kevin From wxruby at qualitycode.com Wed Aug 10 23:05:47 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 10 23:00:14 2005 Subject: [Wxruby-users] Next swig problem In-Reply-To: <42F2DF84.5010903@mindspring.com> References: <42F2DF84.5010903@mindspring.com> Message-ID: <42FAC08B.1010700@qualitycode.com> Roy Sutton wrote: > After getting past the icon problem I ran into my next problem: > > SpinCtrl.cpp > src/SpinCtrl.cpp(1141) : error C2065: 'cWxSpinCtrl' : undeclared identifier > src/SpinCtrl.cpp(1141) : error C2228: left of '.klass' must have > class/struct/union type > src/SpinCtrl.cpp(1147) : error C2371: 'cWxSpinCtrl' : redefinition; > different basic types I'm clearing out my inbox. Tonight's patches removed some icky stuff from spinctrl.i, so please let me know whether or not the new head works for you. Thanks, Kevin From wxruby at qualitycode.com Wed Aug 10 23:08:49 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 10 23:03:17 2005 Subject: [Wxruby-users] question on Choice.i In-Reply-To: References: Message-ID: <42FAC141.7060305@qualitycode.com> Sean Long wrote: > Is there a reason that these lines are in Choice.i? > > %ignore wxChoice::wxChoice(); > %ignore wxChoice::wxChoice(wxWindow *parent, > wxWindowID id, > const wxPoint& pos = wxDefaultPosition, > const wxSize& size = wxDefaultSize, > int n = 0, const wxString choices[] = NULL, > long style = 0, > const wxValidator& validator = wxDefaultValidator, > const wxString& name = wxChoiceNameStr); > > If I comment these two lines out I can run all of the sample programs. In the current head, the first one is still ignored, but the second one is not. Is that good enough? Every time I uncomment out that default constructor, I have runtime errors, so I really don't want to uncomment it unless I have to. Kevin From wxruby at qualitycode.com Wed Aug 10 23:13:57 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 10 23:08:35 2005 Subject: [Wxruby-users] small patch for mdi sample In-Reply-To: References: Message-ID: <42FAC275.5090709@qualitycode.com> Sean Long wrote: > This patch specifies a position and size for the main Frame so it > looks correct when first opened and does not need to be resized. Committed. Thanks, Kevin From wxruby at qualitycode.com Wed Aug 10 23:14:00 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 10 23:08:36 2005 Subject: [Wxruby-users] Icon problem still exists on latest tarball In-Reply-To: <42F69871.709@mindspring.com> References: <42F69871.709@mindspring.com> Message-ID: <42FAC278.3050700@qualitycode.com> Roy Sutton wrote: > Icon.cpp still errors with: > > src/Icon.cpp(1200) : error C2666: 'wxIcon::wxIcon' : 2 overloads have > similar conversions > > I'll now re-swig everything and see how it goes. I know this has been an ongoing problem. Is it fixed now, or still broken? Thanks, Kevin From roys at mindspring.com Wed Aug 10 23:43:29 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 10 23:37:30 2005 Subject: [Wxruby-users] Icon problem still exists on latest tarball In-Reply-To: <42FAC278.3050700@qualitycode.com> References: <42F69871.709@mindspring.com> <42FAC278.3050700@qualitycode.com> Message-ID: <42FAC961.3040602@mindspring.com> Still broken. Kevin Smith wrote: > Roy Sutton wrote: > >> Icon.cpp still errors with: >> >> src/Icon.cpp(1200) : error C2666: 'wxIcon::wxIcon' : 2 overloads have >> similar conversions >> >> I'll now re-swig everything and see how it goes. > > > I know this has been an ongoing problem. Is it fixed now, or still > broken? > > Thanks, > > Kevin > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Wed Aug 10 23:49:40 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 10 23:43:36 2005 Subject: [Wxruby-users] Next swig problem In-Reply-To: <42FAC08B.1010700@qualitycode.com> References: <42F2DF84.5010903@mindspring.com> <42FAC08B.1010700@qualitycode.com> Message-ID: <42FACAD4.5050807@mindspring.com> The new head now compiles without problems (other than the Icon.cpp issue just mentioned). I will do more testing now. Kevin Smith wrote: > Roy Sutton wrote: > >> After getting past the icon problem I ran into my next problem: >> >> SpinCtrl.cpp >> src/SpinCtrl.cpp(1141) : error C2065: 'cWxSpinCtrl' : undeclared >> identifier >> src/SpinCtrl.cpp(1141) : error C2228: left of '.klass' must have >> class/struct/union type >> src/SpinCtrl.cpp(1147) : error C2371: 'cWxSpinCtrl' : redefinition; >> different basic types > > > I'm clearing out my inbox. Tonight's patches removed some icky stuff > from spinctrl.i, so please let me know whether or not the new head > works for you. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From sean.m.long at gmail.com Thu Aug 11 00:03:18 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 10 23:57:19 2005 Subject: [Wxruby-users] question on Choice.i In-Reply-To: <42FAC141.7060305@qualitycode.com> References: <42FAC141.7060305@qualitycode.com> Message-ID: The first is the important one for XRC. Sean On 8/10/05, Kevin Smith wrote: > Sean Long wrote: > > Is there a reason that these lines are in Choice.i? > > > > %ignore wxChoice::wxChoice(); > > %ignore wxChoice::wxChoice(wxWindow *parent, > > wxWindowID id, > > const wxPoint& pos = wxDefaultPosition, > > const wxSize& size = wxDefaultSize, > > int n = 0, const wxString choices[] = NULL, > > long style = 0, > > const wxValidator& validator = wxDefaultValidator, > > const wxString& name = wxChoiceNameStr); > > > > If I comment these two lines out I can run all of the sample programs. > > In the current head, the first one is still ignored, but the second one > is not. Is that good enough? Every time I uncomment out that default > constructor, I have runtime errors, so I really don't want to uncomment > it unless I have to. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From wxruby at qualitycode.com Thu Aug 11 09:02:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 08:57:08 2005 Subject: [Wxruby-users] more patches In-Reply-To: References: Message-ID: <42FB4C67.5030605@qualitycode.com> Sean Long wrote: > Here are a few patches 2 small changes and one a little hefty. All are > to *.i files. > > SpinCtrl.patch - Changes cWxSpinCtrl.klass to mWxSpinCtrl in rb_define_method. This one was no longer needed after last night's changes to SpinCtrl. > Dialog.patch - Removed the %ignore wxDialog::wxDialog line, this line > prevents Dialogs working with XRC. Committed. > Window.i - Added special code for find_window_* methods so the correct > object type is returned, this is very important when working with XRC > and you want to get an object by id, name or label. I reworked this patch heavily to use ruby introspection instead of a hard-coded list of class names. It seemed to work in a small test I ran, but I may have made a mistake somewhere. Also, it segfaults if the window isn't found (I *think* that was also true with the patch as submitted). Presumably it should special-case when wx returns null, but I don't have time this morning to research that. I also had to tweak the patch to work with my unicode build of wx. > With these patches I can actually run my program that I started in > wxRuby 0.6, mind you it is not very involved as it is a work in > progress but I am very excited. That is very exciting. Thanks for your help getting us to this point! Kevin From wxruby at qualitycode.com Thu Aug 11 09:54:20 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 09:48:53 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: References: Message-ID: <42FB588C.7000300@qualitycode.com> Sean Long wrote: > I just checked out a fresh copy and had to tweak wxIcon.h to get it to > compile on Mac OS X and windows. The problem is with: > > wxIcon(const wxString& filename, > wxBitmapType type = wxBITMAP_TYPE_XPM, > int desiredWidth=-1, int desiredHeight=-1); > > that signature is only used on GTK on other systems it is: > > wxIcon(const wxString& name, > long type = wxBITMAP_TYPE_ICO_RESOURCE, > int desiredWidth = -1, int desiredHeight = -1); > > So I wrapped this in a #ifdef __WXGTK__ #else #endif I *FINALLY* figured out why this wasn't working for me: because __WXGTK__ wasn't defined, even though I'm using wxGTK. Why? Because we weren't passing the wx cppflags to swig. I just changed the rakefile to do this, and now this kind of #if works in classes/include/wxXxxxx.h files. So I grabbed a copy of my "official" wx icon.h file and used that as a starting point for wxIcon.h. I added the one conditional above, and also commented out some overloaded operators that don't make sense for us. A visual comparison with the patch submitted by Sean looked good. I no longer have to %ignore anything, and it compiles and seems to run. Hopefully it will work on other platforms also, now. If not, it would probably be more differences between the GTK API and other platform APIs. Another less likely cause would be unicode/non-unicode glitches. Anyway, let me know whether Icon now works on MS Win and Mac. Thanks! Kevin From wxruby at qualitycode.com Thu Aug 11 09:55:03 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 09:49:32 2005 Subject: [Wxruby-users] question on Choice.i In-Reply-To: References: <42FAC141.7060305@qualitycode.com> Message-ID: <42FB58B7.4010603@qualitycode.com> We no longer %ignore the wxChoice default constructor. Thanks, Kevin Sean Long wrote: > The first is the important one for XRC. > > Sean > > On 8/10/05, Kevin Smith wrote: > >>Sean Long wrote: >> >>>Is there a reason that these lines are in Choice.i? >>> >>>%ignore wxChoice::wxChoice(); >>>%ignore wxChoice::wxChoice(wxWindow *parent, >>> wxWindowID id, >>> const wxPoint& pos = wxDefaultPosition, >>> const wxSize& size = wxDefaultSize, >>> int n = 0, const wxString choices[] = NULL, >>> long style = 0, >>> const wxValidator& validator = wxDefaultValidator, >>> const wxString& name = wxChoiceNameStr); >>> >>>If I comment these two lines out I can run all of the sample programs. >> >>In the current head, the first one is still ignored, but the second one >>is not. Is that good enough? Every time I uncomment out that default >>constructor, I have runtime errors, so I really don't want to uncomment >>it unless I have to. >> >>Kevin >>_______________________________________________ >>wxruby-users mailing list >>wxruby-users@rubyforge.org >>http://rubyforge.org/mailman/listinfo/wxruby-users >> > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From wxruby at qualitycode.com Thu Aug 11 10:03:21 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 09:57:53 2005 Subject: [Wxruby-users] another small patch In-Reply-To: References: Message-ID: <42FB5AA9.60900@qualitycode.com> Sean Long wrote: > This is a fix for MenuItem, on Mac OS it only has 1 constructor so the > second one has #ifndef __WXMAC__ > #endif Since that second constructor appears to be deprecated, I removed it entirely. Thanks, Kevin From jani.monoses at gmail.com Thu Aug 11 14:32:18 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Thu Aug 11 14:26:10 2005 Subject: [Wxruby-users] wxchoice still doesn't work Message-ID: <29e1155305081111324cb08a60@mail.gmail.com> etc/choice.rb Gives this error on linux No matching function for overloaded 'wxControlWithItems_Append Jani From sean.m.long at gmail.com Thu Aug 11 15:03:47 2005 From: sean.m.long at gmail.com (Sean Long) Date: Thu Aug 11 14:57:42 2005 Subject: [Wxruby-users] more patches In-Reply-To: <42FB4C67.5030605@qualitycode.com> References: <42FB4C67.5030605@qualitycode.com> Message-ID: I like the refactoring you did. I have little experience writing ruby extent ions, if I had more experience I would have hopefully done something similar. Sean On 8/11/05, Kevin Smith wrote: > Sean Long wrote: > > Here are a few patches 2 small changes and one a little hefty. All are > > to *.i files. > > > > SpinCtrl.patch - Changes cWxSpinCtrl.klass to mWxSpinCtrl in rb_define_method. > > This one was no longer needed after last night's changes to SpinCtrl. > > > Dialog.patch - Removed the %ignore wxDialog::wxDialog line, this line > > prevents Dialogs working with XRC. > > Committed. > > > Window.i - Added special code for find_window_* methods so the correct > > object type is returned, this is very important when working with XRC > > and you want to get an object by id, name or label. > > I reworked this patch heavily to use ruby introspection instead of a > hard-coded list of class names. It seemed to work in a small test I ran, > but I may have made a mistake somewhere. > > Also, it segfaults if the window isn't found (I *think* that was also > true with the patch as submitted). Presumably it should special-case > when wx returns null, but I don't have time this morning to research that. > > I also had to tweak the patch to work with my unicode build of wx. > > > With these patches I can actually run my program that I started in > > wxRuby 0.6, mind you it is not very involved as it is a work in > > progress but I am very excited. > > That is very exciting. Thanks for your help getting us to this point! > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From sean.m.long at gmail.com Thu Aug 11 16:02:23 2005 From: sean.m.long at gmail.com (Sean Long) Date: Thu Aug 11 15:56:15 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: <42FB588C.7000300@qualitycode.com> References: <42FB588C.7000300@qualitycode.com> Message-ID: I had to make a small change to get Icon to compile on Windows the patch in attached. Will try Mac OS X hopefully tonight. Sean On 8/11/05, Kevin Smith wrote: > Sean Long wrote: > > I just checked out a fresh copy and had to tweak wxIcon.h to get it to > > compile on Mac OS X and windows. The problem is with: > > > > wxIcon(const wxString& filename, > > wxBitmapType type = wxBITMAP_TYPE_XPM, > > int desiredWidth=-1, int desiredHeight=-1); > > > > that signature is only used on GTK on other systems it is: > > > > wxIcon(const wxString& name, > > long type = wxBITMAP_TYPE_ICO_RESOURCE, > > int desiredWidth = -1, int desiredHeight = -1); > > > > So I wrapped this in a #ifdef __WXGTK__ #else #endif > > I *FINALLY* figured out why this wasn't working for me: because > __WXGTK__ wasn't defined, even though I'm using wxGTK. Why? Because we > weren't passing the wx cppflags to swig. I just changed the rakefile to > do this, and now this kind of #if works in classes/include/wxXxxxx.h files. > > So I grabbed a copy of my "official" wx icon.h file and used that as a > starting point for wxIcon.h. I added the one conditional above, and also > commented out some overloaded operators that don't make sense for us. A > visual comparison with the patch submitted by Sean looked good. I no > longer have to %ignore anything, and it compiles and seems to run. > > Hopefully it will work on other platforms also, now. If not, it would > probably be more differences between the GTK API and other platform > APIs. Another less likely cause would be unicode/non-unicode glitches. > > Anyway, let me know whether Icon now works on MS Win and Mac. > > Thanks! > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > -------------- next part -------------- A non-text attachment was scrubbed... Name: wxIcon.patch Type: application/octet-stream Size: 958 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050811/ac11fb51/wxIcon.obj From sean.m.long at gmail.com Thu Aug 11 16:03:52 2005 From: sean.m.long at gmail.com (Sean Long) Date: Thu Aug 11 15:57:44 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: References: <42FB588C.7000300@qualitycode.com> Message-ID: I also had to slightly change rakemswin.rb for the new swig procedure to work. Sean On 8/11/05, Sean Long wrote: > I had to make a small change to get Icon to compile on Windows the > patch in attached. Will try Mac OS X hopefully tonight. > > Sean > > On 8/11/05, Kevin Smith wrote: > > Sean Long wrote: > > > I just checked out a fresh copy and had to tweak wxIcon.h to get it to > > > compile on Mac OS X and windows. The problem is with: > > > > > > wxIcon(const wxString& filename, > > > wxBitmapType type = wxBITMAP_TYPE_XPM, > > > int desiredWidth=-1, int desiredHeight=-1); > > > > > > that signature is only used on GTK on other systems it is: > > > > > > wxIcon(const wxString& name, > > > long type = wxBITMAP_TYPE_ICO_RESOURCE, > > > int desiredWidth = -1, int desiredHeight = -1); > > > > > > So I wrapped this in a #ifdef __WXGTK__ #else #endif > > > > I *FINALLY* figured out why this wasn't working for me: because > > __WXGTK__ wasn't defined, even though I'm using wxGTK. Why? Because we > > weren't passing the wx cppflags to swig. I just changed the rakefile to > > do this, and now this kind of #if works in classes/include/wxXxxxx.h files. > > > > So I grabbed a copy of my "official" wx icon.h file and used that as a > > starting point for wxIcon.h. I added the one conditional above, and also > > commented out some overloaded operators that don't make sense for us. A > > visual comparison with the patch submitted by Sean looked good. I no > > longer have to %ignore anything, and it compiles and seems to run. > > > > Hopefully it will work on other platforms also, now. If not, it would > > probably be more differences between the GTK API and other platform > > APIs. Another less likely cause would be unicode/non-unicode glitches. > > > > Anyway, let me know whether Icon now works on MS Win and Mac. > > > > Thanks! > > > > Kevin > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rakemswin.patch Type: application/octet-stream Size: 576 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050811/7443e994/rakemswin-0001.obj From roys at mindspring.com Thu Aug 11 18:06:32 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 11 18:00:37 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: References: <42FB588C.7000300@qualitycode.com> Message-ID: <42FBCBE8.2050403@mindspring.com> After applying both of Sean's patches I had a clean compile. I decided to stop playing with the old samples and check out the new samples. I'll have a patched version of dialogs.rb later. Here's one quick fix: Single Choice: No OK button. Fix: dialog = SingleChoiceDialog.new(self, "This is a small sample\n" + "A single-choice convenience dialog", "Please select a value", choices, nil, OK | CANCEL) I don't understand why the 'nil' needs to be there yet, it was just trial-and-error and could be wrong. From the wxWindows documentation there shouldn't be an argument after choices (although before it should be the could of items, but I'm guessing we're hiding that complexity).. Roy Sean Long wrote: >I also had to slightly change rakemswin.rb for the new swig procedure to work. > >Sean > >On 8/11/05, Sean Long wrote: > > >>I had to make a small change to get Icon to compile on Windows the >>patch in attached. Will try Mac OS X hopefully tonight. >> >>Sean >> >>On 8/11/05, Kevin Smith wrote: >> >> >>>Sean Long wrote: >>> >>> >>>>I just checked out a fresh copy and had to tweak wxIcon.h to get it to >>>>compile on Mac OS X and windows. The problem is with: >>>> >>>> wxIcon(const wxString& filename, >>>> wxBitmapType type = wxBITMAP_TYPE_XPM, >>>> int desiredWidth=-1, int desiredHeight=-1); >>>> >>>>that signature is only used on GTK on other systems it is: >>>> >>>> wxIcon(const wxString& name, >>>> long type = wxBITMAP_TYPE_ICO_RESOURCE, >>>> int desiredWidth = -1, int desiredHeight = -1); >>>> >>>>So I wrapped this in a #ifdef __WXGTK__ #else #endif >>>> >>>> >>>I *FINALLY* figured out why this wasn't working for me: because >>>__WXGTK__ wasn't defined, even though I'm using wxGTK. Why? Because we >>>weren't passing the wx cppflags to swig. I just changed the rakefile to >>>do this, and now this kind of #if works in classes/include/wxXxxxx.h files. >>> >>>So I grabbed a copy of my "official" wx icon.h file and used that as a >>>starting point for wxIcon.h. I added the one conditional above, and also >>>commented out some overloaded operators that don't make sense for us. A >>>visual comparison with the patch submitted by Sean looked good. I no >>>longer have to %ignore anything, and it compiles and seems to run. >>> >>>Hopefully it will work on other platforms also, now. If not, it would >>>probably be more differences between the GTK API and other platform >>>APIs. Another less likely cause would be unicode/non-unicode glitches. >>> >>>Anyway, let me know whether Icon now works on MS Win and Mac. >>> >>>Thanks! >>> >>>Kevin >>>_______________________________________________ >>>wxruby-users mailing list >>>wxruby-users@rubyforge.org >>>http://rubyforge.org/mailman/listinfo/wxruby-users >>> >>> >>> >> >> >> >>------------------------------------------------------------------------ >> >>_______________________________________________ >>wxruby-users mailing list >>wxruby-users@rubyforge.org >>http://rubyforge.org/mailman/listinfo/wxruby-users >> >> From wxruby at qualitycode.com Thu Aug 11 18:36:47 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 18:31:25 2005 Subject: [Wxruby-users] more patches In-Reply-To: References: <42FB4C67.5030605@qualitycode.com> Message-ID: <42FBD2FF.3040709@qualitycode.com> Sean Long wrote: > I like the refactoring you did. Thanks. > I have little experience writing ruby > extent ions, if I had more experience I would have hopefully done > something similar. I seem to have an unusually strong skill for looking at code and saying "there must be a cleaner way". I suppose it's a combination of idealism and a couple decades of coding. Once you decide there must be a cleaner way, it's "just" a matter of figuring out what that way is :-) Kevin From sean.m.long at gmail.com Thu Aug 11 19:00:05 2005 From: sean.m.long at gmail.com (Sean Long) Date: Thu Aug 11 18:53:57 2005 Subject: [Wxruby-users] more patches In-Reply-To: <42FBD2FF.3040709@qualitycode.com> References: <42FB4C67.5030605@qualitycode.com> <42FBD2FF.3040709@qualitycode.com> Message-ID: > I seem to have an unusually strong skill for looking at code and saying > "there must be a cleaner way". I suppose it's a combination of idealism > and a couple decades of coding. Once you decide there must be a cleaner > way, it's "just" a matter of figuring out what that way is :-) Wow a couple decades! You may have been programming longer than I have been alive, 26 years btw. Makes me feel like a novice with my 8 years of programming. :) Sean From roys at mindspring.com Thu Aug 11 21:31:16 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 11 21:25:11 2005 Subject: [Wxruby-users] Patch file for FileDialog.i Message-ID: <42FBFBE4.6000304@mindspring.com> Attached is a patch file for FileDialog.i. It doesn't work 100% yet because I haven't yet figured out how to make it put the ruby declarations in the right place. If I cut and paste the rb_define_methods into the right place this works perfectly. This patch fixes the dialogs.rb multiple select example so that get_paths and get_filenames returns a ruby array. Note that I may have broken subclassing with this as I think there were _wrap_ wrappers that got lost. Perhaps Kevin or Sean can point out what I should have done? Be gentle, it's my first swig patch. :) Roy -------------- next part -------------- --- FileDialog.i 2005-08-11 21:19:22.268449600 -0400 +++ ../../../FileDialog.i 2005-08-11 21:24:26.515936000 -0400 @@ -21,53 +21,4 @@ } #endif -%ignore wxFileDialog::GetPaths(wxArrayString& paths ) const; -%ignore wxFileDialog::GetFilenames(wxArrayString& filenames ) const; - -%{ -static VALUE -_wrap_wxFileDialog_GetPaths(int argc, VALUE *argv, VALUE self) { - wxFileDialog *arg1 = (wxFileDialog *) 0 ; - wxArrayString *arg2 = 0 ; - wxArrayString tmp2 ; - VALUE vresult = Qnil; - - if (argc != 0) - rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); - - SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_wxFileDialog, 1); - ((wxFileDialog const *)arg1)->GetPaths(tmp2); - - vresult = rb_ary_new(); - for (int i = 0; i < tmp2.GetCount(); i++) - rb_ary_push(vresult,rb_str_new2(tmp2[i])); - return vresult; -} - -static VALUE -_wrap_wxFileDialog_GetFilenames(int argc, VALUE *argv, VALUE self) { - wxFileDialog *arg1 = (wxFileDialog *) 0 ; - wxArrayString *arg2 = 0 ; - wxArrayString tmp2 ; - VALUE vresult = Qnil; - - if (argc != 0) - rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); - - SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_wxFileDialog, 1); - ((wxFileDialog const *)arg1)->GetFilenames(tmp2); - - vresult = rb_ary_new(); - for (int i = 0; i < tmp2.GetCount(); i++) - rb_ary_push(vresult,rb_str_new2(tmp2[i])); - return vresult; - -} -%} - -%init %{ - rb_define_method(cWxFileDialog.klass, "get_paths", VALUEFUNC(_wrap_wxFileDialog_GetPaths), -1); - rb_define_method(cWxFileDialog.klass, "get_filenames", VALUEFUNC(_wrap_wxFileDialog_GetFilenames), -1); -%} - %include "include/wxFileDialog.h" From wxruby at qualitycode.com Thu Aug 11 22:14:28 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 22:09:06 2005 Subject: [Wxruby-users] wxchoice still doesn't work In-Reply-To: <29e1155305081111324cb08a60@mail.gmail.com> References: <29e1155305081111324cb08a60@mail.gmail.com> Message-ID: <42FC0604.6060901@qualitycode.com> Jani Monoses wrote: > etc/choice.rb Gives this error on linux > No matching function for overloaded 'wxControlWithItems_Append Aaaah. Ok. The Choice control in samples/controls/controls.rb works fine. The apend call on line 13 of samples/etc/choice.rb isn't working because there are four forms of append that are supported by Choice's superclass (ControlWithItems): append(String) append(String, String) append(String, Wx::ClientData) append([Strings]) For whatever reason, swig is mapping the second variant, which is (String, void) in C++ to being (String, String) in Ruby. The sample is trying to pass a number as the second parameter, so it is failing. The wx docs only describe two of these variants (the first two). The right thing to do is probably for us to somehow convince swig to allow any data type as the second parameter, and use that as the client data. Early versions of wxRuby (non-swig) had some serious memory problems with client data. Hopefully we won't have that problem. For now, perhaps someone could rework the sample to either not pass a second parameter to append, or to pass a String instead of a number. Thanks, Kevin From wxruby at qualitycode.com Thu Aug 11 22:25:16 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 22:19:52 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: References: <42FB588C.7000300@qualitycode.com> Message-ID: <42FC088C.4050709@qualitycode.com> Sean Long wrote: > I had to make a small change to get Icon to compile on Windows the > patch in attached. Will try Mac OS X hopefully tonight. Committed. Kevin From wxruby at qualitycode.com Thu Aug 11 22:28:06 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 22:22:41 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: References: <42FB588C.7000300@qualitycode.com> Message-ID: <42FC0936.30009@qualitycode.com> Sean Long wrote: > I also had to slightly change rakemswin.rb for the new swig procedure to work. Committed. Kevin From wxruby at qualitycode.com Thu Aug 11 22:29:48 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 11 22:24:26 2005 Subject: [Wxruby-users] more patches In-Reply-To: References: <42FB4C67.5030605@qualitycode.com> <42FBD2FF.3040709@qualitycode.com> Message-ID: <42FC099C.7090408@qualitycode.com> Sean Long wrote: > Wow a couple decades! You may have been programming longer than I have > been alive, 26 years btw. Makes me feel like a novice with my 8 years > of programming. :) Wrote my first (hobby) program in 1979, I think. Sounds like it's pretty close one way or the other! Kevin From sean.m.long at gmail.com Fri Aug 12 01:31:22 2005 From: sean.m.long at gmail.com (Sean Long) Date: Fri Aug 12 01:25:15 2005 Subject: [Wxruby-users] patch for Icon In-Reply-To: References: <42FB588C.7000300@qualitycode.com> Message-ID: > I had to make a small change to get Icon to compile on Windows the > patch in attached. Will try Mac OS X hopefully tonight. Works on OS X also. I just tried something that I thought should have worked, but didn't. I checked out the latest HEAD and just typed rake, usually I type rake clean_src then rake and wouldn't you know it, it does not compile. If I do clean_src first then everything is run through swig and compiles fine, this is a problem I have been suspecting might exist. I believe it is because the #ifdef __WXGTK__ preprocessor symbols are used during the swig process but not actually put in the generated code. So if Kevin runs SWIG on his Linux machine and uploads that to CVS all the guys using that platform will not have to use SWIG but all us Windows and Mac guys will have to have SWIG installed or use a precompiled version of wxRuby2. Now if the wxWidgets headers were all exactly the same for each platform this would not be an issue but that is something out of our control. Any ideas on how to remedy this? Should we just expect anyone not using a pre-built binary to have SWIG installed? I am going to be out of town the next few days (to much traveling this month) so don't think I am ignoring any questions or comments on this. Sean From roys at mindspring.com Fri Aug 12 10:44:53 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 12 10:38:54 2005 Subject: [Wxruby-users] Event.i patch Message-ID: <42FCB5E5.30004@mindspring.com> This patch to event.i (if it worked correctly!) would fix the problem of event types being returned a fox objects instead of a fixnum matching the constants expected. This patch has the same problem as the previous one in that you must manually move the 'get_event_type' declaration down to where it belongs once the .cpp files is produced. If someone has pointers on how to fix this I won't have to submit broken patches. :) I don't see a lot of examples of what I'm trying to do. So, I have to wonder if I'm just doing this wrong. Are we supposed to override default functions with hand-crafted ones to get ruby funtionality or are we supposed to do something else? Some feedback on the direction of these patches would be great. Roy -------------- next part -------------- --- Event.i 2005-08-12 10:34:06.314740800 -0400 +++ ../../../Event.i 2005-08-12 10:40:50.075320000 -0400 @@ -5,27 +5,4 @@ %module(directors="1") wxEvent -%ignore wxEvent::GetEventType(); - -%{ -static VALUE -_wrap_wxEvent_GetEventType(int argc, VALUE *argv, VALUE self) { - wxEvent *arg1 = (wxEvent *) 0 ; - WXTYPE result; - VALUE vresult = Qnil; - - if ((argc < 0) || (argc > 0)) - rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); - SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_wxEvent, 1); - result = (arg1)->GetEventType(); - - vresult = INT2NUM(result); - return vresult; -} -%} - -%init %{ - rb_define_method(cWxEvent.klass, "get_event_type", VALUEFUNC(_wrap_wxEvent_GetEventType), -1); -%} - %include "include/wxEvent.h" From roys at mindspring.com Fri Aug 12 22:17:56 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 12 22:11:52 2005 Subject: [Wxruby-users] Functions that return objects... Message-ID: <42FD5854.7030802@mindspring.com> I was investigating why the find dialog causes an error when you close it. It seems that wxRuby2 is returning a new ruby object when you call Event.get_dialog. This causes some big problems when you're expecting you're going to get back the same ruby pointer that you put in. In a brief check over the source I don't see anything that preserves the original ruby object pointer or any way to tie a CPP object back to a ruby object. I do see you can find the CPP from the ruby. Is this a 'known' problem that has an easy workaround? Or is this something much more structural that has to be addressed at the core of the Swig files? Roy From wxruby at qualitycode.com Fri Aug 12 22:50:11 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 12 22:45:01 2005 Subject: [Wxruby-users] Functions that return objects... In-Reply-To: <42FD5854.7030802@mindspring.com> References: <42FD5854.7030802@mindspring.com> Message-ID: <42FD5FE3.4060206@qualitycode.com> Roy Sutton wrote: > I was investigating why the find dialog causes an error when you close > it. It seems that wxRuby2 is returning a new ruby object when you call > Event.get_dialog. (snip) > Is this a 'known' problem that has an easy workaround? Or is this > something much more structural that has to be addressed at the core of > the Swig files? We had to solve this in non-swig wxruby by keeping a map of all ruby objects that were passed into wx, and whenever an object was returned back out of wx, we checked to see if it matched up with one that was passed in. I think we could do the same thing in swig. I'm not sure if it can be done via a typemap, or if it would have to be a post-process step, or if there's a clean .i way. I know wxPython has the same issue, so it would be interesting to see how they solved it. Hm. We already keep a map of all known ruby->cpp objects to avoid double-freeing them. wx.i has the functions: GcMapPtrToValue GcGetValueFromPtr GcMarkDeleted GcIsDeleted I don't actually see the case you're referring to. Where does FileDialog use an event to carry an object value? Kevin From wxruby at qualitycode.com Fri Aug 12 22:58:49 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 12 22:53:35 2005 Subject: [Wxruby-users] dialogs.rb: SingleChoice OK/Cancel (was: patch for Icon) In-Reply-To: <42FBCBE8.2050403@mindspring.com> References: <42FB588C.7000300@qualitycode.com> <42FBCBE8.2050403@mindspring.com> Message-ID: <42FD61E9.4000604@qualitycode.com> Roy Sutton wrote: > I decided to stop playing with the old samples and check out the new > samples. I'll have a patched version of dialogs.rb later. Here's one > quick fix: > > Single Choice: No OK button. Fix: > > dialog = SingleChoiceDialog.new(self, > "This is a small sample\n" + > "A single-choice convenience dialog", > "Please select a value", > choices, nil, OK | CANCEL) Committed. Thanks. > I don't understand why the 'nil' needs to be there yet, it was just > trial-and-error and could be wrong. From the wxWindows documentation > there shouldn't be an argument after choices (although before it should > be the could of items, but I'm guessing we're hiding that complexity).. My wx docs show this constructor signature: wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, int n, const wxString* choices, void** clientData = NULL, long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition) You're right that we (thanks to typemaps) merge n+choices into just an array of strings. The nil you pass in is the clientData. I'm not sure why the default style wasn't working properly. Kevin From roys at mindspring.com Fri Aug 12 23:01:01 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 12 22:54:58 2005 Subject: [Wxruby-users] Functions that return objects... In-Reply-To: <42FD5FE3.4060206@qualitycode.com> References: <42FD5854.7030802@mindspring.com> <42FD5FE3.4060206@qualitycode.com> Message-ID: <42FD626D.9060107@mindspring.com> FindDialogEvent.cpp -- get_dialog Sorry if I was unclear on where it goes. I will check those functions out. Any thoughts on the two patches I sent earlier? I'd like to get those cleaned up. Roy Kevin Smith wrote: > Roy Sutton wrote: > >> I was investigating why the find dialog causes an error when you >> close it. It seems that wxRuby2 is returning a new ruby object when >> you call Event.get_dialog. > > (snip) > >> Is this a 'known' problem that has an easy workaround? Or is this >> something much more structural that has to be addressed at the core >> of the Swig files? > > > We had to solve this in non-swig wxruby by keeping a map of all ruby > objects that were passed into wx, and whenever an object was returned > back out of wx, we checked to see if it matched up with one that was > passed in. > > I think we could do the same thing in swig. I'm not sure if it can be > done via a typemap, or if it would have to be a post-process step, or > if there's a clean .i way. I know wxPython has the same issue, so it > would be interesting to see how they solved it. > > Hm. We already keep a map of all known ruby->cpp objects to avoid > double-freeing them. wx.i has the functions: > GcMapPtrToValue > GcGetValueFromPtr > GcMarkDeleted > GcIsDeleted > > I don't actually see the case you're referring to. Where does > FileDialog use an event to carry an object value? > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Fri Aug 12 23:06:35 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 12 23:00:32 2005 Subject: [Wxruby-users] dialogs.rb: SingleChoice OK/Cancel In-Reply-To: <42FD61E9.4000604@qualitycode.com> References: <42FB588C.7000300@qualitycode.com> <42FBCBE8.2050403@mindspring.com> <42FD61E9.4000604@qualitycode.com> Message-ID: <42FD63BB.9030808@mindspring.com> hmm, that's a good question... I suppose tracking why default values aren't working might be more important than changing the sample. Kevin Smith wrote: > You're right that we (thanks to typemaps) merge n+choices into just an > array of strings. The nil you pass in is the clientData. I'm not sure > why the default style wasn't working properly. From wxruby at qualitycode.com Fri Aug 12 23:19:50 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 12 23:14:36 2005 Subject: [Wxruby-users] Patch file for FileDialog.i In-Reply-To: <42FBFBE4.6000304@mindspring.com> References: <42FBFBE4.6000304@mindspring.com> Message-ID: <42FD66D6.1080403@qualitycode.com> Roy Sutton wrote: > Attached is a patch file for FileDialog.i. It doesn't work 100% yet > because I haven't yet figured out how to make it put the ruby > declarations in the right place. Ok. First, thanks for submitting this. And I also like that it shows up as an attachment but also inline in my mail reader (thunderbird) so it's easy for me to review without having to save to disk. Perfect! Well, that part was perfect, anyway. The diff itself is reversed (note that it tells me to remove all your new code (-) instead of adding it (+). I didn't actually try applying it, so I'm not sure if you got the -p0 vs. -p1 thing right. I'm still a diff newbie. > This patch fixes the dialogs.rb multiple select example so that > get_paths and get_filenames returns a ruby array. Note that I may have > broken subclassing with this as I think there were _wrap_ wrappers that > got lost. Perhaps Kevin or Sean can point out what I should have done? > Be gentle, it's my first swig patch. :) No problem. Your post sent me to the swig docs immediately. Turns out that what you're trying to do is a common case when wrapping c/c++ with dynamic languages like Ruby. The answer is typemaps, and the latest swig docs even have a pretty similar example to work from. Take a look at section 10.7 here: http://www.swig.org/Doc1.3/Typemaps.html#Typemaps_nn42 Look at their example of the "read" function where you pass in a buffer, but from ruby you would expect to pass nothing and get a String back. You should be able to set up a typemap that avoids the need to write any functions in c/c++. I almost started to do it myself, but decided not to spoil your fun :-) Actually, it looks like FileDialog.i already has some typemaps like this which I commented out because they were causing problems for me with wx 2.5.3. It's is *possible* that uncommenting those will make it work. If so, go ahead and submit that. Eventually I'll want to get the typemap out of that .i file, or at least get the logic out of there. But that can be a separate step after we get it working. If you can get this working, you'll be a hero, because I would much rather learn from a patch you submit than to have to learn through my own experiments. Thanks! Kevin From roys at mindspring.com Fri Aug 12 23:28:41 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 12 23:22:38 2005 Subject: [Wxruby-users] Patch file for FileDialog.i In-Reply-To: <42FD66D6.1080403@qualitycode.com> References: <42FBFBE4.6000304@mindspring.com> <42FD66D6.1080403@qualitycode.com> Message-ID: <42FD68E9.5030406@mindspring.com> haha. I didn't even notice I'd diff'ed 'em the wrong way. I really just copied Sean's patch file command lines and just mixed up the order. I use Thunderbird, too, and I liked the way I can review the patches. I will go investigate typemaps. Roy Kevin Smith wrote: > Roy Sutton wrote: > >> Attached is a patch file for FileDialog.i. It doesn't work 100% yet >> because I haven't yet figured out how to make it put the ruby >> declarations in the right place. > > > Ok. First, thanks for submitting this. And I also like that it shows > up as an attachment but also inline in my mail reader (thunderbird) so > it's easy for me to review without having to save to disk. Perfect! > > Well, that part was perfect, anyway. The diff itself is reversed (note > that it tells me to remove all your new code (-) instead of adding it > (+). I didn't actually try applying it, so I'm not sure if you got the > -p0 vs. -p1 thing right. I'm still a diff newbie. > >> This patch fixes the dialogs.rb multiple select example so that >> get_paths and get_filenames returns a ruby array. Note that I may >> have broken subclassing with this as I think there were _wrap_ >> wrappers that got lost. Perhaps Kevin or Sean can point out what I >> should have done? Be gentle, it's my first swig patch. :) > > > No problem. Your post sent me to the swig docs immediately. Turns out > that what you're trying to do is a common case when wrapping c/c++ > with dynamic languages like Ruby. The answer is typemaps, and the > latest swig docs even have a pretty similar example to work from. Take > a look at section 10.7 here: > > http://www.swig.org/Doc1.3/Typemaps.html#Typemaps_nn42 > > Look at their example of the "read" function where you pass in a > buffer, but from ruby you would expect to pass nothing and get a > String back. You should be able to set up a typemap that avoids the > need to write any functions in c/c++. I almost started to do it > myself, but decided not to spoil your fun :-) > > Actually, it looks like FileDialog.i already has some typemaps like > this which I commented out because they were causing problems for me > with wx 2.5.3. It's is *possible* that uncommenting those will make it > work. If so, go ahead and submit that. Eventually I'll want to get the > typemap out of that .i file, or at least get the logic out of there. > But that can be a separate step after we get it working. > > If you can get this working, you'll be a hero, because I would much > rather learn from a patch you submit than to have to learn through my > own experiments. > > Thanks! > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Fri Aug 12 23:47:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 12 23:42:16 2005 Subject: [Wxruby-users] Event.i patch In-Reply-To: <42FCB5E5.30004@mindspring.com> References: <42FCB5E5.30004@mindspring.com> Message-ID: <42FD6D53.4010005@qualitycode.com> Roy Sutton wrote: > This patch to event.i (if it worked correctly!) would fix the problem of > event types being returned a fox objects instead of a fixnum matching > the constants expected. Hi Roy! Again, the solution lies not in hand-coding c/c++ but rather in working with swig. "Feel the SWIG. Become one with the SWIG." In this case, swig had no idea what a WXTYPE was, so it assumed it was probably a class. The fix was to add a typedef to swig/typedefs.i so swig knows that a WXTYPE is just a short int. I've checked that change in, so Event#get_event_type should work as expected now. Thanks, Kevin From roys at mindspring.com Sat Aug 13 00:00:14 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 12 23:54:11 2005 Subject: [Wxruby-users] Event.i patch In-Reply-To: <42FD6D53.4010005@qualitycode.com> References: <42FCB5E5.30004@mindspring.com> <42FD6D53.4010005@qualitycode.com> Message-ID: <42FD704E.7030308@mindspring.com> Learn I shall. Feel the swig, I must. Hand-coding to the dark side leads, yes, yes. This is exactly the kind of feedback I needed. I can pick out the problems but I'm still completely new to swig. A few more iterations and we'll be there. Roy Kevin Smith wrote: > Roy Sutton wrote: > >> This patch to event.i (if it worked correctly!) would fix the problem >> of event types being returned a fox objects instead of a fixnum >> matching the constants expected. > > > Hi Roy! Again, the solution lies not in hand-coding c/c++ but rather > in working with swig. "Feel the SWIG. Become one with the SWIG." > > In this case, swig had no idea what a WXTYPE was, so it assumed it was > probably a class. The fix was to add a typedef to swig/typedefs.i so > swig knows that a WXTYPE is just a short int. > > I've checked that change in, so Event#get_event_type should work as > expected now. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Sat Aug 13 00:08:53 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 13 00:03:40 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source (was: Re:patch for Icon) In-Reply-To: References: <42FB588C.7000300@qualitycode.com> Message-ID: <42FD7255.4010709@qualitycode.com> Sean Long wrote: > So if Kevin runs SWIG on his Linux machine and uploads that to > CVS all the guys using that platform will not have to use SWIG but all > us Windows and Mac guys will have to have SWIG installed or use a > precompiled version of wxRuby2. Now if the wxWidgets headers were all > exactly the same for each platform this would not be an issue but that > is something out of our control. Doh! I remember thinking this through a while back...probably when deciding whether to go with wx 2.5.3 or 2.6. It is indeed a significant problem. I see two options: 1. Require SWIG to build from source. I don't think that's too horrible of a requirement. We'll have binaries available soon for MS Win and OS X, and Linux folk are pretty used to building from source with weird tools. As long as "rake; rake install" works, it shouldn't matter. And hopefully we'll have .deb and .rpm binaries at some point, too. 2. Fool SWIG into generating both versions of each method that differs between versions, and then surround them #if __WXGTK__ etc. with a post-processor, so the compiler will do the right thing. My current inclination is to require swig. Is there anyone building from source now who would consider having swig too high of a burden? Will that still be true for you after binaries are available? Not checking in the src/ directory would also speed up CVS, which would make my life a bit sweeter. Thanks, Kevin From roys at mindspring.com Sat Aug 13 00:36:22 2005 From: roys at mindspring.com (Roy Sutton) Date: Sat Aug 13 00:30:19 2005 Subject: [Wxruby-users] Functions that return objects... In-Reply-To: <42FD5FE3.4060206@qualitycode.com> References: <42FD5854.7030802@mindspring.com> <42FD5FE3.4060206@qualitycode.com> Message-ID: <42FD78C6.6020303@mindspring.com> I'm investigating this a bit more... I tried turning on wxDEBUG and testing GcGetValueFromPointer. It seems that a director is never created for FindReplaceDialog so there's no mapping available. Looking at the director code that's included I somewhat expected the director to be added in somewhere. Any other thoughts? Kevin Smith wrote: > Roy Sutton wrote: > >> I was investigating why the find dialog causes an error when you >> close it. It seems that wxRuby2 is returning a new ruby object when >> you call Event.get_dialog. > > (snip) > >> Is this a 'known' problem that has an easy workaround? Or is this >> something much more structural that has to be addressed at the core >> of the Swig files? > > > We had to solve this in non-swig wxruby by keeping a map of all ruby > objects that were passed into wx, and whenever an object was returned > back out of wx, we checked to see if it matched up with one that was > passed in. > > I think we could do the same thing in swig. I'm not sure if it can be > done via a typemap, or if it would have to be a post-process step, or > if there's a clean .i way. I know wxPython has the same issue, so it > would be interesting to see how they solved it. > > Hm. We already keep a map of all known ruby->cpp objects to avoid > double-freeing them. wx.i has the functions: > GcMapPtrToValue > GcGetValueFromPtr > GcMarkDeleted > GcIsDeleted > > I don't actually see the case you're referring to. Where does > FileDialog use an event to carry an object value? > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From jani.monoses at gmail.com Sat Aug 13 04:22:21 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Sat Aug 13 04:16:11 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source (was: Re:patch for Icon) In-Reply-To: <42FD7255.4010709@qualitycode.com> References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> Message-ID: <29e115530508130122531e34@mail.gmail.com> > My current inclination is to require swig. Is there anyone building from > source now who would consider having swig too high of a burden? Will > that still be true for you after binaries are available? I like the advantages of requiring swig but it would be nice if it wasn't one specific swig version. Do the swig developers change APIs that often that a certain codebase of .i files only works with a specific version, or can the wxruby sources be cleaned up so they work with a reasonable range of swig versions. I hope it's the latter :) Ubuntu will most likely have swig 1.3.24 in the upcoming release so a packge should build-depend on that thank you Jani From ruby at portfolio16.de Sat Aug 13 15:37:15 2005 From: ruby at portfolio16.de (Tobias Gruetzmacher) Date: Sat Aug 13 15:31:17 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source (was: Re:patch for Icon) In-Reply-To: <29e115530508130122531e34@mail.gmail.com> References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> <29e115530508130122531e34@mail.gmail.com> Message-ID: <20050813193713.GB11696@portfolio16.de> Hi. On Sat, Aug 13, 2005 at 11:22:21AM +0300, Jani Monoses wrote: > > My current inclination is to require swig. Is there anyone building from > > source now who would consider having swig too high of a burden? Will > > that still be true for you after binaries are available? I think requiring swig is not a big problem for most people. The only thing that is a bit annoying is that a very recent version of swig is required. > I like the advantages of requiring swig but it would be nice if it > wasn't one specific swig version. Do the swig developers change APIs > that often that a certain codebase of .i files only works with a > specific version, or can the wxruby sources be cleaned up so they work > with a reasonable range of swig versions. I hope it's the latter :) I think the thing is: swig has improved in 1.3.25 - if you look at recent patches, many remove workarounds and "%ignore"s for things we could not handle before (correct me if I'm wrong, that's the way I see it). > Ubuntu will most likely have swig 1.3.24 in the upcoming release so a > packge should build-depend on that I have built experimental packages with uupdate for Debian. There is no change to the Debian patches and it compiles and works cleanly on my system: http://portfolio16.de/debian/ - I don't know if it works on Ubuntu. Warning: The version number is lower then a regular swig release but still could clash with a NMU of the new version... Greetings Tobi -- GPG-Key 0xE2BEA341 - signed/encrypted mail preferred My, oh so small, homepage: http://portfolio16.de/ http://www.fli4l.de/ - ISDN- & DSL-Router on one disk! Registered FLI4L-User #00000003 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050813/2d0e639e/attachment.bin From jani.monoses at gmail.com Sat Aug 13 16:15:28 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Sat Aug 13 16:09:16 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source (was: Re:patch for Icon) In-Reply-To: <20050813193713.GB11696@portfolio16.de> References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> <29e115530508130122531e34@mail.gmail.com> <20050813193713.GB11696@portfolio16.de> Message-ID: <29e115530508131315317e9c40@mail.gmail.com> > I have built experimental packages with uupdate for Debian. There is no > change to the Debian patches and it compiles and works cleanly on my > system: http://portfolio16.de/debian/ - I don't know if it works on > Ubuntu. Warning: The version number is lower then a regular swig release > but still could clash with a NMU of the new version... Ubuntu is in freeze so that's the main reason that swig is unlikely to get updated in this release, hence other packages cannot build-depend on it. But for packaging I can still use the 1.3.25 generated .cpp files so it's not a problem to require it if indeed the newest swig makes things easier in wxruby. Jani From wxruby at qualitycode.com Sun Aug 14 00:39:06 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 14 00:34:08 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source In-Reply-To: <29e115530508130122531e34@mail.gmail.com> References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> <29e115530508130122531e34@mail.gmail.com> Message-ID: <42FECAEA.1040208@qualitycode.com> Jani Monoses wrote: > Ubuntu will most likely have swig 1.3.24 in the upcoming release so a > packge should build-depend on that Ok. Since I'm a Unbuntu guy, I will target 1.3.24. The trick is detecting the proper version, since I know SWIG 1.3.22 has problems, and I don't trust 1.3.23 without someone testing it first. SWIG 1.3.25 sends its -version output to stdout, but 1.3.24 sends it to stderr, and there is no cross-platform way in ruby (without third-party libraries) to catch stderr output. So I wrote a clever(?) hack that will figure out what version of SWIG you have, if it's pre-1.3.25. I reverted my system to SWIG 1.3.24, fixed the one post-processor script that didn't work, and was able to build wxruby2 and run a couple samples. There is a chance that my fix might fail with SWIG 1.3.25, and there is a chance that my hack won't work properly on MS Windows. I'm optimistic on both of those, though. I also removed the entire src/ directory from CVS, meaning that you must have SWIG to build from source. As was pointed out earlier, that was really a requirement anyway, unless you happened to be on wxGTK. Please try out the new CVS head and let me know how it works for you. Thanks, Kevin From wxruby at qualitycode.com Sun Aug 14 00:42:19 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 14 00:37:14 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source In-Reply-To: <20050813193713.GB11696@portfolio16.de> References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> <29e115530508130122531e34@mail.gmail.com> <20050813193713.GB11696@portfolio16.de> Message-ID: <42FECBAB.2090707@qualitycode.com> > On Sat, Aug 13, 2005 at 11:22:21AM +0300, Jani Monoses wrote: > >>I like the advantages of requiring swig but it would be nice if it >>wasn't one specific swig version. Do the swig developers change APIs >>that often that a certain codebase of .i files only works with a >>specific version, or can the wxruby sources be cleaned up so they work >>with a reasonable range of swig versions. I hope it's the latter :) I meant to reply to this in my other message. Our post-process steps rely on certain internal SWIG generated code patterns, so they are more likely to break between SWIG versions than a simple wrapped app would be. One of the things I dislike about SWIG is that a minor revision bump (such as 1.3.22 to 1.3.23) might contain some major changes that could break compatibility. It really means that you won't know if something works with a different SWIG version until you try it. Kevin From wxruby at qualitycode.com Sun Aug 14 00:48:30 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 14 00:43:24 2005 Subject: [Wxruby-users] wxruby2 in darcs (was: Alternatives to CVS?) In-Reply-To: References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <29e1155305080923386ecf2e3f@mail.gmail.com> Message-ID: <42FECD1E.1090409@qualitycode.com> We have two votes for darcs, zero votes for other SCM systems, and zero votes to stay with CVS. There are some nice tools for doing a one-time conversion from CVS to darcs, so it won't be a problem with us losing history. There are also some processes for maintaining a two-way CVS-darcs gateway, but they don't seem to be automated and tested. So to keep things simple, My preference would be to *only* keep a darcs repository updated, and to kill off the wxruby2 CVS repository on rubyforge. Regular snapshot tarballs would be available for any wxruby2 developers who don't want to use darcs for some reason. If someone were sufficiently motivated, they should be able to set up a one-way gateway from the "official" darcs wxruby2 repo back into a CVS repo, although I would resist hosting it at rubyforge, since it wouldn't have "official" status. Does all of that sound reasonable? Is this something we should do before the first wxruby2 preview release? Or between the preview and the real release? Or after the real release? Kevin From roys at mindspring.com Sun Aug 14 00:55:23 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 14 00:49:19 2005 Subject: [Wxruby-users] Object map Message-ID: <42FECEBB.1070804@mindspring.com> I've spent a couple hours tracking through the code and reading Swig documentation to try to find out about tracking C objects back to Ruby objects. It's not so easy to do. I took at look at wxPython and their source is a mess! I wasn't able to glean anything from them on how they do it. My current hypothesis is to trap SWIG_NewPointerObj calls and build a map. But I haven't traipsed through enough code yet to really see if we can catch the Ruby objects dying. I note that no ruby object owns the wxWindows objects as they're created. I'm a little unsure how all this works out still and whether garbage collection will cause some really bad effects. I really think I need to either find some way to collaborate on a solution to this or set it aside until I'm much more familiar with the inner workings of the whole thing. Anyone have any thoughts? Roy From roys at mindspring.com Sun Aug 14 01:36:01 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 14 01:29:58 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source In-Reply-To: <42FECAEA.1040208@qualitycode.com> References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> <29e115530508130122531e34@mail.gmail.com> <42FECAEA.1040208@qualitycode.com> Message-ID: <42FED841.9020704@mindspring.com> Swigging now. Fails immediately because src directory doesn't exist. Easy patch for that I'm sure. Works fine with 1.3.25 on Windows. Roy P.S. I added: force_mkdir($src_dir) As the first line in do_swig and it ensure the src directory exists. Kevin Smith wrote: > Jani Monoses wrote: > >> Ubuntu will most likely have swig 1.3.24 in the upcoming release so a >> packge should build-depend on that > > > Ok. Since I'm a Unbuntu guy, I will target 1.3.24. The trick is > detecting the proper version, since I know SWIG 1.3.22 has problems, > and I don't trust 1.3.23 without someone testing it first. SWIG 1.3.25 > sends its -version output to stdout, but 1.3.24 sends it to stderr, > and there is no cross-platform way in ruby (without third-party > libraries) to catch stderr output. > > So I wrote a clever(?) hack that will figure out what version of SWIG > you have, if it's pre-1.3.25. I reverted my system to SWIG 1.3.24, > fixed the one post-processor script that didn't work, and was able to > build wxruby2 and run a couple samples. There is a chance that my fix > might fail with SWIG 1.3.25, and there is a chance that my hack won't > work properly on MS Windows. I'm optimistic on both of those, though. > > I also removed the entire src/ directory from CVS, meaning that you > must have SWIG to build from source. As was pointed out earlier, that > was really a requirement anyway, unless you happened to be on wxGTK. > > Please try out the new CVS head and let me know how it works for you. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Sun Aug 14 07:50:57 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 14 07:45:58 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source In-Reply-To: <42FED841.9020704@mindspring.com> References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> <29e115530508130122531e34@mail.gmail.com> <42FECAEA.1040208@qualitycode.com> <42FED841.9020704@mindspring.com> Message-ID: <42FF3021.2060609@qualitycode.com> Roy Sutton wrote: > Swigging now. Fails immediately because src directory doesn't exist. Strange. I did a completely-from-scratch CVS checkout and didn't have that problem. > P.S. I added: > > force_mkdir($src_dir) > > As the first line in do_swig and it ensure the src directory exists. I added this anyway, for safety. It has been committed. Thanks. > Works fine with 1.3.25 on Windows. Excellent. I have tagged the new head as 0.0.24. I wonder if this could become a release candidate for the "wxruby2 preview release"??? Kevin From wxruby at qualitycode.com Sun Aug 14 08:59:44 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 14 08:54:47 2005 Subject: [Wxruby-users] Object map In-Reply-To: <42FECEBB.1070804@mindspring.com> References: <42FECEBB.1070804@mindspring.com> Message-ID: <42FF4040.1000803@qualitycode.com> Roy Sutton wrote: > I've spent a couple hours tracking through the code and reading Swig > documentation to try to find out about tracking C objects back to Ruby > objects. It's not so easy to do. True. > I took at look at wxPython and their source is a mess! > I wasn't able to glean anything from them on how they do it. Yeah, I have found the wxPython code extremely hard to understand. That's part of why I really wanted to build wxruby2 from clean wx api .h files that don't have any ruby-specific clutter (these are the files in swig/classes/include/). If all the wxXyz (wxruby, fxruby, schemeruby) were built from the same set of api .h files, it would be easier to see how each project really works. > My current hypothesis is to trap SWIG_NewPointerObj calls and > build a map. But I haven't traipsed through enough code yet to really > see if we can catch the Ruby objects dying. I note that no ruby object > owns the wxWindows objects as they're created. I'm a little unsure how > all this works out still and whether garbage collection will cause some > really bad effects. I think the answer lies in directors. Every polymorphic class in wxruby2 has a director, and that gives us a convenient place to hook in to object construction and destruction. If you look at fixdeleting.rb, that's exactly what it's doing. > I really think I need to either find some way to collaborate on a > solution to this or set it aside until I'm much more familiar with the > inner workings of the whole thing. Yeah, it's definitely one of the trickier parts. I just set up a new wiki page with kind of a raw dump of a couple years of memory management discussions and tidbits. It's horribly ugly, but has tons of good information for anyone wanting to learn more about swig/c++/wx memory management issues: http://wxruby.rubyforge.org/wiki/wiki.pl?Memory_Management Kevin From wxruby at qualitycode.com Sun Aug 14 09:02:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 14 08:57:29 2005 Subject: [Wxruby-users] Functions that return objects... In-Reply-To: <42FD78C6.6020303@mindspring.com> References: <42FD5854.7030802@mindspring.com> <42FD5FE3.4060206@qualitycode.com> <42FD78C6.6020303@mindspring.com> Message-ID: <42FF40E7.6000504@qualitycode.com> At least on my system, FindReplaceDialog does get a director. It's declared in src/FindReplaceDialog.h, and you can see the stuff that fixdeleting.rb inserted into the .cpp file in the function: free_wxFindReplaceDialog Kevin Roy Sutton wrote: > I'm investigating this a bit more... I tried turning on wxDEBUG and > testing GcGetValueFromPointer. It seems that a director is never > created for FindReplaceDialog so there's no mapping available. Looking > at the director code that's included I somewhat expected the director to > be added in somewhere. Any other thoughts? > > Kevin Smith wrote: > >> Roy Sutton wrote: >> >>> I was investigating why the find dialog causes an error when you >>> close it. It seems that wxRuby2 is returning a new ruby object when >>> you call Event.get_dialog. >> >> >> (snip) >> >>> Is this a 'known' problem that has an easy workaround? Or is this >>> something much more structural that has to be addressed at the core >>> of the Swig files? >> >> >> >> We had to solve this in non-swig wxruby by keeping a map of all ruby >> objects that were passed into wx, and whenever an object was returned >> back out of wx, we checked to see if it matched up with one that was >> passed in. >> >> I think we could do the same thing in swig. I'm not sure if it can be >> done via a typemap, or if it would have to be a post-process step, or >> if there's a clean .i way. I know wxPython has the same issue, so it >> would be interesting to see how they solved it. >> >> Hm. We already keep a map of all known ruby->cpp objects to avoid >> double-freeing them. wx.i has the functions: >> GcMapPtrToValue >> GcGetValueFromPtr >> GcMarkDeleted >> GcIsDeleted >> >> I don't actually see the case you're referring to. Where does >> FileDialog use an event to carry an object value? >> >> Kevin >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From wxruby at qualitycode.com Sun Aug 14 09:17:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 14 09:12:29 2005 Subject: [Wxruby-users] wxruby2 release goals In-Reply-To: <42F8D893.3010100@pressure.to> References: <42F8B548.5000104@qualitycode.com> <42F8D893.3010100@pressure.to> Message-ID: <42FF446B.6080703@qualitycode.com> Alex Fenton wrote: > > Count me in for doing a source gem (will also try a mswin32 binary one > if someone compiles a .so, and will try a osx). Excellent. > Does anyone know how to make a OS X .dmg? I think Nick had a way of > doing this but I'm not sure if it is documented somewhere? Hm. I never understood that whole situation, and I don't think any tools or docs ever got checked into the wxruby tree. Does this message help? http://rubyforge.org/pipermail/wxruby-users/2004-December/001065.html Other potentially helpful messages: http://rubyforge.org/pipermail/wxruby-users/2005-February/001171.html http://rubyforge.org/pipermail/wxruby-users/2004-October/000968.html > Plan to do some work on the samples. Apart from 1) # better commenting > 2) removingCamelCaseMethodNames and 3) formatting line-wraps etc that is > needed everywhere to put the samples in exemplary ruby style? My own preference is to not 'include Wx' at the top of the file, since it pollutes the "global" namespace. One proposed compromise, to avoid having to use Wx:: everywhere, is to put 'include Wx' immediately inside any Wx-related class. So minimal.rb would have: class MyFrame < Wx::Frame include Wx def initialize.... ... class MyApp < Wx::App include Wx ... My main gripe about the samples is that it's not clear just by running them exactly what they do. Many have hidden features and obscure side effects if you do THIS before THAT instead of the other way around. To fully exercise each sample takes a lot of manual clicking. I suppose what I really want is a set of unit tests that automatically exercise all the different features of each wrapped class, but that's not the purpose of the samples. The samples should avoid declaring explicit window ID constants wherever possible. It's usually better to create the window with -1 as an id, and then call a method to obtain the id that was assigned. Thanks, Kevin From ruby at portfolio16.de Sun Aug 14 11:42:37 2005 From: ruby at portfolio16.de (Tobias Gruetzmacher) Date: Sun Aug 14 11:36:27 2005 Subject: [Wxruby-users] wxruby2 in darcs (was: Alternatives to CVS?) In-Reply-To: <42FECD1E.1090409@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <29e1155305080923386ecf2e3f@mail.gmail.com> <42FECD1E.1090409@qualitycode.com> Message-ID: <20050814154233.GA8958@portfolio16.de> Hi, On Sun, Aug 14, 2005 at 12:48:30AM -0400, Kevin Smith wrote: > So to keep things simple, My preference would be to *only* keep a darcs > repository updated, and to kill off the wxruby2 CVS repository on > rubyforge. Regular snapshot tarballs would be available for any wxruby2 > developers who don't want to use darcs for some reason. Sounds good. > Does all of that sound reasonable? Is this something we should do before > the first wxruby2 preview release? Or between the preview and the real > release? Or after the real release? I think it would be good to do it as soon as possible. Just my $0.02. BTW: I'm currently refactoring the controls.rb sample more. Expect some more patches soon :) Greetings Tobi -- GPG-Key 0xE2BEA341 - signed/encrypted mail preferred My, oh so small, homepage: http://portfolio16.de/ http://www.fli4l.de/ - ISDN- & DSL-Router on one disk! Registered FLI4L-User #00000003 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050814/70a40a5e/attachment.bin From roys at mindspring.com Sun Aug 14 11:58:07 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 14 11:52:01 2005 Subject: [Wxruby-users] wxruby2 release goals In-Reply-To: <42FF446B.6080703@qualitycode.com> References: <42F8B548.5000104@qualitycode.com> <42F8D893.3010100@pressure.to> <42FF446B.6080703@qualitycode.com> Message-ID: <42FF6A0F.4000200@mindspring.com> I completely agree on the samples being somewhat opaque. I also agree about the test cases. I am really a big advocate of the whole test-first methodology (even though I haven't been applying it here ;) ). Regardless of whether we retool the samples as test cases or not I think we should expand the test directory. I suppose focusing on what is important to convey to new users is the most important thing. Having said that... I'm not sure where to start. The dialogs sample is probably a good one to hack apart. Roy Kevin Smith wrote: >> Plan to do some work on the samples. Apart from 1) # better >> commenting 2) removingCamelCaseMethodNames and 3) formatting >> line-wraps etc that is needed everywhere to put the samples in >> exemplary ruby style? > > > My own preference is to not 'include Wx' at the top of the file, since > it pollutes the "global" namespace. One proposed compromise, to avoid > having to use Wx:: everywhere, is to put 'include Wx' immediately > inside any Wx-related class. So minimal.rb would have: > > class MyFrame < Wx::Frame > include Wx > def initialize.... > ... > class MyApp < Wx::App > include Wx > ... > > My main gripe about the samples is that it's not clear just by running > them exactly what they do. Many have hidden features and obscure side > effects if you do THIS before THAT instead of the other way around. > > To fully exercise each sample takes a lot of manual clicking. I > suppose what I really want is a set of unit tests that automatically > exercise all the different features of each wrapped class, but that's > not the purpose of the samples. > > The samples should avoid declaring explicit window ID constants > wherever possible. It's usually better to create the window with -1 as > an id, and then call a method to obtain the id that was assigned. From roys at mindspring.com Sun Aug 14 12:07:09 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 14 12:01:06 2005 Subject: [Wxruby-users] Functions that return objects... In-Reply-To: <42FF40E7.6000504@qualitycode.com> References: <42FD5854.7030802@mindspring.com> <42FD5FE3.4060206@qualitycode.com> <42FD78C6.6020303@mindspring.com> <42FF40E7.6000504@qualitycode.com> Message-ID: <42FF6C2D.8000300@mindspring.com> Yes, it does get a director but it's created not owning the object so the director doesn't track the memory for GC so the commands you pointed out before don't work. Also, I know that a few objects don't get directors. I'll invetigate fixdeleting a bit more. Kevin Smith wrote: > At least on my system, FindReplaceDialog does get a director. It's > declared in src/FindReplaceDialog.h, and you can see the stuff that > fixdeleting.rb inserted into the .cpp file in the function: > free_wxFindReplaceDialog > > Kevin > > > Roy Sutton wrote: > >> I'm investigating this a bit more... I tried turning on wxDEBUG and >> testing GcGetValueFromPointer. It seems that a director is never >> created for FindReplaceDialog so there's no mapping available. >> Looking at the director code that's included I somewhat expected the >> director to be added in somewhere. Any other thoughts? >> >> Kevin Smith wrote: >> >>> Roy Sutton wrote: >>> >>>> I was investigating why the find dialog causes an error when you >>>> close it. It seems that wxRuby2 is returning a new ruby object >>>> when you call Event.get_dialog. >>> >>> >>> >>> (snip) >>> >>>> Is this a 'known' problem that has an easy workaround? Or is this >>>> something much more structural that has to be addressed at the core >>>> of the Swig files? >>> >>> >>> >>> >>> We had to solve this in non-swig wxruby by keeping a map of all ruby >>> objects that were passed into wx, and whenever an object was >>> returned back out of wx, we checked to see if it matched up with one >>> that was passed in. >>> >>> I think we could do the same thing in swig. I'm not sure if it can >>> be done via a typemap, or if it would have to be a post-process >>> step, or if there's a clean .i way. I know wxPython has the same >>> issue, so it would be interesting to see how they solved it. >>> >>> Hm. We already keep a map of all known ruby->cpp objects to avoid >>> double-freeing them. wx.i has the functions: >>> GcMapPtrToValue >>> GcGetValueFromPtr >>> GcMarkDeleted >>> GcIsDeleted >>> >>> I don't actually see the case you're referring to. Where does >>> FileDialog use an event to carry an object value? >>> >>> Kevin >>> _______________________________________________ >>> wxruby-users mailing list >>> wxruby-users@rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wxruby-users >>> >>> >>> >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Sun Aug 14 15:59:48 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 14 15:53:44 2005 Subject: [Wxruby-users] Object map In-Reply-To: <42FF4040.1000803@qualitycode.com> References: <42FECEBB.1070804@mindspring.com> <42FF4040.1000803@qualitycode.com> Message-ID: <42FFA2B4.9020106@mindspring.com> I read over that earlier. It's pretty much exactly what my plan was. I don't know whether to feel better or scared that it's the recommended way. ;) I think we can do this pretty easily. I've been taking a look at the swig ruby wrappers to see the best way to inject all that stuff in there. I'm hoping we don't have to resort to the fixdeleting method. It strikes me it would be better to modify the swig actions somehow so it always produces what we want. If I get some time later I'll try messing with the wiki to make it all purty-like. Roy Kevin Smith wrote: > Yeah, it's definitely one of the trickier parts. I just set up a new > wiki page with kind of a raw dump of a couple years of memory > management discussions and tidbits. It's horribly ugly, but has tons > of good information for anyone wanting to learn more about swig/c++/wx > memory management issues: > > http://wxruby.rubyforge.org/wiki/wiki.pl?Memory_Management From wxruby at qualitycode.com Sun Aug 14 19:57:24 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 14 19:51:26 2005 Subject: [Wxruby-users] wxruby2 in darcs In-Reply-To: <20050814154233.GA8958@portfolio16.de> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <29e1155305080923386ecf2e3f@mail.gmail.com> <42FECD1E.1090409@qualitycode.com> <20050814154233.GA8958@portfolio16.de> Message-ID: <42FFDA64.3000109@qualitycode.com> Tobias Gruetzmacher wrote: > > I think it would be good to do it as soon as possible. Just my $0.02. Noted. Awaiting input from other folks. Meanwhile, I have started playing with darcs (again), and have published a darcs repo of my SpaceMonkeys game, which is the largest wxruby app I have written (years ago). I had to tweak it bit to get it working with the very latest wxruby2 head (as of two minutes ago). The main SpaceMonkeys screen comes up, but if you try to do a couple actions it generally crashes. Most likely wxruby2 memory management errors. Anyway, if you would like to experiment with darcs, try getting SpaceMonkeys with this command: darcs get http://fxa.org/darcs/SpaceMonkeys/main/ This will create a main/ directory under your current directory, and will populate it with the latest official SpaceMonkeys head. At any time, you can pull my latest SpaceMonkeys changes into your tree by changing into your "SpaceMonkeys/main" directory and doing: darcs pull http://fxa.org/darcs/SpaceMonkeys/main/ It will be critical to use standard procedures with darcs, including using standard names and locations for branches. I'm going to read more about darcs "best practices", but at the moment I am reserving the "main" branch name for the latest official development tree. That name may change based on what I read. Whatever naming convention I decide on, it will be used for both SpaceMonkeys and wxruby2. As I develop those conventions, I'll email them to the wxruby list. We'll probably also need some wxruby wiki pages for darcs-related stuff. Kevin From roys at mindspring.com Sun Aug 14 20:09:40 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 14 20:03:36 2005 Subject: [Wxruby-users] wxruby2 in darcs In-Reply-To: <42FFDA64.3000109@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <29e1155305080923386ecf2e3f@mail.gmail.com> <42FECD1E.1090409@qualitycode.com> <20050814154233.GA8958@portfolio16.de> <42FFDA64.3000109@qualitycode.com> Message-ID: <42FFDD44.1020307@mindspring.com> Holy cow! Darcs worked, just like that. I ave spacemonkeys on my computer now. But it won't bring up the main window on Windows. I'll investigate the errors and letcha know if there's a patch needed. Roy Kevin Smith wrote: > Tobias Gruetzmacher wrote: > >> >> I think it would be good to do it as soon as possible. Just my $0.02. > > > Noted. Awaiting input from other folks. > > Meanwhile, I have started playing with darcs (again), and have > published a darcs repo of my SpaceMonkeys game, which is the largest > wxruby app I have written (years ago). I had to tweak it bit to get it > working with the very latest wxruby2 head (as of two minutes ago). The > main SpaceMonkeys screen comes up, but if you try to do a couple > actions it generally crashes. Most likely wxruby2 memory management > errors. > > Anyway, if you would like to experiment with darcs, try getting > SpaceMonkeys with this command: > > darcs get http://fxa.org/darcs/SpaceMonkeys/main/ > > This will create a main/ directory under your current directory, and > will populate it with the latest official SpaceMonkeys head. > > At any time, you can pull my latest SpaceMonkeys changes into your > tree by changing into your "SpaceMonkeys/main" directory and doing: > > darcs pull http://fxa.org/darcs/SpaceMonkeys/main/ > > It will be critical to use standard procedures with darcs, including > using standard names and locations for branches. I'm going to read > more about darcs "best practices", but at the moment I am reserving > the "main" branch name for the latest official development tree. That > name may change based on what I read. Whatever naming convention I > decide on, it will be used for both SpaceMonkeys and wxruby2. > > As I develop those conventions, I'll email them to the wxruby list. > We'll probably also need some wxruby wiki pages for darcs-related stuff. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From sean.m.long at gmail.com Mon Aug 15 01:12:46 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 15 01:06:32 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source In-Reply-To: <42FF3021.2060609@qualitycode.com> References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> <29e115530508130122531e34@mail.gmail.com> <42FECAEA.1040208@qualitycode.com> <42FED841.9020704@mindspring.com> <42FF3021.2060609@qualitycode.com> Message-ID: Checked out HEAD and compiled and ran just fine on OS X. Doing a check out is so much nicer now that src/ is empty. using SWIG 1.3.25 Sean On 8/14/05, Kevin Smith wrote: > Roy Sutton wrote: > > Swigging now. Fails immediately because src directory doesn't exist. > > Strange. I did a completely-from-scratch CVS checkout and didn't have > that problem. > > > P.S. I added: > > > > force_mkdir($src_dir) > > > > As the first line in do_swig and it ensure the src directory exists. > > I added this anyway, for safety. It has been committed. Thanks. > > > Works fine with 1.3.25 on Windows. > > Excellent. I have tagged the new head as 0.0.24. I wonder if this could > become a release candidate for the "wxruby2 preview release"??? > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From sean.m.long at gmail.com Mon Aug 15 01:21:31 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 15 01:15:21 2005 Subject: [Wxruby-users] wxruby2 in darcs (was: Alternatives to CVS?) In-Reply-To: <42FECD1E.1090409@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <29e1155305080923386ecf2e3f@mail.gmail.com> <42FECD1E.1090409@qualitycode.com> Message-ID: > Does all of that sound reasonable? Is this something we should do before > the first wxruby2 preview release? Or between the preview and the real > release? Or after the real release? I think it should be done before the preview release, that way we have it all worked out before the big 1.0 release (or whatever it will be called). Sean From wxruby at qualitycode.com Mon Aug 15 08:20:51 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 15 08:14:52 2005 Subject: [Wxruby-users] SWIG is *required* to build wxruby2 from source In-Reply-To: References: <42FB588C.7000300@qualitycode.com> <42FD7255.4010709@qualitycode.com> <29e115530508130122531e34@mail.gmail.com> <42FECAEA.1040208@qualitycode.com> <42FED841.9020704@mindspring.com> <42FF3021.2060609@qualitycode.com> Message-ID: <430088A3.6090101@qualitycode.com> Sean Long wrote: > Checked out HEAD and compiled and ran just fine on OS X. Doing a check > out is so much nicer now that src/ is empty. > > using SWIG 1.3.25 Excellent. So it builds on Linux, Windows, and Mac. It works with SWIG 1.3.24 and 1.3.25. As far as I know, all the samples run. But we do have some pretty serious memory problems, since most of the samples will segfault on exit, and SpaceMonkeys segfaults pretty quickly. My guess is that the first garbage collection sweep crashes. Someone could confirm that by experimenting with GC.start calls in the samples. I would like to fix those crashes before the preview release, even if it means leaking memory wildly by preventing things from being deleted. It would be better to (eventually) run out of memory than to immediately crash, for now. We'll get all the problems fixed for real before the true 1.0 release. I won't have a lot of time this week, but hopefully I can put in a few hours to try to figure it out. Meanwhile, I think the other two highest priority tasks should be: 1. Adding the classes that were in wxruby 0.6 but aren't yet in wxruby2 2. Adding/improving the samples Kevin From alex at pressure.to Mon Aug 15 20:16:41 2005 From: alex at pressure.to (Alex Fenton) Date: Mon Aug 15 20:10:07 2005 Subject: [Wxruby-users] TextAttr.i Message-ID: <43013069.7010603@pressure.to> Hi New .i file attached; compiled and tested on OS X, though background colour doesn't seem to work as documented - applying TextAttr.new(fg_colour, bg_colour) doesn't seem to affect the actual shown colour, even with TE_RICH|TE_RICH2 styles on the TextCtrl. This is also true of current wx on Windows but not Linux. As per Nick's comment previously, TextAttr and TextCtrl#set_style are candidates for some ruby syntax sugar, but this patch should at least allow some simple "rich" text editors. cheers alex -------------- next part -------------- # Copyright 2004-2005 by Kevin Smith # released under the MIT-style wxruby2 license %include "../common.i" %module(directors="1") wxTextAttr; %{ #include %} %include "include/wxTextAttr.h" From roys at mindspring.com Mon Aug 15 23:57:01 2005 From: roys at mindspring.com (Roy Sutton) Date: Mon Aug 15 23:51:02 2005 Subject: [Wxruby-users] swig_up Message-ID: <4301640D.4050904@mindspring.com> Tracing down some things to add in validators and I've run across something that kinda bothers me... In order to implement validators you have to override the clone method. The directors seems to be set up to specifically handle this situation. However, whenever C++ calls back to the object's methods the swig_get_up function is returning false. It seems like swig_up should be true most of the time. In fact, I'm thinking that the whole implementation is a little messed up. Is it just that I'm missing something? Roy From roys at mindspring.com Tue Aug 16 00:44:16 2005 From: roys at mindspring.com (Roy Sutton) Date: Tue Aug 16 00:38:11 2005 Subject: [Wxruby-users] wxLayoutContraints.h Message-ID: <43016F20.8020308@mindspring.com> The file swig/classes/includes/wxLayoutConstraints.h may need to be updated. It's missing centreX and centreY from the list of wxIndividualLayoutConstraints. I'd send a patch in but I'm wondering if this file just needs to be regenerated from scratch. Roy From sean.m.long at gmail.com Tue Aug 16 19:24:47 2005 From: sean.m.long at gmail.com (Sean Long) Date: Tue Aug 16 19:18:32 2005 Subject: [Wxruby-users] Patch and files to add Listbook Message-ID: I added the Listbook class (basically the same as the Notebook class with some name changes). I also took the time to write a sample that uses it. The sample interface uses XRC and is slightly more advanced than the current XRC sample. Sean -------------- next part -------------- # Copyright 2004-2005 by Kevin Smith # released under the MIT-style wxruby2 license %include "../common.i" %module(directors="1") wxListbook %feature("nodirector") wxListbook::OnSelChange; %{ #include #include %} GC_NEVER(wxListbook) #define wxListbookPage wxWindow %ignore wxListbook::OnSelChange; %include "include/wxListbook.h" -------------- next part -------------- A non-text attachment was scrubbed... Name: listbook.patch Type: application/octet-stream Size: 10052 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050816/86d77e5a/listbook-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: listbook.zip Type: application/zip Size: 3351 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050816/86d77e5a/listbook-0001.zip -------------- next part -------------- # Copyright 2004-2005 by Kevin Smith # released under the MIT-style wxruby2 license %include "../common.i" %module(directors="1") wxListbookEvent %{ #include %} %include "include/wxListbookEvent.h" -------------- next part -------------- // wxListbook.h #if !defined(_wxListbook_h_) #define _wxListbook_h_ class wxListbook : public wxControl { public: /** * \brief Default constructor. */ wxListbook(); wxListbook(wxWindow* parent , wxWindowID id , const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("listbook")); /** * \brief Destroys the wxListbook object. */ virtual ~wxListbook() ; /** * \brief Adds a new page. * \param wxListbookPage* * \param const wxString& * \param bool * \param int */ bool AddPage(wxListbookPage* page , const wxString& text , bool select = false, int imageId = -1) ; /** * \brief Cycles through the tabs. * \param bool */ void AdvanceSelection(bool forward = true) ; /** * \brief Sets the image list for the page control and takes ownership of the list. * \param wxImageList* */ void AssignImageList(wxImageList* imageList ) ; /** * \brief Creates a listbook control. See for a description of the parameters. * \param wxWindow* * \param wxWindowID * \param const wxPoint& * \param const wxSize& * \param long * \param const wxString& */ bool Create(wxWindow* parent , wxWindowID id , const wxPoint& pos , const wxSize& size , long style , const wxString& name = wxT("notebook")); /** * \brief Deletes all pages. */ bool DeleteAllPages() ; /** * \brief Deletes the specified page, and the associated window. * \param int */ bool DeletePage(int page ) ; /** * \brief */ wxImageList* GetImageList() const; /** * \brief Returns the window at the given page position. * \param int */ wxNotebookPage* GetPage(int page ) ; /** * \brief Returns the number of pages in the listbook control. */ int GetPageCount() const; /** * \brief Returns the image index for the given page. * \param int */ int GetPageImage(int nPage ) const; /** * \brief Returns the string for the given page. * \param int */ wxString GetPageText(int nPage ) const; /** * \brief Returns the number of rows in the listbook control. */ //int GetRowCount() const; /** * \brief Returns the currently selected page, or $-1$ if none was selected. Note that this method may return either the previously or newly selected page when called from the handler depending on the platform and so should be used instead in this case. */ int GetSelection() const; /** * \brief Inserts a new page at the specified position. * \param int * \param wxListbookPage* * \param const wxString& * \param bool * \param int */ bool InsertPage(int index , wxListbookPage* page , const wxString& text , bool select = false, int imageId = -1) ; /** * \brief An event handler function, called when the page selection is changed. * \param wxListbookEvent& */ virtual void OnSelChange(wxListbookEvent& event ) ; /** * \brief Deletes the specified page, without deleting the associated window. * \param int */ bool RemovePage(int page ) ; /** * \brief Sets the image list for the page control. It does not take ownership of the image list, you must delete it yourself. * \param wxImageList* */ void SetImageList(wxImageList* imageList ) ; /** * \brief Sets the amount of space around each page's icon and label, in pixels. The vertical padding cannot be changed in wxGTK. * \param const wxSize& */ //void SetPadding(const wxSize& padding ) ; /** * \brief Sets the width and height of the pages. This method is currently not implemented for wxGTK. * \param const wxSize& */ void SetPageSize(const wxSize& size ) ; /** * \brief Sets the image index for the given page. is an index into the image list which was set with . * \param int * \param int */ bool SetPageImage(int page , int image ) ; /** * \brief Sets the text for the given page. * \param int * \param const wxString& */ bool SetPageText(int page , const wxString& text ) ; /** * \brief Sets the selection for the given page, returning the previous selection. * \param int */ int SetSelection(int page ) ; }; #endif -------------- next part -------------- // wxListbookEvent.h #if !defined(_wxListbookEvent_h_) #define _wxListbookEvent_h_ class wxListbookEvent : public wxNotifyEvent { public: /** * \brief Constructor (used internally by wxWindows only). * \param wxEventType * \param int * \param int * \param int */ wxListbookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND); /** * \brief Returns the page that was selected before the change, $-1$ if none was selected. */ int GetOldSelection() const; /** * \brief Returns the currently selected page, or $-1$ if none was selected. under Windows, GetSelection() will return the same value as when called from handler and not the page which is going to be selected. */ int GetSelection() const; /** * \brief Sets the id of the page selected before the change. * \param int */ void SetOldSelection(int page ) ; /** * \brief Sets the selection member variable. * \param int */ void SetSelection(int page ) ; }; #endif From roys at mindspring.com Tue Aug 16 23:24:06 2005 From: roys at mindspring.com (Roy Sutton) Date: Tue Aug 16 23:17:54 2005 Subject: [Wxruby-users] Patch for caret.rb Message-ID: <4302ADD6.903@mindspring.com> This patch fixes the following errors: 1. Crash when you resize smaller than 1 line 2. Crash when you resize the cursor outside the screen 3. Doesn't clear screen when you resize (on Windows at least) -------------- next part -------------- --- samples/caret/caret.rb 2005-08-16 23:15:35.039531200 -0400 +++ ../caret.rb 2005-08-16 23:21:43.048702400 -0400 @@ -125,12 +125,18 @@ def onSize(event) @m_xChars = (event.get_size().x - 2*@m_xMargin) / @m_widthChar @m_yChars = (event.get_size().y - 2*@m_yMargin) / @m_heightChar - if @m_xChars == 0 + if @m_xChars <= 0 @m_xChars = 1 end - if @m_yChars == 0 + if @m_yChars <= 0 @m_yChars = 1 end + if @m_xCaret >= @m_xChars + @m_xCaret = @m_xChars-1 + end + if @m_yCaret >= @m_yChars + @m_yCaret = @m_yChars-1 + end @m_text = " " * @m_xChars * @m_yChars @@ -138,6 +144,7 @@ if frame && frame.get_status_bar() msg = sprintf("Panel size is (%d, %d)", @m_xChars, @m_yChars) frame.set_status_text(msg, 1) + frame.refresh end event.skip() end From sean.m.long at gmail.com Wed Aug 17 10:52:44 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 17 10:46:26 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: References: Message-ID: Use the attached file instead of the one in previous message. Sean On 8/16/05, Sean Long wrote: > I added the Listbook class (basically the same as the Notebook class > with some name changes). I also took the time to write a sample that > uses it. The sample interface uses XRC and is slightly more advanced > than the current XRC sample. > > > Sean > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: wxListbook.h Type: application/octet-stream Size: 4234 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050817/79257821/wxListbook.obj From wxruby at qualitycode.com Wed Aug 17 18:53:13 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 18:47:04 2005 Subject: [Wxruby-users] TextAttr.i In-Reply-To: <43013069.7010603@pressure.to> References: <43013069.7010603@pressure.to> Message-ID: <4303BFD9.8040003@qualitycode.com> Alex Fenton wrote: > New .i file attached; compiled and tested on OS X, though background > colour doesn't seem to work as documented - applying > TextAttr.new(fg_colour, bg_colour) doesn't seem to affect the actual > shown colour, even with TE_RICH|TE_RICH2 styles on the TextCtrl. This is > also true of current wx on Windows but not Linux. Compiled fine under Linux. Committed. Thanks! Kevin From wxruby at qualitycode.com Wed Aug 17 18:58:32 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 18:52:22 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4301640D.4050904@mindspring.com> References: <4301640D.4050904@mindspring.com> Message-ID: <4303C118.6090601@qualitycode.com> Roy Sutton wrote: > In order to implement validators you have to override the clone method. > The directors seems to be set up to specifically handle this situation. > However, whenever C++ calls back to the object's methods the swig_get_up > function is returning false. It seems like swig_up should be true most > of the time. In fact, I'm thinking that the whole implementation is a > little messed up. Is it just that I'm missing something? Whenever swig is calling back into ruby, swig_up should be true. The sipmlest case is when ruby code overrides a virtual C++ method, which I think is what you are describing. I know the basic mechanism isn't completely and totally broken because it works for App#on_init. It would help if you could post a little ruby sample fragment, and point to the C++ code that you suspect of being incorrect. Kevin From wxruby at qualitycode.com Wed Aug 17 19:00:51 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 18:54:41 2005 Subject: [Wxruby-users] wxLayoutContraints.h In-Reply-To: <43016F20.8020308@mindspring.com> References: <43016F20.8020308@mindspring.com> Message-ID: <4303C1A3.4020403@qualitycode.com> Roy Sutton wrote: > The file swig/classes/includes/wxLayoutConstraints.h may need to be > updated. It's missing centreX and centreY from the list of > wxIndividualLayoutConstraints. > > I'd send a patch in but I'm wondering if this file just needs to be > regenerated from scratch. I'll accept either a diff patch, or a whole new copy that should replace the existing one if the current copy is crap. We don't really have a way to regenerate it any more, and if we did it would probably produce identical results. These days, I either copy/paste out of the wx docs (ick) or out of the actual wx include .h files on my system (eek). Kevin From wxruby at qualitycode.com Wed Aug 17 19:14:19 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 19:08:09 2005 Subject: [Wxruby-users] Patch for caret.rb In-Reply-To: <4302ADD6.903@mindspring.com> References: <4302ADD6.903@mindspring.com> Message-ID: <4303C4CB.5070405@qualitycode.com> Roy Sutton wrote: > This patch fixes the following errors: > > 1. Crash when you resize smaller than 1 line > 2. Crash when you resize the cursor outside the screen > 3. Doesn't clear screen when you resize (on Windows at least) Applied. Thanks. Kevin From wxruby at qualitycode.com Wed Aug 17 19:47:21 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 19:41:15 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: References: Message-ID: <4303CC89.5040000@qualitycode.com> Sean Long wrote: > Use the attached file instead of the one in previous message. Ok. >>I added the Listbook class (basically the same as the Notebook class >>with some name changes). I also took the time to write a sample that >>uses it. The sample interface uses XRC and is slightly more advanced >>than the current XRC sample. Sounds cool. I have committed this, but on my machine the sample window is completely blank. I mean *completely* blank, without even a menu bar. The other xrc sample appears to work for me (the dialog that pops up has three working buttons). Your patch still had lots of unchanged diff entries in it, probably due to line-ending issues. Not sure how to avoid that, and it wasn't too bad this time, but would be nicer if the patch only contained stuff that had actually changed. Kevin From sean.m.long at gmail.com Wed Aug 17 19:55:44 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 17 19:49:26 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: <4303CC89.5040000@qualitycode.com> References: <4303CC89.5040000@qualitycode.com> Message-ID: > Your patch still had lots of unchanged diff entries in it, probably due > to line-ending issues. Not sure how to avoid that, and it wasn't too bad > this time, but would be nicer if the patch only contained stuff that had > actually changed. Yeah sorry about that I am not sure where all that crap came from. Tonight I may look over the sample again to see if I spot any parts that may be platform specific. Sean From wxruby at qualitycode.com Wed Aug 17 20:08:23 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 20:02:18 2005 Subject: [Wxruby-users] Volunteer requested: Implement SplitterWindow Message-ID: <4303D177.6050709@qualitycode.com> About a year ago (ouch!), Robert Carlin submitted a ported version of the wxPython demo/sample. I hoped to include it in wxruby2, but it relies on SplitterWindow, which isn't in wxruby2 yet. I tried to implement SplitterWindow myself, but got such strange results that I'm thinking I did something wrong. Even though the generated C++ code specified a variable number of arguments to the constructor, Ruby would always insist that it needed exactly one parameter. It called the swig wrapped object allocator, but never called the swig wrapped constructor. Below is my sample app, and the results. I am intentionally not showing my .i file in case I did something subtly wrong that you might copy. I did make one correction to the .h file (and checked it in), but otherwise it looks fine. If you plan to spend more than a few minutes on this, please post a note to the list so you don't duplicate effort. Thanks, Kevin ---- kevins@aria:~/work/wxruby2$ cat samples/testsplitter.rb require 'wx' include Wx class MyFrame < Frame def initialize(title,pos,size,style=DEFAULT_FRAME_STYLE) super(nil,-1,title,pos,size,style) splitter = SplitterWindow.new(self, -1) end end class RbApp < App def on_init frame = MyFrame.new("Spliter Tester",Point.new(50, 50), Size.new(450, 340)) frame.show(TRUE) end end a = RbApp.new a.main_loop() kevins@aria:~/work/wxruby2$ ruby samples/testsplitter.rb Our Initialize was called Their Initialize returned 1 samples/testsplitter.rb:8:in `initialize': wrong # of arguments(2 for 1) (ArgumentError) from samples/testsplitter.rb:8:in `new' from samples/testsplitter.rb:8:in `initialize' from samples/testsplitter.rb:15:in `new' from samples/testsplitter.rb:15:in `on_init' from samples/testsplitter.rb:21:in `main_loop' from samples/testsplitter.rb:21 kevins@aria:~/work/wxruby2$ From sean.m.long at gmail.com Wed Aug 17 20:10:59 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 17 20:04:39 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: References: <4303CC89.5040000@qualitycode.com> Message-ID: Just checked out HEAD and in wxListbook.h the GetPage signature is: wxNotebookPage* GetPage(int page ) ; and should be wxListbookPage* GetPage(int page ) ; which was in the second version of wxListbook.h I attached in this thread, on windows both versions work fine but Mac OS X needs the second which is the correct version. Sean On 8/17/05, Sean Long wrote: > > Your patch still had lots of unchanged diff entries in it, probably due > > to line-ending issues. Not sure how to avoid that, and it wasn't too bad > > this time, but would be nicer if the patch only contained stuff that had > > actually changed. > > Yeah sorry about that I am not sure where all that crap came from. > Tonight I may look over the sample again to see if I spot any parts > that may be platform specific. > > Sean > From wxruby at qualitycode.com Wed Aug 17 22:28:26 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 22:22:21 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: References: <4303CC89.5040000@qualitycode.com> Message-ID: <4303F24A.6020004@qualitycode.com> Sean Long wrote: > Just checked out HEAD and in wxListbook.h the GetPage signature is: > wxNotebookPage* GetPage(int page ) ; > > and should be > wxListbookPage* GetPage(int page ) ; > > which was in the second version of wxListbook.h I attached in this > thread, on windows both versions work fine but Mac OS X needs the > second which is the correct version. On my local copy, and in the CVS repo as shown by the rubyforge web browser, the signature is correct, with wxListbookPage. Here's what I just copy/pasted from rubyforge: wxListbookPage* GetPage(int page ) ; So please recheck on your end. If there's still a problem, please submit it as a patch. I did just notice that the string constant default parameter at the end of the Create signature says "notebook" instead of "listbook". Thanks, Kevin From roys at mindspring.com Wed Aug 17 22:36:47 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 17 22:30:32 2005 Subject: [Wxruby-users] wxLayoutContraints.h In-Reply-To: <4303C1A3.4020403@qualitycode.com> References: <43016F20.8020308@mindspring.com> <4303C1A3.4020403@qualitycode.com> Message-ID: <4303F43F.8080809@mindspring.com> Attached is the new file. Easier than diffing. Kevin Smith wrote: > Roy Sutton wrote: > >> The file swig/classes/includes/wxLayoutConstraints.h may need to be >> updated. It's missing centreX and centreY from the list of >> wxIndividualLayoutConstraints. >> >> I'd send a patch in but I'm wondering if this file just needs to be >> regenerated from scratch. > > > I'll accept either a diff patch, or a whole new copy that should > replace the existing one if the current copy is crap. > > We don't really have a way to regenerate it any more, and if we did it > would probably produce identical results. These days, I either > copy/paste out of the wx docs (ick) or out of the actual wx include .h > files on my system (eek). > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- // wxLayoutConstraints.h // This file was automatically generated // by extractxml.rb, part of the wxRuby project // Do not make changes directly to this file! #if !defined(_wxLayoutConstraints_h_) #define _wxLayoutConstraints_h_ class wxLayoutConstraints : public wxObject { public: /** * \brief Constructor. */ wxLayoutConstraints() ; // the following were missing from the xml wxIndividualLayoutConstraint bottom,height,left,right,top,width,centreX,centreY; }; #endif From roys at mindspring.com Wed Aug 17 22:43:23 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 17 22:37:06 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4303C118.6090601@qualitycode.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> Message-ID: <4303F5CB.5000408@mindspring.com> Attached are two files: test21.rb (a slightly modified version of the file from the previous version of wxRuby) Validator.i Plop validator.i into swig/classes and rake. Try running test21.rb. Open the Edit->'Goto Line' dialog box. You -should- see 'Validator.Clone was called' followed by 'Validator.Copy was called' in the console. But you won't if it behaves like it does on mine. You can go into Validator.cpp and add a printf into the Clone wrapper and you'll see swig_up is false. Roy Kevin Smith wrote: > Roy Sutton wrote: > >> In order to implement validators you have to override the clone >> method. The directors seems to be set up to specifically handle this >> situation. However, whenever C++ calls back to the object's methods >> the swig_get_up function is returning false. It seems like swig_up >> should be true most of the time. In fact, I'm thinking that the >> whole implementation is a little messed up. Is it just that I'm >> missing something? > > > Whenever swig is calling back into ruby, swig_up should be true. The > sipmlest case is when ruby code overrides a virtual C++ method, which > I think is what you are describing. I know the basic mechanism isn't > completely and totally broken because it works for App#on_init. > > It would help if you could post a little ruby sample fragment, and > point to the C++ code that you suspect of being incorrect. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- # Copyright 2004-2005 by Kevin Smith # released under the MIT-style wxruby2 license %include "../common.i" %module(directors="1") wxValidator %include "include/wxValidator.h" -------------- next part -------------- require 'wx' include Wx MENU_FILE_OPEN = 100 MENU_FILE_SAVE = 101 MENU_FILE_QUIT = 102 MENU_EDIT_GOTO = 103 MENU_OPTION_BACKGROUND = 104 MENU_OPTION_FONT = 105 MENU_OPTION_DIRECTORY = 106 MENU_INFO_ABOUT = 107 class RangeValidator < Validator attr_reader :min attr_reader :max attr_reader :current def initialize(initialValue, min, max) super() @min = min @max = max @current = initialValue #puts("Validator will allow #{min} to #{max}, default #{current}") end def copy puts("Validator.copy was called") return RangeValidator.new(current, min, max) end def clone puts("Validator.clone was called") return copy end def validate(parent) win = get_window() if !win puts("get_window returned nil") return false end control = win result = false currentValue = control.get_value.to_i puts("Value being checked: #{currentValue}") if currentValue < 1 message = "#{currentValue} is not a valid number" else if currentValue < min || currentValue > max message = "#{currentValue} is not between #{min} and #{max}" else result = true end end if !result message_box(message) control.set_focus end return result end def transfer_to_window puts("transfer_to_window called") puts(current.to_s) win = get_window() control = win control.set_value(current.to_s) puts("Value set to #{current}") return true end def transfer_from_window puts("transfer_from_window called") win = get_window() control = win @current = control.get_value.to_i puts("Got value #{current}") return true end end class GotoLineDialog < Dialog attr_accessor :value def initialize(parent) super(parent, -1, "Goto Line...", DEFAULT_POSITION, Size.new(250, 120), DEFAULT_DIALOG_STYLE) set_auto_layout(TRUE) layout = LayoutConstraints.new # Label is centered on the dialog and on top of the dialog. @m_pLabel = StaticText.new(self, -1, "") layout.top.same_as(self, LAYOUT_TOP, 10) layout.centreX.same_as(self, LAYOUT_CENTRE_X) layout.width.as_is layout.height.as_is @m_pLabel.set_constraints(layout) # LineNumberCtrl is centered on the dialog and below Label. @m_pLineNumberCtrl = TextCtrl.new(self, -1) layout = LayoutConstraints.new layout.top.below(@m_pLabel, 10) layout.centreX.same_as(self, LAYOUT_CENTRE_X) layout.width.absolute(70) layout.height.as_is @m_pLineNumberCtrl.set_constraints(layout) # cancelButton is put at the right and bottom of the dialog. cancelButton = Button.new(self, ID_CANCEL, "Cancel") layout = LayoutConstraints.new layout.bottom.same_as(self, LAYOUT_BOTTOM, 10) layout.right.same_as(self, LAYOUT_RIGHT, 10) layout.width.as_is layout.height.as_is cancelButton.set_constraints(layout) # okButton is put at the left of the cancelButton. okButton = Button.new(self, ID_OK, "Ok") layout = LayoutConstraints.new layout.bottom.same_as(cancelButton, LAYOUT_BOTTOM) layout.right.left_of(cancelButton, 10) layout.width.same_as(cancelButton, LAYOUT_WIDTH) layout.height.as_is okButton.set_constraints(layout) okButton.set_default evt_init_dialog {onInitDialog} end def onInitDialog label = "Enter a line between 1 and #{@m_maxLineNumber}" @m_pLabel.set_label(label) layout() rangeValidator = RangeValidator.new(1, 1, @m_maxLineNumber) @m_pLineNumberCtrl.set_validator(rangeValidator) #puts rangeValidator #puts @m_pLineNumberCtrl.get_validator() result = transfer_data_to_window() #puts("transfer_data_to_window returned #{result}") @m_pLineNumberCtrl.set_focus end def SetMaxLineNumber(maxLineNumber) @m_maxLineNumber = maxLineNumber end def GetLineNumber return @m_pLineNumberCtrl.get_validator.current end end class AboutDialog < Dialog def initialize(parent) super(parent, -1, "About Simple Text Editor", DEFAULT_POSITION, Size.new(200, 200), DEFAULT_DIALOG_STYLE) set_auto_layout(TRUE) layout = LayoutConstraints.new layout.top.same_as(self, LAYOUT_TOP, 10) layout.centreX.same_as(self, LAYOUT_CENTRE_X) layout.width.as_is layout.height.as_is @m_pInfoText = StaticText.new(self, -1, "", Point.new(-1, -1), DEFAULT_SIZE, ALIGN_CENTER) @m_pInfoText.set_constraints(layout) layout = LayoutConstraints.new layout.top.below(@m_pInfoText, 10) layout.centreX.same_as(self, LAYOUT_CENTRE_X) layout.width.percent_of(self, LAYOUT_WIDTH, 80) layout.height.as_is @m_pOkButton = Button.new(self, ID_OK, "Ok", Point.new(-1, -1)) @m_pOkButton.set_constraints(layout) layout() end def set_text(text) @m_pInfoText.set_label(text) # Call layout, because the static text could be resized. layout() end end class TextFrame < Frame def initialize(title, xpos, ypos, width, height) super(nil,-1, title, Point.new(xpos, ypos), Size.new(width, height)) @m_pTextCtrl = TextCtrl.new(self, -1, "This is\na test of\ndialog input.\nFeel free to add more text...", DEFAULT_POSITION, DEFAULT_SIZE, TE_MULTILINE) @m_pMenuBar = MenuBar.new # File Menu @m_pFileMenu = Menu.new @m_pFileMenu.append(MENU_FILE_OPEN, "&Open", "Opens an existing file") @m_pFileMenu.append(MENU_FILE_SAVE, "&Save", "Save the content") @m_pFileMenu.append_separator @m_pFileMenu.append(MENU_FILE_QUIT, "&Quit", "Quit the application") @m_pMenuBar.append(@m_pFileMenu, "&File") # Edit Menu @m_pEditMenu = Menu.new @m_pEditMenu.append(MENU_EDIT_GOTO, "&Goto Line", "Jump to a line") @m_pMenuBar.append(@m_pEditMenu, "&Edit") # Option Menu @m_pOptionMenu = Menu.new @m_pOptionMenu.append(MENU_OPTION_BACKGROUND, "&Background", "Sets the background colour of the editor") @m_pOptionMenu.append(MENU_OPTION_FONT, "&Font", "Sets the font of the editor") @m_pOptionMenu.append(MENU_OPTION_DIRECTORY, "&Directory", "Sets the working directory") @m_pMenuBar.append(@m_pOptionMenu, "&Options") # About menu @m_pInfoMenu = Menu.new @m_pInfoMenu.append(MENU_INFO_ABOUT, "&About", "Shows information about the application") @m_pMenuBar.append(@m_pInfoMenu, "&Info") set_menu_bar(@m_pMenuBar) # Statusbar create_status_bar(3) set_status_text("Ready", 0) evt_menu(MENU_FILE_OPEN) {|event| onMenuFileOpen(event) } evt_menu(MENU_FILE_SAVE) {|event| onMenuFileSave(event) } evt_menu(MENU_FILE_QUIT) {|event| onMenuFileQuit(event) } evt_menu(MENU_EDIT_GOTO) {|event| onMenuEditGoto(event) } evt_menu(MENU_INFO_ABOUT) {|event| onMenuInfoAbout(event) } evt_menu(MENU_OPTION_BACKGROUND) {|event| onMenuOptionBackgroundColor(event) } evt_menu(MENU_OPTION_FONT) {|event| onMenuOptionFont(event) } evt_menu(MENU_OPTION_DIRECTORY) {|event| onMenuOptionDirectory(event) } evt_close {|event| onClose(event) } end # def show(visible) # super(visible) # @m_pTextCtrl.set_focus # end def onMenuFileOpen(event) dlg = FileDialog.new(self, "Open a text file", "", "", "All files(*.*)|*.*|Text Files(*.txt)|*.txt", OPEN, DEFAULT_POSITION) if dlg.show_modal == ID_OK @m_pTextCtrl.load_file(dlg.get_filename) set_status_text(dlg.get_filename, 0) end dlg.destroy end def onMenuFileOpen(event) dlg = FileDialog.new(self, "Open a text file", "", "", "All files(*.*)|*.*|Text Files(*.txt)|*.txt", OPEN, DEFAULT_POSITION) if dlg.show_modal == ID_OK @m_pTextCtrl.load_file(dlg.get_filename) set_status_text(dlg.get_filename, 0) end dlg.destroy() end def onMenuFileSave(event) dlg = FileDialog.new(self, "Save a text file", "", "", "All files(*.*)|*.*|Text Files(*.txt)|*.txt", SAVE, DEFAULT_POSITION) if dlg.show_modal == ID_OK @m_pTextCtrl.save_file(dlg.get_path) set_status_text(dlg.get_filename, 0) end dlg.destroy @m_pTextCtrl.discard_edits end def onMenuFileQuit(event) close(FALSE) end def onMenuInfoAbout(event) dlg = AboutDialog.new(self) dlg.set_text("(c) 2001 S.A.W. Franky Braem\nSimple Text Editor\n") dlg.show_modal dlg.destroy end def onMenuEditGoto(event) dlg = GotoLineDialog.new(self) dlg.SetMaxLineNumber(@m_pTextCtrl.get_number_of_lines) if dlg.show_modal == ID_OK # Convert the linenumber to a position and set self as the new insertion point. #p dlg.GetLineNumber @m_pTextCtrl.set_insertion_point(@m_pTextCtrl.xy_to_position(0, dlg.GetLineNumber - 1)) end dlg.destroy end def onMenuOptionBackgroundColor(event) colourData = ColourData.new colour = @m_pTextCtrl.get_background_colour colourData.set_colour(colour) colourData.set_choose_full(true) dlg = ColourDialog.new(self, colourData) if dlg.show_modal == ID_OK colourData = dlg.get_colour_data @m_pTextCtrl.set_background_colour(colourData.get_colour) @m_pTextCtrl.refresh end dlg.destroy end def onMenuOptionFont(event) fontData = FontData.new font = @m_pTextCtrl.get_font fontData.set_initial_font(font) colour = @m_pTextCtrl.get_foreground_colour fontData.set_colour(colour) fontData.set_show_help(true) dlg = FontDialog.new(self, fontData) if dlg.show_modal == ID_OK fontData = dlg.get_font_data font = fontData.get_chosen_font @m_pTextCtrl.set_font(font) @m_pTextCtrl.set_foreground_colour(fontData.get_colour) @m_pTextCtrl.refresh end dlg.destroy end def onMenuOptionDirectory(event) dlg = DirDialog.new(self, "Select a Working directory", get_cwd()) if dlg.show_modal == ID_OK set_working_directory(dlg.get_path) end dlg.destroy end def onClose(event) destroy = true if event.can_veto if @m_pTextCtrl.is_modified dlg = MessageDialog.new(self, "Text is changed!\nAre you sure you want to exit?", "Text changed!!!", YES_NO | NO_DEFAULT) result = dlg.show_modal if result == ID_NO event.veto destroy = false end end end if destroy destroy() end end end class RbApp < App def on_init frame = TextFrame.new("Simple Text Editor", 100, 100, 400, 300) puts frame set_top_window(frame) frame.show(TRUE) end end a = RbApp.new a.main_loop From wxruby at qualitycode.com Wed Aug 17 22:47:36 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 22:41:28 2005 Subject: [Wxruby-users] wxLayoutContraints.h In-Reply-To: <4303F43F.8080809@mindspring.com> References: <43016F20.8020308@mindspring.com> <4303C1A3.4020403@qualitycode.com> <4303F43F.8080809@mindspring.com> Message-ID: <4303F6C8.6070703@qualitycode.com> Roy Sutton wrote: > Attached is the new file. Easier than diffing. I applied the change manually, since I wanted to fix the formatting at the same time. The earlier code had multiple declarations on a single line, which I strongly dislike. Let me know if what I committed isn't correct. Thanks, Kevin From roys at mindspring.com Wed Aug 17 23:32:47 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 17 23:26:32 2005 Subject: [Wxruby-users] enums Message-ID: <4304015F.4060807@mindspring.com> See the attached patch to typedefs.i. I added the enums included from CalendarCtrl.i. The calendar sample won't work correctly without this patch but I'm wondering if there's a better way, such as moving the declarations into RubyConstants.i instead. Roy -------------- next part -------------- --- typedefs.i 2005-08-17 23:29:55.908801600 -0400 +++ wxruby2/swig/typedefs.i 2005-08-17 23:29:44.161910400 -0400 @@ -10,3 +10,6 @@ //typedef int wxRelationship; enum wxBitmapType; typedef short int WXTYPE; \ No newline at end of file +enum wxCalendarDateBorder; +enum wxCalendarHitTestResult; + From roys at mindspring.com Wed Aug 17 23:39:07 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 17 23:32:51 2005 Subject: [Wxruby-users] Patch for calendar.rb Message-ID: <430402DB.4080501@mindspring.com> This patch fixes the last bug I found in the calendar sample. This makes two (mostly) working samples I've checked out. I did discover a new bug in caret.rb today which I should probably fix. Question: Since sizer.remove is deprecated should we just add an alias to the detach method or should we make people update to the new functions? Roy -------------- next part -------------- --- calendar.rb~ 2004-09-01 13:15:56.000000000 -0400 +++ calendar.rb 2005-08-17 23:34:54.438065600 -0400 @@ -214,8 +214,8 @@ def toggle_cal_style(on,flag) style = @m_calendar.get_window_style_flag date = @m_calendar.date - @sizer.remove(@m_calendar) - @sizer.remove(@m_date) + @sizer.detach(@m_calendar) + @sizer.detach(@m_date) @m_calendar.destroy if on style |= flag From wxruby at qualitycode.com Wed Aug 17 23:49:01 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 17 23:42:58 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4303F5CB.5000408@mindspring.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> Message-ID: <4304052D.90908@qualitycode.com> Roy Sutton wrote: > Attached are two files: Cool. I see the same problem you do. I don't yet understand why swig_up appears to be incorrect in the case of validators. I tested swig_up in general by overriding on_exit in App, and using printfs in App.cpp to watch what happened. wx calls the director's OnExit, which calls ruby's on_exit, which I had invoke super, which went back into OnExit, and called the C++ version. Just like it was supposed to. My best guess (and it's a somewhat wild guess at this point) is that somehow the chain of calls with validators is such that the global swig_up variable is being set somewhere else, and it's affecting the validator code. I'll look at it more later, when I have more time. Until then, all I can tell you is that you're not imagining things, but that it's not a universal problem with the swig_up mechanism. Kevin From roys at mindspring.com Wed Aug 17 23:54:35 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 17 23:48:19 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4304052D.90908@qualitycode.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4304052D.90908@qualitycode.com> Message-ID: <4304067B.2030805@mindspring.com> My current theory after thinking on it some more was that what's happening is that swig_up is turned off to prevent endless loops. So, after a single swig override the swig_up is turned off. So, calls that result in more than one override will fail on the 2nd+ override. What do you think? Roy Kevin Smith wrote: > Roy Sutton wrote: > >> Attached are two files: > > > Cool. I see the same problem you do. > > I don't yet understand why swig_up appears to be incorrect in the case > of validators. I tested swig_up in general by overriding on_exit in > App, and using printfs in App.cpp to watch what happened. wx calls the > director's OnExit, which calls ruby's on_exit, which I had invoke > super, which went back into OnExit, and called the C++ version. Just > like it was supposed to. > > My best guess (and it's a somewhat wild guess at this point) is that > somehow the chain of calls with validators is such that the global > swig_up variable is being set somewhere else, and it's affecting the > validator code. > > I'll look at it more later, when I have more time. Until then, all I > can tell you is that you're not imagining things, but that it's not a > universal problem with the swig_up mechanism. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Thu Aug 18 00:09:45 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 18 00:03:37 2005 Subject: [Wxruby-users] wxLayoutContraints.h In-Reply-To: <4303F6C8.6070703@qualitycode.com> References: <43016F20.8020308@mindspring.com> <4303C1A3.4020403@qualitycode.com> <4303F43F.8080809@mindspring.com> <4303F6C8.6070703@qualitycode.com> Message-ID: <43040A09.7060703@mindspring.com> Looks good to me Kevin Smith wrote: > Roy Sutton wrote: > >> Attached is the new file. Easier than diffing. > > > I applied the change manually, since I wanted to fix the formatting at > the same time. The earlier code had multiple declarations on a single > line, which I strongly dislike. > > Let me know if what I committed isn't correct. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From sean.m.long at gmail.com Thu Aug 18 02:15:21 2005 From: sean.m.long at gmail.com (Sean Long) Date: Thu Aug 18 02:09:01 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: <4303F24A.6020004@qualitycode.com> References: <4303CC89.5040000@qualitycode.com> <4303F24A.6020004@qualitycode.com> Message-ID: Just tested the listbook sample on OS X and it works fine here, I guess I need to get my Linux VM up and running to test against. I did make one small change so the About menu is put in the proper place on OS X, this probably should be done to all the other samples also. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: listbook.rb.patch Type: application/octet-stream Size: 891 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050817/c980d386/listbook.rb.obj From wxruby at qualitycode.com Thu Aug 18 08:46:21 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Thu Aug 18 08:40:22 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4304067B.2030805@mindspring.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4304052D.90908@qualitycode.com> <4304067B.2030805@mindspring.com> Message-ID: <4304831D.5070303@qualitycode.com> Roy Sutton wrote: > My current theory after thinking on it some more was that what's > happening is that swig_up is turned off to prevent endless loops. So, > after a single swig override the swig_up is turned off. So, calls that > result in more than one override will fail on the 2nd+ override. What > do you think? I was thinking something like that, but when swig_up is false, calls get routed to ruby, not C++. We should be seeing too many calls going into ruby and not enough into C++. But in this case, the call is getting routed to C++ when it should go to ruby. My current (untested) theory is similar, however. You could test it with code something like this: C++ ----------- class TestSwigUp { public: virtual void virt1() { nonvirt1(); } void nonvirt1() { virt2(); } virtual void virt2() { printf("C++ virt2\n"); } }; Ruby ------------ class RubyTestSwigUp < TestSwigUp def initialize virt1 end def virt2 puts("ruby virt2") end end I'm thinking that the call to virt1 will go into the director's virt1, which will set swig_up and then call C++ virt1, which will call the non-director wrap_nonvirt1, which will call the C++ nonvirt1, which will call the director's virt2. At that point, swig_up is still set from earlier, so it will call the C++ virt2 instead of the ruby virt2 that we wanted. This corresponds to your real world case where the C++ clone was being called instead of the ruby clone. You could probably test this within wxruby2 by using %extend and adding those three methods to an existing class (such as App). Instead, you might be able to add this class to an existing .i file (but I can imagine some possible problems) or add a new .i file with this class (but I can imagine some other problems). Finally, you could test this entirely outside wxruby2 just as a simple swig sample, which might be best for reporting it to the swig maintainers, if it does turn out to be a problem. If this is a problem, it's hard to imagine a fix. Non-virtual methods can't be hooked by swig, so I can't think of how to detect this condition. But the first step is to figure out whether this is really the problem or not. Then, we can talk with Robin (wxPython), Lyle (FXRuby/swigruby), and other folks about how they have worked around it. Thanks, Kevin From roys at mindspring.com Thu Aug 18 10:45:14 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 18 10:39:02 2005 Subject: [Wxruby-users] Volunteer requested: Implement SplitterWindow In-Reply-To: <4303D177.6050709@qualitycode.com> References: <4303D177.6050709@qualitycode.com> Message-ID: <43049EFA.6000902@mindspring.com> Interesting problem here. The initialize isn't being called for SplitterWindow. It must be bubbling down somewhere else. I'll spend a few minutes looking into this later Roy Kevin Smith wrote: > About a year ago (ouch!), Robert Carlin submitted a ported version of > the wxPython demo/sample. I hoped to include it in wxruby2, but it > relies on SplitterWindow, which isn't in wxruby2 yet. > > I tried to implement SplitterWindow myself, but got such strange > results that I'm thinking I did something wrong. Even though the > generated C++ code specified a variable number of arguments to the > constructor, Ruby would always insist that it needed exactly one > parameter. It called the swig wrapped object allocator, but never > called the swig wrapped constructor. > > Below is my sample app, and the results. I am intentionally not > showing my .i file in case I did something subtly wrong that you might > copy. I did make one correction to the .h file (and checked it in), > but otherwise it looks fine. > > If you plan to spend more than a few minutes on this, please post a > note to the list so you don't duplicate effort. > > Thanks, > > Kevin > > ---- > kevins@aria:~/work/wxruby2$ cat samples/testsplitter.rb > require 'wx' > include Wx > > class MyFrame < Frame > def initialize(title,pos,size,style=DEFAULT_FRAME_STYLE) > super(nil,-1,title,pos,size,style) > > splitter = SplitterWindow.new(self, -1) > end > > end > > class RbApp < App > def on_init > frame = MyFrame.new("Spliter Tester",Point.new(50, 50), > Size.new(450, 340)) > frame.show(TRUE) > end > end > > a = RbApp.new > a.main_loop() > kevins@aria:~/work/wxruby2$ ruby samples/testsplitter.rb > Our Initialize was called > Their Initialize returned 1 > samples/testsplitter.rb:8:in `initialize': wrong # of arguments(2 for > 1) (ArgumentError) > from samples/testsplitter.rb:8:in `new' > from samples/testsplitter.rb:8:in `initialize' > from samples/testsplitter.rb:15:in `new' > from samples/testsplitter.rb:15:in `on_init' > from samples/testsplitter.rb:21:in `main_loop' > from samples/testsplitter.rb:21 > kevins@aria:~/work/wxruby2$ > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Thu Aug 18 18:04:12 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 18 17:58:01 2005 Subject: [Wxruby-users] wxDebug Message-ID: <430505DC.4070506@mindspring.com> For debug builds we define __WXDEBUG__ and WXDEBUG=1. In the swig code we add a check for wxDEBUG to directors. My guess is we mean for one of those defines to be the other. Which one should we change? wxDEBUG-> WXDEBUG or WXDEBUG-> wxDebug? Roy From sean.m.long at gmail.com Thu Aug 18 18:24:28 2005 From: sean.m.long at gmail.com (Sean Long) Date: Thu Aug 18 18:18:06 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: References: <4303CC89.5040000@qualitycode.com> <4303F24A.6020004@qualitycode.com> Message-ID: Regarding sample not working on Linux, I was just looking over the code in the sample and maybe the rename in the XmlResource.i file is not working: %rename(LoadFrameSubclass) wxXmlResource::LoadFrame(wxFrame *frame, wxWindow *parent, const wxString &name); Try just using load_frame, maybe it will work? Sean On 8/17/05, Sean Long wrote: > Just tested the listbook sample on OS X and it works fine here, I > guess I need to get my Linux VM up and running to test against. > > I did make one small change so the About menu is put in the proper > place on OS X, this probably should be done to all the other samples > also. > > Sean > > > From roys at mindspring.com Thu Aug 18 23:18:11 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 18 23:11:56 2005 Subject: [Wxruby-users] Volunteer requested: Implement SplitterWindow In-Reply-To: <4303D177.6050709@qualitycode.com> References: <4303D177.6050709@qualitycode.com> Message-ID: <43054F73.20302@mindspring.com> Kevin, You'll kick yourself when you see it. I should kick myself for spending so long staring at it without figuring it out. Attached is a SplitterWindow.i that should work. Roy Kevin Smith wrote: > About a year ago (ouch!), Robert Carlin submitted a ported version of > the wxPython demo/sample. I hoped to include it in wxruby2, but it > relies on SplitterWindow, which isn't in wxruby2 yet. > > I tried to implement SplitterWindow myself, but got such strange > results that I'm thinking I did something wrong. Even though the > generated C++ code specified a variable number of arguments to the > constructor, Ruby would always insist that it needed exactly one > parameter. It called the swig wrapped object allocator, but never > called the swig wrapped constructor. > > Below is my sample app, and the results. I am intentionally not > showing my .i file in case I did something subtly wrong that you might > copy. I did make one correction to the .h file (and checked it in), > but otherwise it looks fine. > > If you plan to spend more than a few minutes on this, please post a > note to the list so you don't duplicate effort. > > Thanks, > > Kevin > > ---- > kevins@aria:~/work/wxruby2$ cat samples/testsplitter.rb > require 'wx' > include Wx > > class MyFrame < Frame > def initialize(title,pos,size,style=DEFAULT_FRAME_STYLE) > super(nil,-1,title,pos,size,style) > > splitter = SplitterWindow.new(self, -1) > end > > end > > class RbApp < App > def on_init > frame = MyFrame.new("Spliter Tester",Point.new(50, 50), > Size.new(450, 340)) > frame.show(TRUE) > end > end > > a = RbApp.new > a.main_loop() > kevins@aria:~/work/wxruby2$ ruby samples/testsplitter.rb > Our Initialize was called > Their Initialize returned 1 > samples/testsplitter.rb:8:in `initialize': wrong # of arguments(2 for > 1) (ArgumentError) > from samples/testsplitter.rb:8:in `new' > from samples/testsplitter.rb:8:in `initialize' > from samples/testsplitter.rb:15:in `new' > from samples/testsplitter.rb:15:in `on_init' > from samples/testsplitter.rb:21:in `main_loop' > from samples/testsplitter.rb:21 > kevins@aria:~/work/wxruby2$ > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- # Copyright 2004-2005 by Kevin Smith # released under the MIT-style wxruby2 license %include "../common.i" %module(directors="1") wxSplitterWindow %rename(Init) Initialize(wxWindow* window ) ; %{ #include %} %include "include/wxSplitterWindow.h" From roys at mindspring.com Thu Aug 18 23:43:38 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 18 23:37:20 2005 Subject: [Wxruby-users] Volunteer requested: Implement SplitterWindow In-Reply-To: <43054F73.20302@mindspring.com> References: <4303D177.6050709@qualitycode.com> <43054F73.20302@mindspring.com> Message-ID: <4305556A.3080605@mindspring.com> I forgot to note that we'll probably have to document that somewhere. Roy Sutton wrote: > Kevin, > > You'll kick yourself when you see it. I should kick myself for > spending so long staring at it without figuring it out. > > Attached is a SplitterWindow.i that should work. > > Roy > > Kevin Smith wrote: > >> About a year ago (ouch!), Robert Carlin submitted a ported version of >> the wxPython demo/sample. I hoped to include it in wxruby2, but it >> relies on SplitterWindow, which isn't in wxruby2 yet. >> >> I tried to implement SplitterWindow myself, but got such strange >> results that I'm thinking I did something wrong. Even though the >> generated C++ code specified a variable number of arguments to the >> constructor, Ruby would always insist that it needed exactly one >> parameter. It called the swig wrapped object allocator, but never >> called the swig wrapped constructor. >> >> Below is my sample app, and the results. I am intentionally not >> showing my .i file in case I did something subtly wrong that you >> might copy. I did make one correction to the .h file (and checked it >> in), but otherwise it looks fine. >> >> If you plan to spend more than a few minutes on this, please post a >> note to the list so you don't duplicate effort. >> >> Thanks, >> >> Kevin >> >> ---- >> kevins@aria:~/work/wxruby2$ cat samples/testsplitter.rb >> require 'wx' >> include Wx >> >> class MyFrame < Frame >> def initialize(title,pos,size,style=DEFAULT_FRAME_STYLE) >> super(nil,-1,title,pos,size,style) >> >> splitter = SplitterWindow.new(self, -1) >> end >> >> end >> >> class RbApp < App >> def on_init >> frame = MyFrame.new("Spliter Tester",Point.new(50, 50), >> Size.new(450, 340)) >> frame.show(TRUE) >> end >> end >> >> a = RbApp.new >> a.main_loop() >> kevins@aria:~/work/wxruby2$ ruby samples/testsplitter.rb >> Our Initialize was called >> Their Initialize returned 1 >> samples/testsplitter.rb:8:in `initialize': wrong # of arguments(2 for >> 1) (ArgumentError) >> from samples/testsplitter.rb:8:in `new' >> from samples/testsplitter.rb:8:in `initialize' >> from samples/testsplitter.rb:15:in `new' >> from samples/testsplitter.rb:15:in `on_init' >> from samples/testsplitter.rb:21:in `main_loop' >> from samples/testsplitter.rb:21 >> kevins@aria:~/work/wxruby2$ >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> >------------------------------------------------------------------------ > ># Copyright 2004-2005 by Kevin Smith ># released under the MIT-style wxruby2 license > >%include "../common.i" > >%module(directors="1") wxSplitterWindow > >%rename(Init) Initialize(wxWindow* window ) ; > >%{ >#include >%} > >%include "include/wxSplitterWindow.h" > > >------------------------------------------------------------------------ > >_______________________________________________ >wxruby-users mailing list >wxruby-users@rubyforge.org >http://rubyforge.org/mailman/listinfo/wxruby-users > > From wxruby at qualitycode.com Fri Aug 19 00:07:51 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 00:01:44 2005 Subject: [Wxruby-users] Volunteer requested: Implement SplitterWindow In-Reply-To: <4305556A.3080605@mindspring.com> References: <4303D177.6050709@qualitycode.com> <43054F73.20302@mindspring.com> <4305556A.3080605@mindspring.com> Message-ID: <43055B17.2060004@qualitycode.com> Roy Sutton wrote: >> Kevin, >> >> You'll kick yourself when you see it. I should kick myself for >> spending so long staring at it without figuring it out. >> >> Attached is a SplitterWindow.i that should work. Doh! Thank you, thank you, thank you. I'm not sure how long it would have taken me to figure that out. I put in a couple hours on it the other night. What a relief. For those who haven't looked at the .i file, wxSplitterWindow defines a method named 'initialize', which was (of course) conflicting with ruby's constructor name. Roy %rename'd it to 'init' in the .i file, which makes perfect sense. > I forgot to note that we'll probably have to document that somewhere. I put a note near the bottom of README where other quirks are listed. It should be more prominent when we create the wxruby api docs. I have committed SplitterWindow. Thanks! Kevin From wxruby at qualitycode.com Fri Aug 19 00:09:42 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 00:03:34 2005 Subject: [Wxruby-users] wxDebug In-Reply-To: <430505DC.4070506@mindspring.com> References: <430505DC.4070506@mindspring.com> Message-ID: <43055B86.5060409@qualitycode.com> Roy Sutton wrote: > For debug builds we define __WXDEBUG__ and WXDEBUG=1. In the swig code > we add a check for wxDEBUG to directors. My guess is we mean for one of > those defines to be the other. Which one should we change? wxDEBUG-> > WXDEBUG or WXDEBUG-> wxDebug? Looks like __WXDEBUG__ is the official one: kevins@aria:~/work/wxruby2$ wx-config --cflags -I/usr/local/lib/wx/include/gtk2-unicode-debug-2.6 -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 Is there any reason to have WXDEBUG or wxDEBUG or wxDebug? Kevin From wxruby at qualitycode.com Fri Aug 19 00:14:02 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 00:07:53 2005 Subject: [Wxruby-users] Patch for calendar.rb In-Reply-To: <430402DB.4080501@mindspring.com> References: <430402DB.4080501@mindspring.com> Message-ID: <43055C8A.8070603@qualitycode.com> Roy Sutton wrote: > This patch fixes the last bug I found in the calendar sample. Committed. > Question: Since sizer.remove is deprecated should we just add an alias > to the detach method or should we make people update to the new functions? Generally, I don't think we need to support deprecated methods. In this case, the deprecated method actually had slightly different behavior, so we definitely should not support it. Thanks, Kevin From roys at mindspring.com Fri Aug 19 00:14:31 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 00:08:17 2005 Subject: [Wxruby-users] wxDebug In-Reply-To: <43055B86.5060409@qualitycode.com> References: <430505DC.4070506@mindspring.com> <43055B86.5060409@qualitycode.com> Message-ID: <43055CA7.9030205@mindspring.com> I'll submit a patch later for fixdeleting.rb. The other option is to change its wxDEBUG to DIRECTOR_DEBUG or some such. Kevin Smith wrote: > Roy Sutton wrote: > >> For debug builds we define __WXDEBUG__ and WXDEBUG=1. In the swig >> code we add a check for wxDEBUG to directors. My guess is we mean >> for one of those defines to be the other. Which one should we >> change? wxDEBUG-> WXDEBUG or WXDEBUG-> wxDebug? > > > Looks like __WXDEBUG__ is the official one: > > kevins@aria:~/work/wxruby2$ wx-config --cflags > -I/usr/local/lib/wx/include/gtk2-unicode-debug-2.6 > -I/usr/local/include/wx-2.6 -D__WXDEBUG__ -D__WXGTK__ > -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 > > Is there any reason to have WXDEBUG or wxDEBUG or wxDebug? > > Kevin > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Fri Aug 19 00:17:10 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 00:10:55 2005 Subject: [Wxruby-users] Debugging Extension (was Re: Volunteer requested: Implement SplitterWindow) In-Reply-To: <43055B17.2060004@qualitycode.com> References: <4303D177.6050709@qualitycode.com> <43054F73.20302@mindspring.com> <4305556A.3080605@mindspring.com> <43055B17.2060004@qualitycode.com> Message-ID: <43055D46.9040203@mindspring.com> I meant to ask... Does anyone know how to debug an extension using MSVC? I tried attaching to the ruby process and single stepping around but I never ended up anywhere inside the library. It was a waste of a good 45 minutes or so. There must be a way to do it. I suppose I could recompile ruby in debug, too. Kevin Smith wrote: > Roy Sutton wrote: > >>> Kevin, >>> >>> You'll kick yourself when you see it. I should kick myself for >>> spending so long staring at it without figuring it out. >>> >>> Attached is a SplitterWindow.i that should work. >> > > Doh! Thank you, thank you, thank you. I'm not sure how long it would > have taken me to figure that out. I put in a couple hours on it the > other night. What a relief. > > For those who haven't looked at the .i file, wxSplitterWindow defines > a method named 'initialize', which was (of course) conflicting with > ruby's constructor name. Roy %rename'd it to 'init' in the .i file, > which makes perfect sense. > >> I forgot to note that we'll probably have to document that somewhere. > > > I put a note near the bottom of README where other quirks are listed. > It should be more prominent when we create the wxruby api docs. > > I have committed SplitterWindow. > > Thanks! > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Fri Aug 19 00:20:13 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 00:14:00 2005 Subject: [Wxruby-users] Initialize method In-Reply-To: <43055B17.2060004@qualitycode.com> References: <4303D177.6050709@qualitycode.com> <43054F73.20302@mindspring.com> <4305556A.3080605@mindspring.com> <43055B17.2060004@qualitycode.com> Message-ID: <43055DFD.4030302@mindspring.com> Doing a quick grep on the wxWindows source indicates we'll run into Initialize again in other code. It almost seems like Swig Ruby should catch this. Should we take steps in our filters to catch this? It would have been much more insidious if the argument counts had happened to match. Roy Kevin Smith wrote: > Roy Sutton wrote: > >>> Kevin, >>> >>> You'll kick yourself when you see it. I should kick myself for >>> spending so long staring at it without figuring it out. >>> >>> Attached is a SplitterWindow.i that should work. >> > > Doh! Thank you, thank you, thank you. I'm not sure how long it would > have taken me to figure that out. I put in a couple hours on it the > other night. What a relief. > > For those who haven't looked at the .i file, wxSplitterWindow defines > a method named 'initialize', which was (of course) conflicting with > ruby's constructor name. Roy %rename'd it to 'init' in the .i file, > which makes perfect sense. > >> I forgot to note that we'll probably have to document that somewhere. > > > I put a note near the bottom of README where other quirks are listed. > It should be more prominent when we create the wxruby api docs. > > I have committed SplitterWindow. > > Thanks! > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Fri Aug 19 00:44:04 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 00:37:55 2005 Subject: [Wxruby-users] Initialize method In-Reply-To: <43055DFD.4030302@mindspring.com> References: <4303D177.6050709@qualitycode.com> <43054F73.20302@mindspring.com> <4305556A.3080605@mindspring.com> <43055B17.2060004@qualitycode.com> <43055DFD.4030302@mindspring.com> Message-ID: <43056394.6060103@qualitycode.com> Roy Sutton wrote: > Doing a quick grep on the wxWindows source indicates we'll run into > Initialize again in other code. It almost seems like Swig Ruby should > catch this. Should we take steps in our filters to catch this? It > would have been much more insidious if the argument counts had happened > to match. Good thinking! Yeah, we should probably do it in the renamer.rb post-processor. I think the right place would be as an addtional if inside fix_define_method, where if the result was "initialize", convert it to "init". I have added a TODO entry so we don't forget, but feel free to do this at any time if you feel motivated. Thanks, Kevin From wxruby at qualitycode.com Fri Aug 19 00:47:14 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 00:41:03 2005 Subject: [Wxruby-users] wxDebug In-Reply-To: <43055CA7.9030205@mindspring.com> References: <430505DC.4070506@mindspring.com> <43055B86.5060409@qualitycode.com> <43055CA7.9030205@mindspring.com> Message-ID: <43056452.2040809@qualitycode.com> Roy Sutton wrote: > I'll submit a patch later for fixdeleting.rb. The other option is to > change its wxDEBUG to DIRECTOR_DEBUG or some such. Ah, I see the context now. It would probably be better to use something other than __WXDEBUG__, in case someone wants normal wx debugging but not this, or vice versa. DIRECTOR_DEBUG would be fine, or maybe VERBOSE_DIRECTORS. I don't have strong feelings either way. Thanks, Kevin From wxruby at qualitycode.com Fri Aug 19 01:10:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 01:04:21 2005 Subject: [Wxruby-users] enums In-Reply-To: <4304015F.4060807@mindspring.com> References: <4304015F.4060807@mindspring.com> Message-ID: <430569C7.1000409@qualitycode.com> Roy Sutton wrote: > See the attached patch to typedefs.i. I added the enums included from > CalendarCtrl.i. The calendar sample won't work correctly without this > patch but I'm wondering if there's a better way, such as moving the > declarations into RubyConstants.i instead. Hm. It seems that the enum itself has to be declared somewhere that all the .i files will see it, such as typedefs. But the actual enum values must only be visible to a single .i file. Frustrating. I ended up manually applying your patch to typedefs (because it wouldn't apply cleanly for me), AND I also moved the enum values over to RubyConstants.i just because it seems weird to have most of the constants there, but not these. I'm slightly torn about whether to lump all the ruby constants in RubyConstants.i or to put them in the related class .i file (as has been done with CalendarCtrl. Generally I tend toward the latter, but only if they clearly belong in one specific class .i file. I hate globals, and RubyConstants feels slightly like a global. But I also like consistency, and having all constants in RubyConstants is consistent. Anyway, it's committed, and in the calendar sample I can now use the "highlight special dates" menu item, which was failing before. Thanks, Kevin From roys at mindspring.com Fri Aug 19 19:11:55 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 19:05:43 2005 Subject: [Wxruby-users] wxTreeCtrl.h Patch Message-ID: <4306673B.705@mindspring.com> The latest tarball won't compile. Attached is a patch to the wxTreeCtrl.h file that marks generic functions off when compiling on Windows. Let me know if this is how you wanted the problem addressed. Roy -------------- next part -------------- --- wxTreeCtrl.h~ 2005-08-19 00:00:46.000000000 -0400 +++ wxTreeCtrl.h 2005-08-19 19:05:32.512856000 -0400 @@ -61,6 +61,8 @@ */ wxTreeItemId AppendItem(const wxTreeItemId& parent , const wxString& text , int image = -1, int selImage = -1, wxTreeItemData* data = NULL) ; + +#ifndef __WXMSW__ /** * \brief Sets the buttons image list. The button images assigned with this method will be automatically deleted by wxTreeCtrl as appropriate @@ -77,6 +79,8 @@ */ void AssignButtonsImageList(wxImageList* imageList ) ; +#endif + /** * \brief Sets the normal image list. Image list assigned with this method will be automatically deleted by wxTreeCtrl as appropriate @@ -204,6 +208,8 @@ */ bool GetBoundingRect(const wxTreeItemId& item , wxRect& rect , bool textOnly = false) const; + +#ifndef __WXMSW__ /** * \brief Returns the buttons image list (from which application-defined button images are taken). @@ -217,6 +223,7 @@ * \param const wxTreeItemId& * \param bool */ +#endif size_t GetChildrenCount(const wxTreeItemId& item , bool recursively = true) const; /** @@ -513,6 +520,8 @@ */ bool SelectItem(const wxTreeItemId& item ) ; + +#ifndef __WXMSW__ /** * \brief Sets the buttons image list (from which application-defined button images are taken). The button images assigned with this method will @@ -529,6 +538,8 @@ */ void SetButtonsImageList(wxImageList* imageList ) ; +#endif + /** * \brief Sets the indentation for the tree control. * \param int From roys at mindspring.com Fri Aug 19 19:33:36 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 19:27:25 2005 Subject: [Wxruby-users] Listbook patch Message-ID: <43066C50.9010909@mindspring.com> Small patch to correct spelling of lemonade. Should ask Sean if he really wanted it to be lemonaid. If not, here's the patch. On another note... This sample works! Kudos. It is odd that the textbox doesn't scroll. I suppose I may patch that, too. Roy -------------- next part -------------- --- listbook.old 2005-08-17 19:37:52.000000000 -0400 +++ listbook.xrc 2005-08-19 19:30:47.871835200 -0400 @@ -204,7 +204,7 @@ soda tea - lemonaid + lemonade coffee water From roys at mindspring.com Fri Aug 19 20:01:42 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 19:55:28 2005 Subject: [Wxruby-users] Patch for listbook.rb Message-ID: <430672E6.6060302@mindspring.com> Attached is a patch file for listbook.rb 1) Message box scrolls properly now 2) Blank lines are skipped when adding pizzas and ice cream -------------- next part -------------- --- listbook.rb.old 2005-08-17 19:37:52.000000000 -0400 +++ listbook.rb 2005-08-19 19:56:25.663070400 -0400 @@ -64,15 +64,15 @@ evt_button(Wx::xrcid('ID_PIZZA_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n" - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid('ID_DRINK_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.set_value(order_string) + @text_output.append_text(order_string) end # Variables for widgets in Ice Cream tab @@ -111,19 +111,18 @@ evt_button(Wx::xrcid('ID_ICE_CREAM_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end evt_listbook_page_changed(Wx::xrcid('ID_LISTBOOK')) do |event| tab_number = event.get_selection - order_string = @text_output.get_value - order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n" - @text_output.set_value(order_string) + order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.append_text(order_string) end end From sean.m.long at gmail.com Fri Aug 19 20:05:04 2005 From: sean.m.long at gmail.com (Sean Long) Date: Fri Aug 19 19:58:40 2005 Subject: [Wxruby-users] Listbook patch In-Reply-To: <43066C50.9010909@mindspring.com> References: <43066C50.9010909@mindspring.com> Message-ID: Spelling never was my strong suit, I thought I checked the spelling on everything. Oh well. :) Sean On 8/19/05, Roy Sutton wrote: > Small patch to correct spelling of lemonade. Should ask Sean if he > really wanted it to be lemonaid. If not, here's the patch. > > On another note... This sample works! Kudos. It is odd that the > textbox doesn't scroll. I suppose I may patch that, too. > > Roy > > > --- listbook.old 2005-08-17 19:37:52.000000000 -0400 > +++ listbook.xrc 2005-08-19 19:30:47.871835200 -0400 > @@ -204,7 +204,7 @@ > > soda > tea > - lemonaid > + lemonade > coffee > water > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Fri Aug 19 20:56:10 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 20:50:11 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: References: <4303CC89.5040000@qualitycode.com> <4303F24A.6020004@qualitycode.com> Message-ID: <43067FAA.1020901@qualitycode.com> Sean Long wrote: > I did make one small change so the About menu is put in the proper > place on OS X, Committed, thanks. > Regarding sample not working on Linux, > > I was just looking over the code in the sample and maybe the rename in > the XmlResource.i file is not working: > > %rename(LoadFrameSubclass) wxXmlResource::LoadFrame(wxFrame *frame, > wxWindow *parent, const wxString &name); > > Try just using load_frame, maybe it will work? The %rename certainly appears to be working, based on a glance at src/XmlResource.cpp. I tried deleting everything in the Frame constructor after the menu events, and the entire window was still blank. When I commented out the load_frame_subclass call, the menubar appeared and worked. Perhaps you need to embed a Window inside the Frame, and load the xrc resources into that child window? It looks like xrc files contain menubars, so maybe the lack of a menu bar in the xrc file is causing problems? I'm just guessing...I know almost nothing about xrc. Kevin From wxruby at qualitycode.com Fri Aug 19 21:00:18 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 20:54:13 2005 Subject: [Wxruby-users] Listbook patch In-Reply-To: <43066C50.9010909@mindspring.com> References: <43066C50.9010909@mindspring.com> Message-ID: <430680A2.50301@qualitycode.com> Roy Sutton wrote: > Small patch to correct spelling of lemonade. Should ask Sean if he > really wanted it to be lemonaid. If not, here's the patch. Committed. If possible, I would prefer if you could generate your diffs from the directory above the wxruby root, so that I can apply them with patch -p1. Personally I think -p0 makes more sense, but for some reason -p1 is more standard, and I have already encountered one patching tool that only supports -p1. Thanks, Kevin From wxruby at qualitycode.com Fri Aug 19 21:05:12 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 20:59:07 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <430672E6.6060302@mindspring.com> References: <430672E6.6060302@mindspring.com> Message-ID: <430681C8.2080901@qualitycode.com> Roy Sutton wrote: > Attached is a patch file for listbook.rb > > 1) Message box scrolls properly now > 2) Blank lines are skipped when adding pizzas and ice cream This one didn't apply cleanly. The lines appeared to be off by 3 or so, at least for the first change. Please re-diff against the head and resubmit. Thanks, Kevin From wxruby at qualitycode.com Fri Aug 19 21:08:19 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 21:02:14 2005 Subject: [Wxruby-users] wxTreeCtrl.h Patch In-Reply-To: <4306673B.705@mindspring.com> References: <4306673B.705@mindspring.com> Message-ID: <43068283.3030402@qualitycode.com> Roy Sutton wrote: > The latest tarball won't compile. Oops. > Attached is a patch to the > wxTreeCtrl.h file that marks generic functions off when compiling on > Windows. Let me know if this is how you wanted the problem addressed. Looks good to me. Dang, I wish the upstream wx guys would do a better job of keeping the API the same between platforms. Thanks, Kevin From wxruby at qualitycode.com Fri Aug 19 21:41:48 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 21:35:43 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4304831D.5070303@qualitycode.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4304052D.90908@qualitycode.com> <4304067B.2030805@mindspring.com> <4304831D.5070303@qualitycode.com> Message-ID: <43068A5C.9060303@qualitycode.com> Kevin Smith wrote: > I'm thinking that the call to virt1 will go into the director's virt1, > which will set swig_up and then call C++ virt1, which will call the > non-director wrap_nonvirt1, which will call the C++ nonvirt1, which will > call the director's virt2. > > At that point, swig_up is still set from earlier, so it will call the > C++ virt2 instead of the ruby virt2 that we wanted. This corresponds to > your real world case where the C++ clone was being called instead of the > ruby clone. I just tested this, and my theory was wrong. The ruby version of virt2 was called, as one would hope. Turns out swig_up is only turned on very briefly. That is, when a wrap_ method is called (which can only happen from Ruby), the flag is set, and the call is forwarded to the director's implementation of that method. The director checks the flag (which clears it), and because it is set it routes the call to the director's superclass, which is the original wrapped C++ code. The only way swig_up will get set again is if ruby code calls another wrapped director method. In short, all the logic looks right in my little sample. I'm tempted to check it in as part of the project, just to have a test platform for further research. Currently it consists of wxBogus.h, Bogus.i, and testobgus.rb. I'm SOOO happy that just adding a .h/.i brings a whole new class into wxruby2, without having to modify any other files! Should I check it in? Kevin From roys at mindspring.com Fri Aug 19 22:48:31 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 22:42:14 2005 Subject: [Wxruby-users] Listbook patch In-Reply-To: <430680A2.50301@qualitycode.com> References: <43066C50.9010909@mindspring.com> <430680A2.50301@qualitycode.com> Message-ID: <430699FF.6000401@mindspring.com> I wish I understood what you meant by this. :) Could you give me an example or point me to documentation on this? Kevin Smith wrote: > Roy Sutton wrote: > >> Small patch to correct spelling of lemonade. Should ask Sean if he >> really wanted it to be lemonaid. If not, here's the patch. > > > Committed. > > If possible, I would prefer if you could generate your diffs from the > directory above the wxruby root, so that I can apply them with patch > -p1. Personally I think -p0 makes more sense, but for some reason -p1 > is more standard, and I have already encountered one patching tool > that only supports -p1. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Fri Aug 19 23:19:38 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 23:13:20 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <430681C8.2080901@qualitycode.com> References: <430672E6.6060302@mindspring.com> <430681C8.2080901@qualitycode.com> Message-ID: <4306A14A.4030200@mindspring.com> Odd. I diffed it against the head version... At least, I thought I did. I will retry it after researching the whole p0/p1 thing. OK, I've researched it. And the whole -p thing is kinda weird. Way too manual for me. I can see why you want it set correctly. I will, from now on, try to create a mirror structure so I can create proper patch files. Here's the patch file, all cleaned up. I have finally decided to bag WinCVS since I never did figure out how to work it correctly and am just using the command line CVS tools. Now I can create diff files from the repository. Tell me if you like this better. Roy Kevin Smith wrote: > Roy Sutton wrote: > >> Attached is a patch file for listbook.rb >> >> 1) Message box scrolls properly now >> 2) Blank lines are skipped when adding pizzas and ice cream > > > This one didn't apply cleanly. The lines appeared to be off by 3 or > so, at least for the first change. Please re-diff against the head and > resubmit. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- Index: wxruby2/samples/listbook/listbook.rb =================================================================== RCS file: /var/cvs/wxruby/wxruby2/samples/listbook/listbook.rb,v retrieving revision 1.2 diff -b -u -r1.2 listbook.rb --- wxruby2/samples/listbook/listbook.rb 20 Aug 2005 00:35:00 -0000 1.2 +++ wxruby2/samples/listbook/listbook.rb 19 Aug 2005 23:56:25 -0000 @@ -64,15 +64,15 @@ evt_button(Wx::xrcid('ID_PIZZA_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value- if order_string != "" then order_string << "\n" end+ if order_string != "" then order_string = "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n"- @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" }+ @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string)+ @text_output.append_text(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid('ID_DRINK_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value- if order_string != "" then order_string << "\n" end+ if order_string != "" then order_string = "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.set_value(order_string)+ @text_output.append_text(order_string) end # Variables for widgets in Ice Cream tab@@ -111,19 +111,18 @@ evt_button(Wx::xrcid('ID_ICE_CREAM_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value- if order_string != "" then order_string << "\n" end+ if order_string != "" then order_string = "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" }+ @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string)+ @text_output.append_text(order_string) end evt_listbook_page_changed(Wx::xrcid('ID_LISTBOOK')) do |event| tab_number = event.get_selection- order_string = @text_output.get_value- order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n"- @text_output.set_value(order_string)+ order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.append_text(order_string) end end From wxruby at qualitycode.com Fri Aug 19 23:20:05 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 23:14:05 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4303F5CB.5000408@mindspring.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> Message-ID: <4306A165.4080307@qualitycode.com> Roy Sutton wrote: > Try running test21.rb. Open the Edit->'Goto Line' dialog box. > > You -should- see 'Validator.Clone was called' followed by > 'Validator.Copy was called' in the console. But you won't if it behaves > like it does on mine. You can go into Validator.cpp and add a printf > into the Clone wrapper and you'll see swig_up is false. I spent more time with this, and I now suspect the problem might have something to do with copy constructors. The first thing I did was to heavily edit test21.rb down to be a smaller app. Any clutter (such as the sizers that weren't working) could affect the results. I would recommend creating a trivial app that just creates a single control and tries to attach to it a very minimal validator. I also removed the %ignore of Window#get_validator, and checked that in. The docs say that any Validator subclass *must* implement a copy constructor. In C++, if you don't define one, one will be defined for you...and it almost never does what you want, because it's a straight bit-copy. Validator.h does not define a copy constructor. However, based on more digging, my earlier theory is looking better again. We are calling Window#set_validator, which sets swig_up, and calls the C++ version, which calls Validator::Clone, but swig_up is still set, so it goes to the C++ version instead of to the Ruby version. I thought that's what I was testing in my Bogus sample, but it must be slightly different somehow. The next step might be to implement a copy constructor. To do that, I think we'll need to define a subclass in Validator.i, which will end up similar to (but simpler than) App.i. The docs mention that wxPython has a wxPyValidator class, and they recommend that you subclass that to get cool python features. That might also be part of their solution for the copy constructor problem. Another thing that would help this case, but probably not globally, would be to make swig_up static, instead of global. I think it was static in swig 1.3.22. Kevin From roys at mindspring.com Fri Aug 19 23:20:52 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 23:14:32 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <43068A5C.9060303@qualitycode.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4304052D.90908@qualitycode.com> <4304067B.2030805@mindspring.com> <4304831D.5070303@qualitycode.com> <43068A5C.9060303@qualitycode.com> Message-ID: <4306A194.5020105@mindspring.com> Well, I'm almost disappointed it works correctly. :) I suppose I'll have to look into it some more. As to whether this should be in the repository or not... I suppose I'd be happier if we could make a test case that craps out so that we can have a unit test that ensure it stays fixed. That being said, if you'd like to forward those files to the list I'll plug 'em in here and try 'em out. Roy Kevin Smith wrote: > Kevin Smith wrote: > >> I'm thinking that the call to virt1 will go into the director's >> virt1, which will set swig_up and then call C++ virt1, which will >> call the non-director wrap_nonvirt1, which will call the C++ >> nonvirt1, which will call the director's virt2. >> >> At that point, swig_up is still set from earlier, so it will call the >> C++ virt2 instead of the ruby virt2 that we wanted. This corresponds >> to your real world case where the C++ clone was being called instead >> of the ruby clone. > > > I just tested this, and my theory was wrong. The ruby version of virt2 > was called, as one would hope. > > Turns out swig_up is only turned on very briefly. That is, when a > wrap_ method is called (which can only happen from Ruby), the flag is > set, and the call is forwarded to the director's implementation of > that method. The director checks the flag (which clears it), and > because it is set it routes the call to the director's superclass, > which is the original wrapped C++ code. The only way swig_up will get > set again is if ruby code calls another wrapped director method. > > In short, all the logic looks right in my little sample. I'm tempted > to check it in as part of the project, just to have a test platform > for further research. Currently it consists of wxBogus.h, Bogus.i, and > testobgus.rb. I'm SOOO happy that just adding a .h/.i brings a whole > new class into wxruby2, without having to modify any other files! > > Should I check it in? > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Fri Aug 19 23:22:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Fri Aug 19 23:16:28 2005 Subject: [Wxruby-users] Listbook patch In-Reply-To: <430699FF.6000401@mindspring.com> References: <43066C50.9010909@mindspring.com> <430680A2.50301@qualitycode.com> <430699FF.6000401@mindspring.com> Message-ID: <4306A1F7.4090302@qualitycode.com> I *think* it just depends on what directory you are in when you run the diff command. If you're in the directory with the files (e.g. samples/listbook) then it will just put filenames in the .patch file. But if you're above wxruby2, and say something like: [blahblah]diff wxruby2/samples/listbook [blahblah] then it will embed that relative path into the .patch file. I have hardly created any diffs, so that's about all I can say without doing some reading. Perhaps Sean can explain how he generates his patches. Kevin Roy Sutton wrote: > I wish I understood what you meant by this. :) Could you give me an > example or point me to documentation on this? > > Kevin Smith wrote: > >> Roy Sutton wrote: >> >>> Small patch to correct spelling of lemonade. Should ask Sean if he >>> really wanted it to be lemonaid. If not, here's the patch. >> >> >> >> Committed. >> >> If possible, I would prefer if you could generate your diffs from the >> directory above the wxruby root, so that I can apply them with patch >> -p1. Personally I think -p0 makes more sense, but for some reason -p1 >> is more standard, and I have already encountered one patching tool >> that only supports -p1. >> >> Thanks, >> >> Kevin >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From sean.m.long at gmail.com Fri Aug 19 23:35:17 2005 From: sean.m.long at gmail.com (Sean Long) Date: Fri Aug 19 23:28:53 2005 Subject: [Wxruby-users] Listbook patch In-Reply-To: <4306A1F7.4090302@qualitycode.com> References: <43066C50.9010909@mindspring.com> <430680A2.50301@qualitycode.com> <430699FF.6000401@mindspring.com> <4306A1F7.4090302@qualitycode.com> Message-ID: It is the current directory that determines if it is -p0 or -p1. Here are my notes I use when I generate patches: #first login to cvs server cvs -d :pserver:anonymous@rubyforge.org:/var/cvs/wxruby login #for convienence set your CVSROOT #Unix export CVSROOT=:pserver:anonymous@rubyforge.org:/var/cvs/wxruby #Windows set CVSROOT=:pserver:anonymous@rubyforge.org:/var/cvs/wxruby #to create a patch go into directory above the wxruby2 root directory and type cvs diff -r HEAD -b -u wxruby2/swig/common.i > diff.patch #send the patch the Kevin or another project maintainer # they will then go to directory above wxruby2/ and type: patch -p1 < diff.patch Sean On 8/19/05, Kevin Smith wrote: > I *think* it just depends on what directory you are in when you run the > diff command. If you're in the directory with the files (e.g. > samples/listbook) then it will just put filenames in the .patch file. > But if you're above wxruby2, and say something like: > [blahblah]diff wxruby2/samples/listbook [blahblah] > then it will embed that relative path into the .patch file. > > I have hardly created any diffs, so that's about all I can say without > doing some reading. Perhaps Sean can explain how he generates his patches. > > Kevin > > > Roy Sutton wrote: > > I wish I understood what you meant by this. :) Could you give me an > > example or point me to documentation on this? > > > > Kevin Smith wrote: > > > >> Roy Sutton wrote: > >> > >>> Small patch to correct spelling of lemonade. Should ask Sean if he > >>> really wanted it to be lemonaid. If not, here's the patch. > >> > >> > >> > >> Committed. > >> > >> If possible, I would prefer if you could generate your diffs from the > >> directory above the wxruby root, so that I can apply them with patch > >> -p1. Personally I think -p0 makes more sense, but for some reason -p1 > >> is more standard, and I have already encountered one patching tool > >> that only supports -p1. > >> > >> Thanks, > >> > >> Kevin > >> _______________________________________________ > >> wxruby-users mailing list > >> wxruby-users@rubyforge.org > >> http://rubyforge.org/mailman/listinfo/wxruby-users > >> > >> > >> > > > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From roys at mindspring.com Fri Aug 19 23:42:19 2005 From: roys at mindspring.com (Roy Sutton) Date: Fri Aug 19 23:35:59 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4306A165.4080307@qualitycode.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4306A165.4080307@qualitycode.com> Message-ID: <4306A69B.5070605@mindspring.com> I took at look at the Python implementation of wxPyValidator. They must have lots of fancy swig support because there was a lot of swig stuff I haven't seen before. Either that or they have some macros they use embedded somewhere. I didn't go chase it down. It would be pretty trivial to make a class that derives from Validator. I'm just not sure yet if it's the way to go. I'd like to investigate it some more. Kevin Smith wrote: > Roy Sutton wrote: > >> Try running test21.rb. Open the Edit->'Goto Line' dialog box. >> >> You -should- see 'Validator.Clone was called' followed by >> 'Validator.Copy was called' in the console. But you won't if it >> behaves like it does on mine. You can go into Validator.cpp and add >> a printf into the Clone wrapper and you'll see swig_up is false. > > > > I spent more time with this, and I now suspect the problem might have > something to do with copy constructors. The first thing I did was to > heavily edit test21.rb down to be a smaller app. Any clutter (such as > the sizers that weren't working) could affect the results. I would > recommend creating a trivial app that just creates a single control > and tries to attach to it a very minimal validator. > > I also removed the %ignore of Window#get_validator, and checked that in. > > The docs say that any Validator subclass *must* implement a copy > constructor. In C++, if you don't define one, one will be defined for > you...and it almost never does what you want, because it's a straight > bit-copy. Validator.h does not define a copy constructor. > > However, based on more digging, my earlier theory is looking better > again. We are calling Window#set_validator, which sets swig_up, and > calls the C++ version, which calls Validator::Clone, but swig_up is > still set, so it goes to the C++ version instead of to the Ruby > version. I thought that's what I was testing in my Bogus sample, but > it must be slightly different somehow. > > The next step might be to implement a copy constructor. To do that, I > think we'll need to define a subclass in Validator.i, which will end > up similar to (but simpler than) App.i. > > The docs mention that wxPython has a wxPyValidator class, and they > recommend that you subclass that to get cool python features. That > might also be part of their solution for the copy constructor problem. > > Another thing that would help this case, but probably not globally, > would be to make swig_up static, instead of global. I think it was > static in swig 1.3.22. > > Kevin From sean.m.long at gmail.com Fri Aug 19 23:42:24 2005 From: sean.m.long at gmail.com (Sean Long) Date: Fri Aug 19 23:36:01 2005 Subject: [Wxruby-users] Re: Patch and files to add Listbook In-Reply-To: <43067FAA.1020901@qualitycode.com> References: <4303CC89.5040000@qualitycode.com> <4303F24A.6020004@qualitycode.com> <43067FAA.1020901@qualitycode.com> Message-ID: > I tried deleting everything in the Frame constructor after the menu > events, and the entire window was still blank. When I commented out the > load_frame_subclass call, the menubar appeared and worked. The menu code is in the *.rb file not in the XRC file so it probably is a XRC problem. > Perhaps you need to embed a Window inside the Frame, and load the xrc > resources into that child window? It looks like xrc files contain > menubars, so maybe the lack of a menu bar in the xrc file is causing > problems? I'm just guessing...I know almost nothing about xrc. The menu bar in the XRC actually is a new feature that did not exist in wx2.4.2 and it is optional (the new XRC features in 2.6.x are actually what got me working on wxruby2 in the first place and also the wxCheckListBox). I have played around with using the XRC menubar feature but found it not as slick when trying to get the menus to show up in the right spot on Mac OS X. I will need to play with it more, strange that it works on OS X and Windows, maybe GTK is a bit more strict. Sean From sean.m.long at gmail.com Sat Aug 20 03:54:45 2005 From: sean.m.long at gmail.com (Sean Long) Date: Sat Aug 20 03:48:22 2005 Subject: [Wxruby-users] patches for wxGridCell*Renderer and wxGridCell*Editor Message-ID: I added a bunch of *.i files to get the cell renderers and editors working for wxGrid. I still have a problem when switching cells in the grid but I think that is a problem with wxGrid, will look into it. In the process I found a bug in a typemap for wxArrayString & that I am surprised we did not find earlier. ($input = Qnil) should be ($input == Qnil), big difference. Also added a type check for wxArrayString. Should be 8 patches attached and 1 zip with new files. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: grid_cell_bool_renderer.patch Type: application/octet-stream Size: 1207 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/grid_cell_bool_renderer-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: grid_cell_choice_editor.patch Type: application/octet-stream Size: 1970 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/grid_cell_choice_editor-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: grid_cell_float_editor.patch Type: application/octet-stream Size: 1386 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/grid_cell_float_editor-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: grid_cell_number_renderer.patch Type: application/octet-stream Size: 709 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/grid_cell_number_renderer-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: grid_cell_renderer.patch Type: application/octet-stream Size: 2752 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/grid_cell_renderer-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: grid_cell_text_editor.patch Type: application/octet-stream Size: 1698 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/grid_cell_text_editor-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: parents_rb.patch Type: application/octet-stream Size: 860 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/parents_rb-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: typemap.patch Type: application/octet-stream Size: 750 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/typemap-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: new_files.zip Type: application/zip Size: 8779 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050820/894a6c8f/new_files-0001.zip From wxruby at qualitycode.com Sat Aug 20 09:36:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 20 09:30:47 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4306A165.4080307@qualitycode.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4306A165.4080307@qualitycode.com> Message-ID: <430731DF.7000603@qualitycode.com> Kevin Smith wrote: > However, based on more digging, my earlier theory is looking better > again. We are calling Window#set_validator, which sets swig_up, and > calls the C++ version, which calls Validator::Clone, but swig_up is > still set, so it goes to the C++ version instead of to the Ruby version. > I thought that's what I was testing in my Bogus sample, but it must be > slightly different somehow. Aha! I believe I have found the problem. The ruby code calls _wrap_wxWindow_SetValidator, which sets swig_up and then invokes the C++ SetValidator. BUT the actual object is a wxTextCtrl, not a wxWindow. So we bypass SwigDirector_wxWindow::SetValidator, which would have cleared swig_up. Instead we directly invoke wxTextCtrl::SetValidator, which falls back to wxWindow::SetValidator. That invokes Clone on our Validator object, which goes into SwigDirector_wxValidator::Clone, which sees that swig_up is still set, and calls the C++ clone instead of the ruby clone. The real problem is that a director method wasn't created for wxTextCtrl::SetValidator. That's a derived class and a virtual method, so according to the swig python docs[1], it should have gotten a director. I can think of a few possible reasons why we might not be getting these directors: 1. We put each class in a separate swig module, so swig isn't following the inheritance chain up to look for virtual methods. 2. We are missing a %feature or other swig directive. Our common.i asks for global directors, so this seems less likely. 3. Director support in ruby is not as full as in python. The docs imply that this is not the case, and that ruby has full director features[2]. Kevin [1] http://www.swig.org/Doc1.3/Python.html#Python_nn33 [2] http://www.swig.org/Doc1.3/Ruby.html#Ruby_nn25 From roys at mindspring.com Sat Aug 20 10:19:01 2005 From: roys at mindspring.com (Roy Sutton) Date: Sat Aug 20 10:12:44 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <430731DF.7000603@qualitycode.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4306A165.4080307@qualitycode.com> <430731DF.7000603@qualitycode.com> Message-ID: <43073BD5.5090105@mindspring.com> Kevin, This is what I discovered last night as well. This happens all over the place as you can imagine. We are not generating any wrappers for virtual functions not defined in the subclasses. swig has an option to go through all the header files included... Do we need to do this? Here is some output from my test version of wxRuby2: swig_up=false in src/App.cpp:1309 setting up in src/Frame.cpp:2177 swig_up=true in src/Frame.cpp:1192 swig_up=false in src/Frame.cpp:1171 setting up in src/Frame.cpp:2697 swig_up=true in src/Frame.cpp:1171 setting up in src/Frame.cpp:2853 swig_up=true in src/Frame.cpp:1248 setting up in src/Window.cpp:6966 <-- Swig up not cleared in subclass setting up in src/StaticText.cpp:1913 swig_up=true in src/StaticText.cpp:1148 setting up in src/Window.cpp:6593 <-- Swig up not cleared in subclass swig_up=true in src/Validator.cpp:1156 setting up in src/Window.cpp:7080 setting up in src/Window.cpp:5366 <-- Swig up not cleared in subclass setting up in src/Window.cpp:3145 <-- Swig up not cleared in subclass swig_up=true in src/App.cpp:1283 setting up in src/Window.cpp:3145 <-- Swig up not cleared in subclass swig_up=true in src/App.cpp:1283 swig_up=false in src/App.cpp:1296 setting up in src/App.cpp:1645 swig_up=true in src/App.cpp:1296 Kevin Smith wrote: > Kevin Smith wrote: > >> However, based on more digging, my earlier theory is looking better >> again. We are calling Window#set_validator, which sets swig_up, and >> calls the C++ version, which calls Validator::Clone, but swig_up is >> still set, so it goes to the C++ version instead of to the Ruby >> version. I thought that's what I was testing in my Bogus sample, but >> it must be slightly different somehow. > > > Aha! I believe I have found the problem. The ruby code calls > _wrap_wxWindow_SetValidator, which sets swig_up and then invokes the > C++ SetValidator. BUT the actual object is a wxTextCtrl, not a > wxWindow. So we bypass SwigDirector_wxWindow::SetValidator, which > would have cleared swig_up. Instead we directly invoke > wxTextCtrl::SetValidator, which falls back to wxWindow::SetValidator. > That invokes Clone on our Validator object, which goes into > SwigDirector_wxValidator::Clone, which sees that swig_up is still set, > and calls the C++ clone instead of the ruby clone. > > The real problem is that a director method wasn't created for > wxTextCtrl::SetValidator. That's a derived class and a virtual method, > so according to the swig python docs[1], it should have gotten a > director. I can think of a few possible reasons why we might not be > getting these directors: > > 1. We put each class in a separate swig module, so swig isn't > following the inheritance chain up to look for virtual methods. > > 2. We are missing a %feature or other swig directive. Our common.i > asks for global directors, so this seems less likely. > > 3. Director support in ruby is not as full as in python. The docs > imply that this is not the case, and that ruby has full director > features[2]. > > Kevin > > > [1] http://www.swig.org/Doc1.3/Python.html#Python_nn33 > [2] http://www.swig.org/Doc1.3/Ruby.html#Ruby_nn25 > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Sat Aug 20 13:23:23 2005 From: roys at mindspring.com (Roy Sutton) Date: Sat Aug 20 13:17:06 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <43073BD5.5090105@mindspring.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4306A165.4080307@qualitycode.com> <430731DF.7000603@qualitycode.com> <43073BD5.5090105@mindspring.com> Message-ID: <4307670B.80807@mindspring.com> I checked out the -includeall option. This just won't work for us. The bottom line appears to be there is no good method short of pre-processing the included files to extract all virtual functions and create stubs that just call the inherited base class. Of course, if there's a way to specify the -includeall -and- specify that it shouldn't wrap anything except a specified object or the base include file... Roy Roy Sutton wrote: > This is what I discovered last night as well. This happens all over > the place as you can imagine. We are not generating any wrappers for > virtual functions not defined in the subclasses. swig has an option > to go through all the header files included... Do we need to do this? From wxruby at qualitycode.com Sat Aug 20 19:59:05 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 20 19:53:13 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <43073BD5.5090105@mindspring.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4306A165.4080307@qualitycode.com> <430731DF.7000603@qualitycode.com> <43073BD5.5090105@mindspring.com> Message-ID: <4307C3C9.2030206@qualitycode.com> Roy Sutton wrote: > Kevin, > > This is what I discovered last night as well. This happens all over the > place as you can imagine. We are not generating any wrappers for > virtual functions not defined in the subclasses. Yup. I just checked in the tiny start of a fix for this. I added %import statements in TextCtrl.i and Control.i so that swig knows all about all the parent classes. That allows it to create all the Director methods for any virtual methods that were defined up the inheritance chain. You can confirm this by looking at src/TextCtrl.h after re-swigging. I was also able to get much farther into your test21.rb sample, with results that also seemed to confirm that this solves that problem. We will need to add %imports for *all* the classes. Some of the %imports will fail, and hopefully most if not all of them can be fixed by moving the conditional logic from the .i files to the .h files, as I just did with Window. I'm going to apply the patches in my queue (one from you and one from Sean, it looks like), and then I'll tag 0.0.25. After that, I'll start adding %imports like crazy, until all the classes are covered. If anyone wants to volunteer to help with this, let me know and we can split the classes up into different sections and work without colliding. At least there is a solution, and it's not terribly painful. Kevin From wxruby at qualitycode.com Sat Aug 20 20:04:45 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 20 19:58:50 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <4306A14A.4030200@mindspring.com> References: <430672E6.6060302@mindspring.com> <430681C8.2080901@qualitycode.com> <4306A14A.4030200@mindspring.com> Message-ID: <4307C51D.1000700@qualitycode.com> Roy Sutton wrote: > Here's the patch file, all cleaned up. Hm.... kevins@aria:~/work/wxruby2$ patch -p1 References: <43066C50.9010909@mindspring.com> <430680A2.50301@qualitycode.com> <430699FF.6000401@mindspring.com> <4306A1F7.4090302@qualitycode.com> Message-ID: <4307C581.2020006@qualitycode.com> Sean Long wrote: > It is the current directory that determines if it is -p0 or -p1. > > Here are my notes I use when I generate patches: Thanks! > #first login to cvs server > cvs -d :pserver:anonymous@rubyforge.org:/var/cvs/wxruby login > > #for convienence set your CVSROOT > #Unix > export CVSROOT=:pserver:anonymous@rubyforge.org:/var/cvs/wxruby > > #Windows > set CVSROOT=:pserver:anonymous@rubyforge.org:/var/cvs/wxruby > > #to create a patch go into directory above the wxruby2 root directory and type > cvs diff -r HEAD -b -u wxruby2/swig/common.i > diff.patch > > #send the patch the Kevin or another project maintainer > # they will then go to directory above wxruby2/ and type: > patch -p1 < diff.patch Actually, if I were in the directory above wxruby2, I would use -p0, indicating a zero delta between my current level and the level where the diff was performed. Typically I'm in the wxruby2 directory, using -p1. Kevin From wxruby at qualitycode.com Sat Aug 20 20:28:41 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 20 20:22:48 2005 Subject: [Wxruby-users] patches for wxGridCell*Renderer and wxGridCell*Editor In-Reply-To: References: Message-ID: <4307CAB9.3080003@qualitycode.com> Sean Long wrote: > I added a bunch of *.i files to get the cell renderers and editors > working for wxGrid. Looks great. Committed. Thanks! Kevin From roys at mindspring.com Sat Aug 20 20:41:14 2005 From: roys at mindspring.com (Roy Sutton) Date: Sat Aug 20 20:34:57 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <4307C51D.1000700@qualitycode.com> References: <430672E6.6060302@mindspring.com> <430681C8.2080901@qualitycode.com> <4306A14A.4030200@mindspring.com> <4307C51D.1000700@qualitycode.com> Message-ID: <4307CDAA.1090403@mindspring.com> Try this one. I need to figure out how to get cvs to check out with DOS newlines. Kevin Smith wrote: > Roy Sutton wrote: > >> Here's the patch file, all cleaned up. > > > Hm.... > > kevins@aria:~/work/wxruby2$ patch -p1 > patching file samples/listbook/listbook.rb > patch unexpectedly ends in middle of line > patch: **** malformed patch at line 20: > > > Glancing at the patch, it looks like all the newlines got stripped out > somehow. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- Index: wxruby2/samples/listbook/listbook.rb =================================================================== RCS file: /var/cvs/wxruby/wxruby2/samples/listbook/listbook.rb,v retrieving revision 1.2 diff -u -b -r1.2 listbook.rb --- wxruby2/samples/listbook/listbook.rb 20 Aug 2005 00:35:00 -0000 1.2 +++ wxruby2/samples/listbook/listbook.rb 21 Aug 2005 00:39:35 -0000 @@ -64,15 +64,15 @@ evt_button(Wx::xrcid('ID_PIZZA_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n" - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid('ID_DRINK_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.set_value(order_string) + @text_output.append_text(order_string) end # Variables for widgets in Ice Cream tab @@ -111,19 +111,18 @@ evt_button(Wx::xrcid('ID_ICE_CREAM_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end evt_listbook_page_changed(Wx::xrcid('ID_LISTBOOK')) do |event| tab_number = event.get_selection - order_string = @text_output.get_value - order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n" - @text_output.set_value(order_string) + order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.append_text(order_string) end end From wxruby at qualitycode.com Sat Aug 20 20:46:43 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 20 20:40:47 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <4307CDAA.1090403@mindspring.com> References: <430672E6.6060302@mindspring.com> <430681C8.2080901@qualitycode.com> <4306A14A.4030200@mindspring.com> <4307C51D.1000700@qualitycode.com> <4307CDAA.1090403@mindspring.com> Message-ID: <4307CEF3.4050900@qualitycode.com> Roy Sutton wrote: > Try this one. I need to figure out how to get cvs to check out with DOS > newlines. Nope. kevins@aria:~/work/wxruby2$ patch -p1 Just a quick update on where we stand. I was updating the README, and looking at the wiki, and see that there are only 20 classes that were supported in wxruby 0.6 that are missing from wxruby2. And most of those are rarely used, and most should be easy to support. That's not counting the classes that were intentionally removed. There are also at least a dozen classes that are supported in wxruby2 that were never in wxruby 0.6. There are two "big" problems with the current wxruby2 code: 1. Inheritance. Currently, virtual methods can only be overridden in ruby if they were defined in the wx class that ruby is extending. If they were defined in the parent of that class, they behave as if they were non-virtual. There is a fairly easy fix for this, but it involves tweaking almost every swig class file in the system. Hopefully we can complete this within a week or so. 2. Memory management. Currently, most wxruby2 apps crash on exit, and some crash even earlier. We believe that any ruby garbage collection triggers it. The cause is not yet known, but is likely to end up being a straightforward fix, perhaps in our swig typemaps. It is even possible that the inheritance problem is causing this memory problem. Aside from those big issues, wxruby2 is looking very good. With more samples, better documentation, and binary packaging, we could be ready for a real release relatively soon (weeks? a couple months?). Thanks, Kevin From roys at mindspring.com Sat Aug 20 21:17:10 2005 From: roys at mindspring.com (Roy Sutton) Date: Sat Aug 20 21:10:53 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <4307CEF3.4050900@qualitycode.com> References: <430672E6.6060302@mindspring.com> <430681C8.2080901@qualitycode.com> <4306A14A.4030200@mindspring.com> <4307C51D.1000700@qualitycode.com> <4307CDAA.1090403@mindspring.com> <4307CEF3.4050900@qualitycode.com> Message-ID: <4307D616.4050005@mindspring.com> How about this? Kevin Smith wrote: > Roy Sutton wrote: > >> Try this one. I need to figure out how to get cvs to check out with >> DOS newlines. > > > Nope. > > kevins@aria:~/work/wxruby2$ patch -p1 > patching file samples/listbook/listbook.rb > Hunk #1 FAILED at 64. > 1 out of 1 hunk FAILED -- saving rejects to file > samples/listbook/listbook.rb.rej > missing header for unified diff at line 42 of patch > can't find file to patch at input line 42 > Perhaps you used the wrong -p or --strip option? > The text leading up to this was: > -------------------------- > | > | order_string << @pizza_cheese.get_string_selection + " and" + > "\n" > | > |- @pizza_toppings.each { |obj| order_string << > obj.get_string_selection + "\n" } > | > |+ @pizza_toppings.each { |obj| order_string << > obj.get_string_selection + "\n" unless obj.get_string_selection == "" } > | > | > |- @text_output.set_value(order_string) > | > |+ @text_output.append_text(order_string) > | end > | > | > | > | > | > -------------------------- > File to patch: > kevins@aria:~/work/wxruby2$ > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- --- listbook.rb 2005-08-19 19:56:25.663070400 -0400 +++ wxruby2/samples/listbook/listbook.rb 2005-08-19 20:35:00.000000000 -0400 @@ -5,7 +5,7 @@ # class SimpleFrame < Wx::Frame - FILE_DIALOG, FILE_ABOUT, FILE_QUIT = [0,1,2] + FILE_DIALOG, FILE_ABOUT, FILE_QUIT = [0,Wx::ID_ABOUT,2] def initialize(parent) super(nil,-1,"Sample",Wx::Point.new(50,50),Wx::Size.new(300,300)) @@ -15,7 +15,7 @@ # Create a new menu bar = Wx::MenuBar.new menu = Wx::Menu.new - menu.append(FILE_ABOUT,"About") + menu.append(FILE_ABOUT,"About...") menu.append_separator menu.append(FILE_QUIT,"Quit") bar.append(menu,"File") @@ -64,15 +64,15 @@ evt_button(Wx::xrcid('ID_PIZZA_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string = "\n" end + if order_string != "" then order_string << "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n" - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } - @text_output.append_text(order_string) + @text_output.set_value(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid('ID_DRINK_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string = "\n" end + if order_string != "" then order_string << "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.append_text(order_string) + @text_output.set_value(order_string) end # Variables for widgets in Ice Cream tab @@ -111,18 +111,19 @@ evt_button(Wx::xrcid('ID_ICE_CREAM_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string = "\n" end + if order_string != "" then order_string << "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } + @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } - @text_output.append_text(order_string) + @text_output.set_value(order_string) end evt_listbook_page_changed(Wx::xrcid('ID_LISTBOOK')) do |event| tab_number = event.get_selection - order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" - @text_output.append_text(order_string) + order_string = @text_output.get_value + order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.set_value(order_string) end end From wxruby at qualitycode.com Sat Aug 20 22:56:00 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 20 22:50:07 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4307C3C9.2030206@qualitycode.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4306A165.4080307@qualitycode.com> <430731DF.7000603@qualitycode.com> <43073BD5.5090105@mindspring.com> <4307C3C9.2030206@qualitycode.com> Message-ID: <4307ED40.4030604@qualitycode.com> Kevin Smith wrote: > After that, I'll start > adding %imports like crazy, until all the classes are covered. If anyone > wants to volunteer to help with this, let me know and we can split the > classes up into different sections and work without colliding. I just committed all the %imports, so all the classes should have good inheritance chains now, and all virtual methods sould be overrideable in Ruby. Most likely, there are some errors, either due to incorrect wx docs, or to my own mistakes. Hopefully, not very many. Kevin From wxruby at qualitycode.com Sat Aug 20 23:02:09 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sat Aug 20 22:56:16 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <4307D616.4050005@mindspring.com> References: <430672E6.6060302@mindspring.com> <430681C8.2080901@qualitycode.com> <4306A14A.4030200@mindspring.com> <4307C51D.1000700@qualitycode.com> <4307CDAA.1090403@mindspring.com> <4307CEF3.4050900@qualitycode.com> <4307D616.4050005@mindspring.com> Message-ID: <4307EEB1.2010305@qualitycode.com> Roy Sutton wrote: > How about this? Nope. kevins@aria:~/work/wxruby2$ patch -p1 1) SetScrollRange and SetScroll page in wxWindow.h is apparently only defined for 'microwindows'. No idea what that is but it's not Windows. I replaced the #if !__WXGTK__ with #if __WXMICROWIN__ See patched wxWindow.h file. 2) wxIcon does not (on windows at least) descend from wxBitmap. I don't have the gtk or mac headers to compare against. I've removed the wxBitmap.h %import and added a commented out %import for wGDIImage.h (which we don't have a header file for and don't know if we'll need later) See patched Icon.i 3) ListItemAttr needs listbase.h to compile. See patched ListItemAttr.i -------------- next part -------------- --- wxruby2\swig\classes\ListItemAttr.i 2005-08-20 21:55:44.000000000 -0400 +++ wxruby2_new\swig\classes\ListItemAttr.i 2005-08-21 12:15:12.410680000 -0400 @@ -5,4 +5,8 @@ %module(directors="1") wxListItemAttr +%{ +#include "wx/listbase.h" +%} + %include "include/wxListItemAttr.h" -------------- next part -------------- --- wxruby2\swig\classes\include\wxWindow.h 2005-08-20 19:47:08.000000000 -0400 +++ wxruby2_new\swig\classes\include\wxWindow.h 2005-08-21 11:42:01.918492800 -0400 @@ -991,7 +991,7 @@ * \param bool */ -#if !__WXGTK__ +#if __WXMICROWIN___ virtual void SetScrollPage(int orientation , int pageSize , bool refresh = true) ; /** * \brief @@ -1009,7 +1009,7 @@ * \param bool */ -#if !__WXGTK__ +#if __WXMICROWIN__ virtual void SetScrollRange(int orientation , int range , bool refresh = true) ; /** * \brief -------------- next part -------------- --- wxruby2\swig\classes\Icon.i 2005-08-20 21:55:44.000000000 -0400 +++ wxruby2_new\swig\classes\Icon.i 2005-08-21 12:09:38.500540800 -0400 @@ -6,7 +6,7 @@ %module(directors="1") wxIcon %import "include/wxObject.h" +# %import "include/wxGDIImage.h" %import "include/wxGDIObject.h" -%import "include/wxBitmap.h" %include "include/wxIcon.h" From roys at mindspring.com Sun Aug 21 12:32:44 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 21 12:26:25 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <4307EEB1.2010305@qualitycode.com> References: <430672E6.6060302@mindspring.com> <430681C8.2080901@qualitycode.com> <4306A14A.4030200@mindspring.com> <4307C51D.1000700@qualitycode.com> <4307CDAA.1090403@mindspring.com> <4307CEF3.4050900@qualitycode.com> <4307D616.4050005@mindspring.com> <4307EEB1.2010305@qualitycode.com> Message-ID: <4308ACAC.4060807@mindspring.com> This one? Kevin Smith wrote: > Roy Sutton wrote: > >> How about this? > > > Nope. > > kevins@aria:~/work/wxruby2$ patch -p1 > missing header for unified diff at line 3 of patch > patching file samples/listbook/listbook.rb > Hunk #1 FAILED at 5. > Hunk #2 FAILED at 15. > patch: **** malformed patch at line 37: @@ -84,11 +84,11 @@ > > > Are we having fun yet :-) > > The patch looks ok to me in a quick visual inspection. I wish I knew > more about patch so I could know why it is complaining. Have you tried > applying the patch on your own machine? Or do you even have patch > available? > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- --- wxruby2\samples\listbook\listbook.rb 2005-08-19 20:35:00.000000000 -0400 +++ wxruby2_new\samples\listbook\listbook.rb 2005-08-21 12:29:40.518958400 -0400 @@ -64,15 +64,15 @@ evt_button(Wx::xrcid('ID_PIZZA_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n" - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid('ID_DRINK_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.set_value(order_string) + @text_output.append_text(order_string) end # Variables for widgets in Ice Cream tab @@ -111,19 +111,18 @@ evt_button(Wx::xrcid('ID_ICE_CREAM_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end evt_listbook_page_changed(Wx::xrcid('ID_LISTBOOK')) do |event| tab_number = event.get_selection - order_string = @text_output.get_value - order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n" - @text_output.set_value(order_string) + order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.append_text(order_string) end end From wxruby at qualitycode.com Sun Aug 21 12:45:55 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 21 12:40:12 2005 Subject: [Wxruby-users] Patch for listbook.rb In-Reply-To: <4308ACAC.4060807@mindspring.com> References: <430672E6.6060302@mindspring.com> <430681C8.2080901@qualitycode.com> <4306A14A.4030200@mindspring.com> <4307C51D.1000700@qualitycode.com> <4307CDAA.1090403@mindspring.com> <4307CEF3.4050900@qualitycode.com> <4307D616.4050005@mindspring.com> <4307EEB1.2010305@qualitycode.com> <4308ACAC.4060807@mindspring.com> Message-ID: <4308AFC3.2050104@qualitycode.com> Roy Sutton wrote: > This one? Still no joy. kevins@aria:~/work/wxruby2$ patch -p1 References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4306A165.4080307@qualitycode.com> <430731DF.7000603@qualitycode.com> <43073BD5.5090105@mindspring.com> <4307C3C9.2030206@qualitycode.com> <4307ED40.4030604@qualitycode.com> Message-ID: <4308B291.9010003@mindspring.com> Great work Kevin! One thing this has surfaced is inconsitencies in the header files. Attached is a patched wxDialog.h. I tried to catch all the virtual functions that weren't marked as virtual. Roy Kevin Smith wrote: > Kevin Smith wrote: > >> After that, I'll start adding %imports like crazy, until all the >> classes are covered. If anyone wants to volunteer to help with this, >> let me know and we can split the classes up into different sections >> and work without colliding. > > > I just committed all the %imports, so all the classes should have good > inheritance chains now, and all virtual methods sould be overrideable > in Ruby. > > Most likely, there are some errors, either due to incorrect wx docs, > or to my own mistakes. Hopefully, not very many. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- --- wxruby2_old\swig\classes\include\wxDialog.h 2005-01-30 22:18:52.000000000 -0500 +++ wxruby2\swig\classes\include\wxDialog.h 2005-08-21 12:56:42.851758400 -0400 @@ -55,7 +55,7 @@ * \param int */ - void EndModal(int retCode ) ; + virtual void EndModal(int retCode ) ; /** * \brief */ @@ -81,7 +81,7 @@ * \brief Returns true if the dialog box is modal, false otherwise. */ - bool IsModal() const; + virtual bool IsModal() const; /** * \brief This member is called to allow the window to intercept keyboard events before they are processed by child windows. @@ -164,13 +164,13 @@ * \param const bool */ - bool Show(const bool show ) ; + virtual bool Show(bool show = true ) ; /** * \brief Shows a modal dialog. Program flow does not return until the dialog has been dismissed with . */ - int ShowModal() ; + virtual int ShowModal() ; }; From wxruby at qualitycode.com Sun Aug 21 14:03:40 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 21 13:57:55 2005 Subject: [Wxruby-users] Latest tarball doesn't compile In-Reply-To: <4308AB54.3060903@mindspring.com> References: <4308AB54.3060903@mindspring.com> Message-ID: <4308C1FC.5080409@qualitycode.com> Since the listbook patch didn't work, I just applied these three patches manually. Thanks for all your recent work. It's great to have an MS Windows user so active and responsive, so wxruby2 remains truly cross-platform. Kevin From roys at mindspring.com Sun Aug 21 14:09:58 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 21 14:03:41 2005 Subject: [Wxruby-users] Latest tarball doesn't compile In-Reply-To: <4308C1FC.5080409@qualitycode.com> References: <4308AB54.3060903@mindspring.com> <4308C1FC.5080409@qualitycode.com> Message-ID: <4308C376.3080400@mindspring.com> Kevin, I have installed patch on my machine and I will test things until I figure out what's causing the bad patches. I just don't understand why they worked fine when I was creating them before but now that I'm 'doing it right' (I think) they don't work. Roy Kevin Smith wrote: > Since the listbook patch didn't work, I just applied these three > patches manually. > > Thanks for all your recent work. It's great to have an MS Windows user > so active and responsive, so wxruby2 remains truly cross-platform. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Sun Aug 21 18:39:29 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 21 18:33:16 2005 Subject: [Wxruby-users] New inheritance Message-ID: <430902A1.1010702@mindspring.com> A good number of the samples I have tested are outright or subtly broken on Windows now. I'm trying to determine what the cause is. Mostly it seems related to the initialize function not being created when it should be. Case in point: ClientDC.i The caret example won't work at all because initialize isn't declared any longer. If you comment out the import lines, Swig does create an initialize. For ClientDC this fixes things so you can at least allocate one. Second case: Choice.i This is missing an %import for wxControlWithItems. However, if you add this, the constructor goes away. It's too hot in my house with the air conditioner out for me to attempt to puzzle this out later. If cooler heads haven't figured this out later I may revisit it. Roy From wxruby at qualitycode.com Sun Aug 21 22:11:49 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 21 22:05:31 2005 Subject: [Wxruby-users] New inheritance In-Reply-To: <430902A1.1010702@mindspring.com> References: <430902A1.1010702@mindspring.com> Message-ID: <43093465.5030901@qualitycode.com> Roy Sutton wrote: > A good number of the samples I have tested are outright or subtly broken > on Windows now. Argh! You're right. wxruby2 is pretty thoroughly broken at the moment. The problem has to do with pure virtual functions and abstract base classes. > Case in point: ClientDC.i Right. It inherits from WindowDC which inherits from DC. DC itself is/should be abstract because it has a large number of pure virtual functions. After quite a bit of research, though, and experimentation, I think I see the answer: 1. Insert the word "virtual" at the beginning of each pure virtual method declaration. I don't think swig actually cares, but it's the right thing to do. 2. Stop generating directors for any abstract base class. Fortunately, there only seem to be 8 of these, and I've already done one of them (DC). 3. ARGH: In any concrete subclass of an abstract base class, wherever the pure virtuals are actually defined, add those definitions to the .h files. This is ugly because it means updating MOST of the Event classes, MANY of the DC classes, ALL of the Sizer classes, and MOST of the classes that inherit from ControlWithItems. It's also a pain because I either have to guess where each method is defined, or examine each real wx .h file. Having "fixed" WindowDC, the caret sample works again. So at least there is hope again. > It's too hot in my house with the air > conditioner out for me to attempt to puzzle this out later. If cooler > heads haven't figured this out later I may revisit it. You have my sympathies, especially if you're someplace really hot like me (Florida). Fortunately, my A/C is working fine, so my cool brain was functioning up to spec tonight. Thanks, Kevin From wxruby at qualitycode.com Sun Aug 21 23:02:26 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 21 22:56:06 2005 Subject: [Wxruby-users] swig_up In-Reply-To: <4308B291.9010003@mindspring.com> References: <4301640D.4050904@mindspring.com> <4303C118.6090601@qualitycode.com> <4303F5CB.5000408@mindspring.com> <4306A165.4080307@qualitycode.com> <430731DF.7000603@qualitycode.com> <43073BD5.5090105@mindspring.com> <4307C3C9.2030206@qualitycode.com> <4307ED40.4030604@qualitycode.com> <4308B291.9010003@mindspring.com> Message-ID: <43094042.7000109@qualitycode.com> Roy Sutton wrote: > Great work Kevin! One thing this has surfaced is inconsitencies in the > header files. Attached is a patched wxDialog.h. I tried to catch all > the virtual functions that weren't marked as virtual. Committed. This patch seemed to *almost* work. The only problem with it appeared to be that the paths have backslashes instead of slashes. When 'patch' prompted me for the filename, I entered it with forward slashes, and it applied correctly! I suspect we will find *A LOT* of methods that should be marked virtual throughout the system. The original wx docs from which those .h files were generated unfortunately had a lot of errors. Thanks, Kevin > > Roy > > Kevin Smith wrote: > >> Kevin Smith wrote: >> >>> After that, I'll start adding %imports like crazy, until all the >>> classes are covered. If anyone wants to volunteer to help with this, >>> let me know and we can split the classes up into different sections >>> and work without colliding. >> >> >> >> I just committed all the %imports, so all the classes should have good >> inheritance chains now, and all virtual methods sould be overrideable >> in Ruby. >> >> Most likely, there are some errors, either due to incorrect wx docs, >> or to my own mistakes. Hopefully, not very many. >> >> Kevin >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> > > ------------------------------------------------------------------------ > > --- wxruby2_old\swig\classes\include\wxDialog.h 2005-01-30 22:18:52.000000000 -0500 > +++ wxruby2\swig\classes\include\wxDialog.h 2005-08-21 12:56:42.851758400 -0400 > @@ -55,7 +55,7 @@ > * \param int > */ > > - void EndModal(int retCode ) ; > + virtual void EndModal(int retCode ) ; > /** > * \brief > */ > @@ -81,7 +81,7 @@ > * \brief Returns true if the dialog box is modal, false otherwise. > */ > > - bool IsModal() const; > + virtual bool IsModal() const; > /** > * \brief This member is called to allow the window to intercept keyboard events > before they are processed by child windows. > @@ -164,13 +164,13 @@ > * \param const bool > */ > > - bool Show(const bool show ) ; > + virtual bool Show(bool show = true ) ; > /** > * \brief Shows a modal dialog. Program flow does not return until the dialog has been dismissed with > . > */ > > - int ShowModal() ; > + virtual int ShowModal() ; > }; > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users From roys at mindspring.com Sun Aug 21 23:20:37 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 21 23:14:19 2005 Subject: [Wxruby-users] Patch to rakewx.rb Message-ID: <43094485.8080304@mindspring.com> I got tired of swig trying to swig backup files and whatnot that ended up in swig/classes. Tell me if this patch file works. I used forward slashes. Roy -------------- next part -------------- --- wxruby2/rake/rakewx.rb 2005-08-14 07:42:38.000000000 -0400 +++ wxruby2_new/rake/rakewx.rb 2005-08-21 23:19:20.329172800 -0400 @@ -52,7 +52,7 @@ Dir::foreach($classes_dir) do | filename | filespec = File.join($classes_dir, filename) #puts("#{filename}: #{File.directory?(filespec)}) - if(filename[0,1] != '.' && !File.directory?(filespec)) + if(filename[0,1] != '.' && !File.directory?(filespec) && (File.extname(filename) == '.i')) classes << File.basename(filename, '.i') end end From wxruby at qualitycode.com Sun Aug 21 23:59:40 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 21 23:53:21 2005 Subject: [Wxruby-users] No longer completely broken (was: New inheritance) In-Reply-To: <43093465.5030901@qualitycode.com> References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> Message-ID: <43094DAC.2010104@qualitycode.com> Kevin Smith wrote: > > Argh! You're right. wxruby2 is pretty thoroughly broken at the moment. > > After quite a bit of research, though, and experimentation, I think I > see the answer: > > 1. Insert the word "virtual" at the beginning of each pure virtual > method declaration. I don't think swig actually cares, but it's the > right thing to do. Done (I think). > 2. Stop generating directors for any abstract base class. Fortunately, > there only seem to be 8 of these, and I've already done one of them (DC). Done (I think). > 3. ARGH: In any concrete subclass of an abstract base class, wherever > the pure virtuals are actually defined, add those definitions to the .h > files. This is ugly because it means updating MOST of the Event classes, > MANY of the DC classes, ALL of the Sizer classes, and MOST of the > classes that inherit from ControlWithItems. It's also a pain because I > either have to guess where each method is defined, or examine each real > wx .h file. Done (I think). At this point, wxruby2 is again able to run the samples that I tried (that it ran before). So I think it is "unbroken" again. I have tagged this as 0.0.28. Kevin From roys at mindspring.com Mon Aug 22 00:13:19 2005 From: roys at mindspring.com (Roy Sutton) Date: Mon Aug 22 00:07:02 2005 Subject: [Wxruby-users] No longer completely broken In-Reply-To: <43094DAC.2010104@qualitycode.com> References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> Message-ID: <430950DF.9090106@mindspring.com> Didn't test against this latest checkin but just in case you missed it here's a patched wxRadioBox.h Kevin Smith wrote: > Kevin Smith wrote: > >> >> Argh! You're right. wxruby2 is pretty thoroughly broken at the moment. >> >> After quite a bit of research, though, and experimentation, I think I >> see the answer: >> >> 1. Insert the word "virtual" at the beginning of each pure virtual >> method declaration. I don't think swig actually cares, but it's the >> right thing to do. > > > Done (I think). > >> 2. Stop generating directors for any abstract base class. >> Fortunately, there only seem to be 8 of these, and I've already done >> one of them (DC). > > > Done (I think). > >> 3. ARGH: In any concrete subclass of an abstract base class, wherever >> the pure virtuals are actually defined, add those definitions to the >> .h files. This is ugly because it means updating MOST of the Event >> classes, MANY of the DC classes, ALL of the Sizer classes, and MOST >> of the classes that inherit from ControlWithItems. It's also a pain >> because I either have to guess where each method is defined, or >> examine each real wx .h file. > > > Done (I think). > > At this point, wxruby2 is again able to run the samples that I tried > (that it ran before). So I think it is "unbroken" again. I have tagged > this as 0.0.28. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > -------------- next part -------------- --- wxruby2_new/swig/classes/include/wxRadioBox.h 2005-01-30 22:18:52.000000000 -0500 +++ wxruby2/swig/classes/include/wxRadioBox.h 2005-08-22 00:08:53.334144000 -0400 @@ -56,7 +56,7 @@ * \param bool */ - void Enable(bool enable = true) ; + virtual bool Enable(bool enable = true) ; /** * \brief Enables or disables an individual button in the radiobox. @@ -74,7 +74,7 @@ * \param bool */ - void Enable(int n , bool enable = true) ; + virtual bool Enable(int n , bool enable = true) ; /** * \brief Finds a button matching the given string, returning the position if found, or -1 if not found. @@ -86,7 +86,11 @@ * \brief Returns the number of items in the radiobox. */ - int GetCount() const; + virtual int GetCount() const; + + virtual int GetColumnCount() const; + virtual int GetRowCount() const; + /** * \brief Returns the radiobox label. */ @@ -102,7 +106,7 @@ * \brief Returns the zero-based position of the selected button. */ - int GetSelection() const; + virtual int GetSelection() const; /** * \brief Returns the selected string. */ @@ -149,14 +153,14 @@ * \param int */ - void SetSelection(int n ) ; + virtual void SetSelection(int n ) ; /** * \brief Sets the selection to a button by passing the desired string. This does not cause a wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted. * \param const wxString& */ - void SetStringSelection(const wxString& string ) ; + virtual void SetStringSelection(const wxString& string ) ; /** * \brief Shows or hides the entire radiobox. * \param const bool @@ -180,13 +184,13 @@ * \param const bool */ - void Show(int item , const bool show ) ; + virtual void Show(int item , const bool show = true ) ; /** * \brief Returns the label for the button at the given position. * \param int */ - wxString GetString(int n ) const; + virtual wxString GetString(int n ) const; }; From wxruby at qualitycode.com Mon Aug 22 00:32:14 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 22 00:25:56 2005 Subject: [Wxruby-users] Patch to rakewx.rb In-Reply-To: <43094485.8080304@mindspring.com> References: <43094485.8080304@mindspring.com> Message-ID: <4309554E.4030800@qualitycode.com> Roy Sutton wrote: > I got tired of swig trying to swig backup files and whatnot that ended > up in swig/classes. I applied your patch, and then simplified it. > Tell me if this patch file works. I used forward slashes. Perfectly! Thanks, Kevin From sean.m.long at gmail.com Mon Aug 22 01:43:42 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 22 01:37:15 2005 Subject: [Wxruby-users] No longer completely broken (was: New inheritance) In-Reply-To: <43094DAC.2010104@qualitycode.com> References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> Message-ID: Just checked it out and it compiles fine on OS X but when the samples are run no windows are shown. I will look into it a bit to see if anything obvious jumps out at me. Sean On 8/21/05, Kevin Smith wrote: > Kevin Smith wrote: > > > > Argh! You're right. wxruby2 is pretty thoroughly broken at the moment. > > > > After quite a bit of research, though, and experimentation, I think I > > see the answer: > > > > 1. Insert the word "virtual" at the beginning of each pure virtual > > method declaration. I don't think swig actually cares, but it's the > > right thing to do. > > Done (I think). > > > 2. Stop generating directors for any abstract base class. Fortunately, > > there only seem to be 8 of these, and I've already done one of them (DC). > > Done (I think). > > > 3. ARGH: In any concrete subclass of an abstract base class, wherever > > the pure virtuals are actually defined, add those definitions to the .h > > files. This is ugly because it means updating MOST of the Event classes, > > MANY of the DC classes, ALL of the Sizer classes, and MOST of the > > classes that inherit from ControlWithItems. It's also a pain because I > > either have to guess where each method is defined, or examine each real > > wx .h file. > > Done (I think). > > At this point, wxruby2 is again able to run the samples that I tried > (that it ran before). So I think it is "unbroken" again. I have tagged > this as 0.0.28. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From sean.m.long at gmail.com Mon Aug 22 10:52:35 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 22 10:46:08 2005 Subject: [Wxruby-users] Patches for inheritance fixes for 2 classes and added 1 class Message-ID: I still have not gotten the latest code to display a window on OS X, I put output statements all through the minimal sample and all the code was hit except for GUI event related code. I seems as everything is working fine but the GUI just does not show anything. Anyway in the process of looking for a fix I fixed some other errors that I came across. in App.i I changed wxDEBUG to __WXDEBUG__ now all the extra debug info is spit out at the command line (at least on Mac OS X, should on others also) in Window I got rid of the Clear() method which no longer exists, I am surprised we did not get a problem with this earlier. I also changed the GetFont method to the correct form. I added TopLevelWindow so Frame can inherit from it as it should. I changed MenuBar to inherit from Window instead of EvtHandler per the docs and the wx header files. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: app_i.patch Type: application/octet-stream Size: 1783 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/app_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: frame_i.patch Type: application/octet-stream Size: 515 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/frame_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: menubar_i.patch Type: application/octet-stream Size: 491 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/menubar_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: parents_rb.patch Type: application/octet-stream Size: 1257 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/parents_rb-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: wxFrame_h.patch Type: application/octet-stream Size: 533 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/wxFrame_h-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: wxMenuBar_h.patch Type: application/octet-stream Size: 547 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/wxMenuBar_h-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: wxWindow_h.patch Type: application/octet-stream Size: 1176 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/wxWindow_h-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: TopLevelWindow.i Type: application/octet-stream Size: 283 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/TopLevelWindow-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: wxTopLevelWindow.h Type: application/octet-stream Size: 3202 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050822/74798db0/wxTopLevelWindow-0001.obj From sean.m.long at gmail.com Mon Aug 22 16:54:56 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 22 16:48:27 2005 Subject: [Wxruby-users] Adding ScreenDC Message-ID: Here is the file to add ScreenDC. I noticed that it inherits from wxDC which is what the docs show but the headers for each platform are much different: - Mac,MSW,os2,motif,palmos all inherit from wxWindowDC - X11,GTK inherit from wxPaintDC - MGL, cocoa inherit from wxDC After saying that on Windows it still work inheriting from wxDC so I left it for now, any thoughts? Sean -------------- next part -------------- # Copyright 2004-2005 by Kevin Smith # released under the MIT-style wxruby2 license %include "../common.i" %module(directors="1") wxScreenDC %import "include/wxObject.h" %import "include/wxDC.h" %include "include/wxScreenDC.h" From dsymonds at gmail.com Mon Aug 22 21:47:33 2005 From: dsymonds at gmail.com (Dave Symonds) Date: Mon Aug 22 21:41:05 2005 Subject: [Wxruby-users] Adding ScreenDC In-Reply-To: References: Message-ID: On 23/08/05, Sean Long wrote: > Here is the file to add ScreenDC. I noticed that it inherits from wxDC > which is what the docs show but the headers for each platform are much > different: The wxWidgets 2.6.1 manual says that wxScreenDC inherits directly from wxDC. If other ports inherit from wxDC descendants, then it would only be a convenience matter for that port. Dave. -- "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." (Kristian Wilson, Nintendo Inc, 1989) From sean.m.long at gmail.com Wed Aug 24 10:40:53 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 24 10:34:21 2005 Subject: [Wxruby-users] No longer completely broken (was: New inheritance) In-Reply-To: References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> Message-ID: I still have not gotten the OS X version working completely. I have found that Dialog based windows work just fine it is Frame based ones that are not displaying. Kevin and Roy do you remember changing anything durring the inheritance overhaul that would affect this? I only see this problem on OS X it runs fine on Windows. Sean On 8/21/05, Sean Long wrote: > Just checked it out and it compiles fine on OS X but when the samples > are run no windows are shown. I will look into it a bit to see if > anything obvious jumps out at me. > > Sean > > On 8/21/05, Kevin Smith wrote: > > Kevin Smith wrote: > > > > > > Argh! You're right. wxruby2 is pretty thoroughly broken at the moment. > > > > > > After quite a bit of research, though, and experimentation, I think I > > > see the answer: > > > > > > 1. Insert the word "virtual" at the beginning of each pure virtual > > > method declaration. I don't think swig actually cares, but it's the > > > right thing to do. > > > > Done (I think). > > > > > 2. Stop generating directors for any abstract base class. Fortunately, > > > there only seem to be 8 of these, and I've already done one of them (DC). > > > > Done (I think). > > > > > 3. ARGH: In any concrete subclass of an abstract base class, wherever > > > the pure virtuals are actually defined, add those definitions to the .h > > > files. This is ugly because it means updating MOST of the Event classes, > > > MANY of the DC classes, ALL of the Sizer classes, and MOST of the > > > classes that inherit from ControlWithItems. It's also a pain because I > > > either have to guess where each method is defined, or examine each real > > > wx .h file. > > > > Done (I think). > > > > At this point, wxruby2 is again able to run the samples that I tried > > (that it ran before). So I think it is "unbroken" again. I have tagged > > this as 0.0.28. > > > > Kevin > > _______________________________________________ > > wxruby-users mailing list > > wxruby-users@rubyforge.org > > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From roys at mindspring.com Wed Aug 24 10:57:18 2005 From: roys at mindspring.com (Roy Sutton) Date: Wed Aug 24 10:50:56 2005 Subject: [Wxruby-users] No longer completely broken In-Reply-To: References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> Message-ID: <430C8ACE.6030101@mindspring.com> Sean, Before I corrected some of the inheritance problems the windows would not open on Windows either. I didn't investigate it exactly as the problems were pretty widespread at first. It could be some issue still related to the inheritance. You might want to compare the Mac vs. Windows tree. Roy Sean Long wrote: >I still have not gotten the OS X version working completely. I have >found that Dialog based windows work just fine it is Frame based ones >that are not displaying. > >Kevin and Roy do you remember changing anything durring the >inheritance overhaul that would affect this? I only see this problem >on OS X it runs fine on Windows. > >Sean > >On 8/21/05, Sean Long wrote: > > >>Just checked it out and it compiles fine on OS X but when the samples >>are run no windows are shown. I will look into it a bit to see if >>anything obvious jumps out at me. >> >>Sean >> >>On 8/21/05, Kevin Smith wrote: >> >> >>>Kevin Smith wrote: >>> >>> >>>>Argh! You're right. wxruby2 is pretty thoroughly broken at the moment. >>>> >>>>After quite a bit of research, though, and experimentation, I think I >>>>see the answer: >>>> >>>>1. Insert the word "virtual" at the beginning of each pure virtual >>>>method declaration. I don't think swig actually cares, but it's the >>>>right thing to do. >>>> >>>> >>>Done (I think). >>> >>> >>> >>>>2. Stop generating directors for any abstract base class. Fortunately, >>>>there only seem to be 8 of these, and I've already done one of them (DC). >>>> >>>> >>>Done (I think). >>> >>> >>> >>>>3. ARGH: In any concrete subclass of an abstract base class, wherever >>>>the pure virtuals are actually defined, add those definitions to the .h >>>>files. This is ugly because it means updating MOST of the Event classes, >>>>MANY of the DC classes, ALL of the Sizer classes, and MOST of the >>>>classes that inherit from ControlWithItems. It's also a pain because I >>>>either have to guess where each method is defined, or examine each real >>>>wx .h file. >>>> >>>> >>>Done (I think). >>> >>>At this point, wxruby2 is again able to run the samples that I tried >>>(that it ran before). So I think it is "unbroken" again. I have tagged >>>this as 0.0.28. >>> >>>Kevin >>>_______________________________________________ >>>wxruby-users mailing list >>>wxruby-users@rubyforge.org >>>http://rubyforge.org/mailman/listinfo/wxruby-users >>> >>> >>> > >_______________________________________________ >wxruby-users mailing list >wxruby-users@rubyforge.org >http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > From wxruby at qualitycode.com Wed Aug 24 19:15:14 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 24 19:08:55 2005 Subject: [Wxruby-users] Patches for inheritance fixes for 2 classes and added 1 class In-Reply-To: References: Message-ID: <430CFF82.8070007@qualitycode.com> Sean Long wrote: > Anyway in the process of looking for a fix I fixed some other errors > that I came across. Excellent. Committed. Thanks! Kevin From wxruby at qualitycode.com Wed Aug 24 19:42:22 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 24 19:35:58 2005 Subject: [Wxruby-users] RadioBox changes (was No longer completely broken) In-Reply-To: <430950DF.9090106@mindspring.com> References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> <430950DF.9090106@mindspring.com> Message-ID: <430D05DE.5070709@qualitycode.com> Roy Sutton wrote: > Didn't test against this latest checkin but just in case you missed it > here's a patched wxRadioBox.h I had to work with this a while before it would compile for me. I ended up removing GetColumns and GetRows because they don't exist on my system, and aren't in the wx docs. I also had to split Show into Show and ShowItem, like wxPython has. Hopefully what I did will still work on the other platforms. By the way, my earlier pass was to catch all the pure virtual methods, not all the virtual methods. There are probably quite a few other methods that should be marked virtual but still aren't. Kevin From wxruby at qualitycode.com Wed Aug 24 19:53:31 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 24 19:47:13 2005 Subject: [Wxruby-users] No longer completely broken In-Reply-To: References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> Message-ID: <430D087B.4000202@qualitycode.com> Sean Long wrote: > I still have not gotten the OS X version working completely. I have > found that Dialog based windows work just fine it is Frame based ones > that are not displaying. > > Kevin and Roy do you remember changing anything durring the > inheritance overhaul that would affect this? I only see this problem > on OS X it runs fine on Windows. Ugh. No, I don't remember anything specific. I did have a somewhat similar problem though, where the new bigdemo sample just would not show its main window, even though the code looked fine. Minimal and nothing did come up, though. So I copied their app code over piece by piece until the new bigdemo code started working. I still couldn't see what was different between the working code and the non-working code. To try to debug it, I inserted several printfs directly into App.cpp, to try to figure out what was happening. In my case, the window was being created, but for some reason was not being recognized by wx as being "the" top window, and therefore as soon as the mainloop was entered, wx exited because it thought the top window didn't exist. Best guess: the inheritance changes have caused some virtual method to not get called that used to be called, or vice versa. Or (as Roy hinted) that the parentage under Mac is different enough from Linux and Windows to cause problems. One would think that the issue would be with Frame. Just to confirm: Even samples/minimal/nothing.rb doesn't come up? Kevin From wxruby at qualitycode.com Wed Aug 24 19:59:46 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Wed Aug 24 19:53:23 2005 Subject: [Wxruby-users] Adding ScreenDC In-Reply-To: References: Message-ID: <430D09F2.9010903@qualitycode.com> Sean Long wrote: > Here is the file to add ScreenDC. Commmitted. > I noticed that it inherits from wxDC > which is what the docs show but the headers for each platform are much > different: > > - Mac,MSW,os2,motif,palmos all inherit from wxWindowDC > - X11,GTK inherit from wxPaintDC > - MGL, cocoa inherit from wxDC > > After saying that on Windows it still work inheriting from wxDC so I > left it for now, any thoughts? I think I agree with Dave Symonds that we should leave the parent as DC, at least for now. The only issue would be if someone wanted to override some virtual WindowDC or PaintDC methods in a subclass of ScreenDC. Otherwise, everything should work fine using DC as the parent. I added a note to the README about this. Thanks, Kevin From sean.m.long at gmail.com Thu Aug 25 00:44:22 2005 From: sean.m.long at gmail.com (Sean Long) Date: Thu Aug 25 00:37:49 2005 Subject: [Wxruby-users] No longer completely broken In-Reply-To: <430D087B.4000202@qualitycode.com> References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> <430D087B.4000202@qualitycode.com> Message-ID: > To try to debug it, I inserted several printfs directly into App.cpp, to > try to figure out what was happening. In my case, the window was being > created, but for some reason was not being recognized by wx as being > "the" top window, and therefore as soon as the mainloop was entered, wx > exited because it thought the top window didn't exist. Will have to try that, thanks. > Just to confirm: Even samples/minimal/nothing.rb doesn't come up? Nope, does not show a Frame. Sean From roys at mindspring.com Thu Aug 25 22:22:31 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 25 22:16:07 2005 Subject: [Wxruby-users] Update Message-ID: <430E7CE7.8060603@mindspring.com> Not much new to report. I have been away for a few days. I will spend part of the weekend going over the samples that are broken so we can get back beyond the level of functionality we had before the big reworking. As it sits right now, on Windows the Caret, images, Listbook, Minimal, Nothing, MDI and XRC samples work just fine. I will have to redo my patch for listbook with the forward slashes and resubmit it. I will likely patch the MDI sample if I can remember. It has two Window menus, which is about one too many. Hopefully I can get the other samples working this weekend. Roy From roys at mindspring.com Thu Aug 25 22:25:11 2005 From: roys at mindspring.com (Roy Sutton) Date: Thu Aug 25 22:18:44 2005 Subject: [Wxruby-users] listbook.rb patch Message-ID: <430E7D87.4050401@mindspring.com> Hopefully a good listbook.rb patch -------------- next part -------------- --- wxruby2/samples/listbook/listbook.rb 2005-08-19 20:35:00.000000000 -0400 +++ listbook.rb 2005-08-21 12:29:40.518958400 -0400 @@ -64,15 +64,15 @@ evt_button(Wx::xrcid('ID_PIZZA_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@pizza_size.get_string_selection} pizza with:\n" order_string << @pizza_crust.get_string_selection + " crust" + "\n" order_string << @pizza_sauce.get_string_selection + " sauce" +"\n" order_string << @pizza_cheese.get_string_selection + " and" + "\n" - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end @@ -84,11 +84,11 @@ evt_button(Wx::xrcid('ID_DRINK_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@drink_size.get_string_selection} #{@drink_type.get_string_selection }.\n" - @text_output.set_value(order_string) + @text_output.append_text(order_string) end # Variables for widgets in Ice Cream tab @@ -111,19 +111,18 @@ evt_button(Wx::xrcid('ID_ICE_CREAM_BUTTON')) do |event| #get selections and add to order order_string = @text_output.get_value - if order_string != "" then order_string << "\n" end + if order_string != "" then order_string = "\n" end order_string << "One #{@ice_cream_size.get_string_selection} #{@ice_cream_type.get_string_selection} ice cream:\n" - @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } + @ice_cream_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } - @text_output.set_value(order_string) + @text_output.append_text(order_string) end evt_listbook_page_changed(Wx::xrcid('ID_LISTBOOK')) do |event| tab_number = event.get_selection - order_string = @text_output.get_value - order_string << "moved to tab = #{@listbook.get_page_text(tab_number)} \n" - @text_output.set_value(order_string) + order_string = "moved to tab = #{@listbook.get_page_text(tab_number)} \n" + @text_output.append_text(order_string) end end From wxruby at qualitycode.com Sun Aug 28 21:24:56 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 28 21:18:31 2005 Subject: [Wxruby-users] listbook.rb patch In-Reply-To: <430E7D87.4050401@mindspring.com> References: <430E7D87.4050401@mindspring.com> Message-ID: <431263E8.5060204@qualitycode.com> Roy Sutton wrote: > Hopefully a good listbook.rb patch Sadly, no. kevins@aria:~/work/wxruby2$ patch -p1 --- wxruby2/samples/listbook/listbook.rb 2005-08-19 20:35:00.000000000 -0400 > +++ listbook.rb 2005-08-21 12:29:40.518958400 -0400 > @@ -64,15 +64,15 @@ > evt_button(Wx::xrcid('ID_PIZZA_BUTTON')) do |event| > #get selections and add to order > order_string = @text_output.get_value > - if order_string != "" then order_string << "\n" end > + if order_string != "" then order_string = "\n" end This seems like a confusing way to do this. Could we instead say: if @text_output.get_value.length == 0 order_string = "" else order_string = "\n" end Or even better, could we just always append a blank line at the end of the order string, instead of conditionally adding it at the beginning? > - @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" } > + @pizza_toppings.each { |obj| order_string << obj.get_string_selection + "\n" unless obj.get_string_selection == "" } Personal bias on my part, but I *hate* the "unless" keyword. I always find it incredibly jarring, since mentally I have already executed the first part, and then find out that it was conditional. I certainly won't reject the patch because of the unless, because it's in a sample. But I probably will reject any unless's in the core wxruby2 code. Kevin From roys at mindspring.com Sun Aug 28 21:35:57 2005 From: roys at mindspring.com (Roy Sutton) Date: Sun Aug 28 21:29:25 2005 Subject: [Wxruby-users] listbook.rb patch In-Reply-To: <431263E8.5060204@qualitycode.com> References: <430E7D87.4050401@mindspring.com> <431263E8.5060204@qualitycode.com> Message-ID: <4312667D.5030601@mindspring.com> I agree with you. I was just trying to impact the code as minimally as possible. I can always refactor the whole thing later. Roy Kevin Smith wrote: > > This seems like a confusing way to do this. Could we instead say: > > if @text_output.get_value.length == 0 > order_string = "" > else > order_string = "\n" > end > > Or even better, could we just always append a blank line at the end of > the order string, instead of conditionally adding it at the beginning? > >> - @pizza_toppings.each { |obj| order_string << >> obj.get_string_selection + "\n" } >> + @pizza_toppings.each { |obj| order_string << >> obj.get_string_selection + "\n" unless obj.get_string_selection == "" } > > > Personal bias on my part, but I *hate* the "unless" keyword. I always > find it incredibly jarring, since mentally I have already executed the > first part, and then find out that it was conditional. > > I certainly won't reject the patch because of the unless, because it's > in a sample. But I probably will reject any unless's in the core > wxruby2 code. > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > From wxruby at qualitycode.com Mon Aug 29 00:04:44 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Sun Aug 28 23:58:17 2005 Subject: [Wxruby-users] Alternatives to CVS? In-Reply-To: <42F97CD3.108@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> Message-ID: <4312895C.9010806@qualitycode.com> Kevin Smith wrote: > We are left with: > - Bazaar-NG (bzr) > - Codeville > - darcs > - Mercurial (?) > - svk > > Of those, Codeville and svk require a cgi app on the server, which I > dislike. On the other hand, Bazaar-NG, darcs, and Mercurial store their > repos *inside* the working directory, which I also dislike. So none of > these are ideal for me, but I would be willing to try any of them. > > Darcs is definitely the most mature, so I suppose it would be the > default choice if nobody has strong reasons to prefer one of the others. > For a small project like wxruby, darcs would probably work fine. I'm having second thoughts about darcs. The repo-inside-working-tree model is really bad for MS Windows users. Distributed SCM tools really rely on branches being cheap, and if you don't have "hard links" (which is true with most Windows boxes), then you either have to work differently (inefficiently) or suffer with slowness and excessive disk usage. So I really believe that darcs would work for a while, but also that we would end up switching to a different tool later. I'm concerned that switching twice (once from CVS to darcs, and then from darcs to something else) would be too confusing and painful. In the time that has passed since I wrote the message quoted above, bzr has improved in a couple ways. First, the Ubuntu Linux folks (Canonical) are officially planning to adopt it as their one and only version control tool later this year (October). Second, they have said that solving the repo-within-working-tree problem for non-hardlink systems is a high priority feature. Thus, I think I want to switch directly from CVS to bzr. However, I don't think bzr is quite ready, since they are about to make a change to their repository disk format. Also, they claim bzr works under MS Windows, but they don't seem to have docs describing how to install it. Therefore, I think I want to wait a while longer before switching from CVS. Meanwhile, I have set up a public bzr repository of my SpaceMonkeys game, as a test. You can install bzr and grab a copy with this command: bzr branch http://fxa.org/bzr/SpaceMonkeys/official This will create a directory named "official" and will pull a copy of the official sources into it. As with the darcs test, I would appreciate hearing your results if you try this. Especially if you try it with MS Windows (without cygwin). Here's the bzr site: http://www.bazaar-ng.org/ Kevin From sean.m.long at gmail.com Mon Aug 29 01:23:43 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 29 01:17:07 2005 Subject: [Wxruby-users] Alternatives to CVS? In-Reply-To: <4312895C.9010806@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <4312895C.9010806@qualitycode.com> Message-ID: The first problem I see is that is requires Python 2.4 and on Mac OS X 10.4 python 2.3.5 is installed by default. Just one extra hurdle for developers looking to contribute to the project, if we have too many install requirements (Ruby 1.8, SWIG, Python 2.4, bzr) some may decide not to contribute. At least with darcs binaries can be downloaded. Just my thoughts Sean On 8/28/05, Kevin Smith wrote: > Kevin Smith wrote: > > We are left with: > > - Bazaar-NG (bzr) > > - Codeville > > - darcs > > - Mercurial (?) > > - svk > > > > Of those, Codeville and svk require a cgi app on the server, which I > > dislike. On the other hand, Bazaar-NG, darcs, and Mercurial store their > > repos *inside* the working directory, which I also dislike. So none of > > these are ideal for me, but I would be willing to try any of them. > > > > Darcs is definitely the most mature, so I suppose it would be the > > default choice if nobody has strong reasons to prefer one of the others. > > For a small project like wxruby, darcs would probably work fine. > > I'm having second thoughts about darcs. The repo-inside-working-tree > model is really bad for MS Windows users. Distributed SCM tools really > rely on branches being cheap, and if you don't have "hard links" (which > is true with most Windows boxes), then you either have to work > differently (inefficiently) or suffer with slowness and excessive disk > usage. > > So I really believe that darcs would work for a while, but also that we > would end up switching to a different tool later. I'm concerned that > switching twice (once from CVS to darcs, and then from darcs to > something else) would be too confusing and painful. > > In the time that has passed since I wrote the message quoted above, bzr > has improved in a couple ways. First, the Ubuntu Linux folks (Canonical) > are officially planning to adopt it as their one and only version > control tool later this year (October). Second, they have said that > solving the repo-within-working-tree problem for non-hardlink systems is > a high priority feature. > > Thus, I think I want to switch directly from CVS to bzr. However, I > don't think bzr is quite ready, since they are about to make a change to > their repository disk format. Also, they claim bzr works under MS > Windows, but they don't seem to have docs describing how to install it. > Therefore, I think I want to wait a while longer before switching from CVS. > > Meanwhile, I have set up a public bzr repository of my SpaceMonkeys > game, as a test. You can install bzr and grab a copy with this command: > > bzr branch http://fxa.org/bzr/SpaceMonkeys/official > > This will create a directory named "official" and will pull a copy of > the official sources into it. As with the darcs test, I would appreciate > hearing your results if you try this. Especially if you try it with MS > Windows (without cygwin). Here's the bzr site: > > http://www.bazaar-ng.org/ > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From sean.m.long at gmail.com Mon Aug 29 02:02:13 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 29 01:55:34 2005 Subject: [Wxruby-users] No longer completely broken In-Reply-To: References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> <430D087B.4000202@qualitycode.com> Message-ID: I finally got Frames working again in OS X, I am not sure why it worked but it does. I had to remove %import "include/wxTopLevelWindow.h" from Frame.i I am not sure if this should have #ifndef __WXMAC__ around it or not, can someone test it on another platform? I can test it on Windows tomorrow. Sean On 8/24/05, Sean Long wrote: > > To try to debug it, I inserted several printfs directly into App.cpp, to > > try to figure out what was happening. In my case, the window was being > > created, but for some reason was not being recognized by wx as being > > "the" top window, and therefore as soon as the mainloop was entered, wx > > exited because it thought the top window didn't exist. > > Will have to try that, thanks. > > > > Just to confirm: Even samples/minimal/nothing.rb doesn't come up? > > Nope, does not show a Frame. > > Sean > -------------- next part -------------- A non-text attachment was scrubbed... Name: frame.patch Type: application/octet-stream Size: 515 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050828/e3cd40ec/frame.obj From sean.m.long at gmail.com Mon Aug 29 02:35:34 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 29 02:28:54 2005 Subject: [Wxruby-users] added Choicebook Message-ID: Here are the new files in a zip and the patches to existing. Also added Listbook values to parents.rb that I forgot when adding that. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: new_files.zip Type: application/zip Size: 3298 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050828/8f984b55/new_files-0001.zip -------------- next part -------------- A non-text attachment was scrubbed... Name: Events_i.patch Type: application/octet-stream Size: 2059 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050828/8f984b55/Events_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: events_rb.patch Type: application/octet-stream Size: 1311 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050828/8f984b55/events_rb-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: EvtHandler_i.patch Type: application/octet-stream Size: 2474 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050828/8f984b55/EvtHandler_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: parents_rb.patch Type: application/octet-stream Size: 1017 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050828/8f984b55/parents_rb-0001.obj From wxruby at qualitycode.com Mon Aug 29 08:52:53 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 29 08:46:31 2005 Subject: [Wxruby-users] Frame/TopLevelWindow problems on Mac (was: No longer completely broken) In-Reply-To: References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> <430D087B.4000202@qualitycode.com> Message-ID: <43130525.2060207@qualitycode.com> Sean Long wrote: > I finally got Frames working again in OS X, I am not sure why it > worked but it does. I had to remove That's great news. > > %import "include/wxTopLevelWindow.h" > > from Frame.i But I don't like that solution. It not only removes virtual-ness from all the TopLevelWindow methods in Frame, but it also cuts out all the Window, EvtHandler, and Object virtuals. If we are going to cut out TopLevel entirely, the proper way to do it would be to change wxFrame.h to declare: class wxFrame : public wxWindow With that change, it should still work on Mac. Can you test that? If not, then we know the problem isn't actually in TopLevelWindow, but in one of the classes higher in the inheritance chain. If we confirm that the problem is in TopLevelWindow, it's quite possible that we wouldn't have to remove it entirely. The two most likely virtual methods in TopLevelWindow that might be causing problems are IsActive and IsTopLevel. So the next thing to try would be to restore the wxTopLevelWindow parentage in wxFrame.h, and then #if out just those two methods from wxTopLevelWindow.h. You can check src/Frame.h to confirm that those methods no longer appear as virtuals. Thanks! Kevin From jani.monoses at gmail.com Mon Aug 29 09:29:41 2005 From: jani.monoses at gmail.com (Jani Monoses) Date: Mon Aug 29 09:23:00 2005 Subject: [Wxruby-users] Alternatives to CVS? In-Reply-To: <4312895C.9010806@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <4312895C.9010806@qualitycode.com> Message-ID: <29e1155305082906296b0b5b2@mail.gmail.com> Hi Kevin, does lack of hardlinks cause such inconveniences for a small project like wxruby? I am happy with your chosing either darcs or bzr, but could you publish wxruby2 in one of them ;) ? That would make possible contributors be more compelled to try out and test the distributed devel scenario than with the game only thanks Jani -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/3de11cb4/attachment.htm From sean.m.long at gmail.com Mon Aug 29 10:36:24 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 29 10:29:45 2005 Subject: [Wxruby-users] Frame/TopLevelWindow problems on Mac (was: No longer completely broken) In-Reply-To: <43130525.2060207@qualitycode.com> References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> <430D087B.4000202@qualitycode.com> <43130525.2060207@qualitycode.com> Message-ID: > class wxFrame : public wxWindow > > With that change, it should still work on Mac. Can you test that? If > not, then we know the problem isn't actually in TopLevelWindow, but in > one of the classes higher in the inheritance chain. Just tried inheriting from wxWindow and it does not work. Which makes sense because this problem existed before I added wxTopLevelWindow to wxruby2. Any ideas on where to go from here? Sean From wxruby at qualitycode.com Mon Aug 29 11:26:59 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 29 11:20:36 2005 Subject: [Wxruby-users] Frame/TopLevelWindow problems on Mac In-Reply-To: References: <430902A1.1010702@mindspring.com> <43093465.5030901@qualitycode.com> <43094DAC.2010104@qualitycode.com> <430D087B.4000202@qualitycode.com> <43130525.2060207@qualitycode.com> Message-ID: <43132943.8050408@qualitycode.com> Sean Long wrote: >>class wxFrame : public wxWindow >> >>With that change, it should still work on Mac. Can you test that? If >>not, then we know the problem isn't actually in TopLevelWindow, but in >>one of the classes higher in the inheritance chain. > > > Just tried inheriting from wxWindow and it does not work. Which makes > sense because this problem existed before I added wxTopLevelWindow to > wxruby2. > > Any ideas on where to go from here? Oh. Try inheriting from wxEvtHandler then. If that doesn't work, try inheriting from wxObject. We want to try to isolate which exact method(s) are causing problems when virtualized on the Mac. Thanks, Kevin From wxruby at qualitycode.com Mon Aug 29 11:32:22 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 29 11:25:57 2005 Subject: [Wxruby-users] Alternatives to CVS? In-Reply-To: <29e1155305082906296b0b5b2@mail.gmail.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <4312895C.9010806@qualitycode.com> <29e1155305082906296b0b5b2@mail.gmail.com> Message-ID: <43132A86.7040101@qualitycode.com> Jani Monoses wrote: > Hi Kevin, > > does lack of hardlinks cause such inconveniences for a small project like > wxruby? Yes, although to a much smaller degree than it would with a larger project. The longer the history and the more files there are in the project, the bigger the problem. > I am happy with your chosing either darcs or bzr, but could you publish > wxruby2 in one of them ;) ? > That would make possible contributors be more compelled to try out and test > the distributed devel scenario > than with the game only I am reluctant to publish a darcs repo unless we really expect to use darcs. Same with bzr. I could easily publish a one-time snapshot repo in either of those, but keeping it updated would be quite a time burden for me right now. So it would be stale almost immediately, which seems worse than not having one at all. Perhaps someone else could set up either a darcs or bzr mirror of the official CVS repo. That would allow contributors to pretend that the project had switched, and I would just have to figure out how to accept darcs/bzr patches and get them checked into CVS. Kevin From wxruby at qualitycode.com Mon Aug 29 11:33:19 2005 From: wxruby at qualitycode.com (Kevin Smith) Date: Mon Aug 29 11:26:48 2005 Subject: [Wxruby-users] Alternatives to CVS? In-Reply-To: References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <4312895C.9010806@qualitycode.com> Message-ID: <43132ABF.8070709@qualitycode.com> Sean Long wrote: > The first problem I see is that is requires Python 2.4 and on Mac OS X > 10.4 python 2.3.5 is installed by default. Just one extra hurdle for > developers looking to contribute to the project, if we have too many > install requirements (Ruby 1.8, SWIG, Python 2.4, bzr) some may decide > not to contribute. > > At least with darcs binaries can be downloaded. Hm. That is a consideration. Do you know how easy or difficult it is to install python 2.4 on Mac? Kevin From sean.m.long at gmail.com Mon Aug 29 12:46:48 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 29 12:40:07 2005 Subject: [Wxruby-users] Alternatives to CVS? In-Reply-To: <43132ABF.8070709@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <4312895C.9010806@qualitycode.com> <43132ABF.8070709@qualitycode.com> Message-ID: > Hm. That is a consideration. Do you know how easy or difficult it is to > install python 2.4 on Mac? Well for me it would probably be easy since I have DarwinPorts (like BSD ports) installed and can type: sudo port install python24 the same could could probably be done with fink (like apt-get for Mac OS X) I would then have to make sure the new install comes first in my PATH or create a symbolic link to the new version. So not really all that hard if you know what to do, just a hassle. Sean From sean.m.long at gmail.com Mon Aug 29 14:20:37 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 29 14:13:55 2005 Subject: [Wxruby-users] Re: added Choicebook In-Reply-To: References: Message-ID: Oops. Disregard the wxChoice.h in the zip file, I wanted to upload wxChoicebookEvent.h. Sorry Sean On 8/28/05, Sean Long wrote: > Here are the new files in a zip and the patches to existing. > > Also added Listbook values to parents.rb that I forgot when adding that. > > Sean > > > -------------- next part -------------- // Copyright 2004-2005 by Kevin Smith // released under the MIT-style wxruby2 license #if !defined(_wxChoicebookEvent_h_) #define _wxChoicebookEvent_h_ class wxChoicebookEvent : public wxNotifyEvent { public: wxChoicebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND); int GetOldSelection() const; int GetSelection() const; void SetOldSelection(int page ) ; void SetSelection(int page ) ; }; #endif From sean.m.long at gmail.com Mon Aug 29 18:11:59 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 29 18:05:18 2005 Subject: [Wxruby-users] patches for GridCell*Editor and GridCell*Renderer Message-ID: When I originally added these I used %module .... instead of %module(directors="1"). This little change has a big effect on the code actually working. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellBoolEditor_i.patch Type: application/octet-stream Size: 561 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellBoolEditor_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellChoiceEditor_i.patch Type: application/octet-stream Size: 575 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellChoiceEditor_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellEditor_i.patch Type: application/octet-stream Size: 755 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellEditor_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellFloatEditor_i.patch Type: application/octet-stream Size: 569 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellFloatEditor_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellFloatRenderer_i.patch Type: application/octet-stream Size: 582 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellFloatRenderer_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellNumberEditor_i.patch Type: application/octet-stream Size: 575 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellNumberEditor_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellNumberRenderer_i.patch Type: application/octet-stream Size: 589 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellNumberRenderer_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellStringRenderer_i.patch Type: application/octet-stream Size: 589 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellStringRenderer_i-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: GridCellTextEditor_i.patch Type: application/octet-stream Size: 561 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/6a0bf530/GridCellTextEditor_i-0001.obj From sean.m.long at gmail.com Mon Aug 29 20:02:04 2005 From: sean.m.long at gmail.com (Sean Long) Date: Mon Aug 29 19:55:22 2005 Subject: [Wxruby-users] wxArrayInt typemap patch Message-ID: This patch converts wxArrayInt to Ruby arrays. Sean -------------- next part -------------- A non-text attachment was scrubbed... Name: typemap_i.patch Type: application/octet-stream Size: 1138 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050829/dfea6cf7/typemap_i.obj From roys at mindspring.com Tue Aug 30 00:22:19 2005 From: roys at mindspring.com (Roy Sutton) Date: Tue Aug 30 00:15:47 2005 Subject: [Wxruby-users] Patch to controls.rb Message-ID: <4313DEFB.2080707@mindspring.com> This patch fixes the controls.rb sample so the images load properly on windows. On windows, wxIcon does -not- descend from wxImage. This means it does not have access to the image handling routines wxImage does. Furthermore, despite the documentation, it does -not- support XPM icons on Windows. The solution is to just not use icons where images are needed. The second solution was to default the application icon to the mondrian.ico file. This should work properly on other OSes. Please let me know if it breaks on OSX or Linux. Roy -------------- next part -------------- --- wxruby2_old/samples/controls/controls.rb 2005-08-10 22:57:12.000000000 -0400 +++ wxruby2/samples/controls/controls.rb 2005-08-30 00:07:12.475089600 -0400 @@ -218,12 +218,12 @@ imagelist = ImageList.new(16, 16) - imagelist.add_icon( Icon.new( "icons/list.xpm", Wx::BITMAP_TYPE_XPM)) - imagelist.add_icon( Icon.new( "icons/choice.xpm", Wx::BITMAP_TYPE_XPM)) - imagelist.add_icon( Icon.new( "icons/combo.xpm", Wx::BITMAP_TYPE_XPM)) - imagelist.add_icon( Icon.new( "icons/text.xpm", Wx::BITMAP_TYPE_XPM)) - imagelist.add_icon( Icon.new( "icons/radio.xpm", Wx::BITMAP_TYPE_XPM)) - imagelist.add_icon( Icon.new( "icons/gauge.xpm", Wx::BITMAP_TYPE_XPM)) + imagelist.add( Bitmap.new( "icons/list.xpm", Wx::BITMAP_TYPE_XPM)) + imagelist.add( Bitmap.new( "icons/choice.xpm", Wx::BITMAP_TYPE_XPM)) + imagelist.add( Bitmap.new( "icons/combo.xpm", Wx::BITMAP_TYPE_XPM)) + imagelist.add( Bitmap.new( "icons/text.xpm", Wx::BITMAP_TYPE_XPM)) + imagelist.add( Bitmap.new( "icons/radio.xpm", Wx::BITMAP_TYPE_XPM)) + imagelist.add( Bitmap.new( "icons/gauge.xpm", Wx::BITMAP_TYPE_XPM)) @m_notebook.assign_image_list(imagelist) panel = Panel.new(@m_notebook) @@ -1003,7 +1003,7 @@ @s_enable2 = TRUE @s_windowFocus = nil - set_icon(Icon.new("mondrian.xpm", Wx::BITMAP_TYPE_XPM)) + set_icon(Icon.new("mondrian.ico", Wx::BITMAP_TYPE_ICO)) file_menu = Menu.new @@ -1167,5 +1167,7 @@ puts("This sample cannot be run from a different directory") exit(1) end + +init_all_image_handlers a = MyApp.new a.main_loop From sean.m.long at gmail.com Tue Aug 30 01:55:05 2005 From: sean.m.long at gmail.com (Sean Long) Date: Tue Aug 30 01:48:22 2005 Subject: [Wxruby-users] Frame/TopLevelWindow problems on Mac In-Reply-To: <43132943.8050408@qualitycode.com> References: <430902A1.1010702@mindspring.com> <43094DAC.2010104@qualitycode.com> <430D087B.4000202@qualitycode.com> <43130525.2060207@qualitycode.com> <43132943.8050408@qualitycode.com> Message-ID: I got it to work. I had to add: bool Show(bool show = true); to wxFrame.h the code for Show(bool show) in src/wxFrame.cpp looks like this without the Show signature added to wxFrame: bool SwigDirector_wxFrame::Show(bool show) { VALUE obj0 = Qnil ; bool c_result ; VALUE result; if (swig_get_up()) { return wxWindow::Show(show); } obj0 = show ? Qtrue : Qfalse; result = rb_funcall(swig_get_self(), rb_intern("show"), 1,obj0); c_result = (bool) RTEST(result); return (bool) c_result; } and like this with the signature added: bool SwigDirector_wxFrame::Show(bool show) { VALUE obj0 = Qnil ; bool c_result ; VALUE result; if (swig_get_up()) { return wxFrame::Show(show); } obj0 = show ? Qtrue : Qfalse; result = rb_funcall(swig_get_self(), rb_intern("show"), 1,obj0); c_result = (bool) RTEST(result); return (bool) c_result; } Comparing the wxWidgets headers for MSW and Mac I can not see where this would make a difference, but it obviously does in the case of the Mac. I am not going to submit a patch, if you think it is an appropriate fix I will let you make the change. Sean On 8/29/05, Kevin Smith wrote: > Sean Long wrote: > >>class wxFrame : public wxWindow > >> > >>With that change, it should still work on Mac. Can you test that? If > >>not, then we know the problem isn't actually in TopLevelWindow, but in > >>one of the classes higher in the inheritance chain. > > > > > > Just tried inheriting from wxWindow and it does not work. Which makes > > sense because this problem existed before I added wxTopLevelWindow to > > wxruby2. > > > > Any ideas on where to go from here? > > Oh. Try inheriting from wxEvtHandler then. If that doesn't work, try > inheriting from wxObject. We want to try to isolate which exact > method(s) are causing problems when virtualized on the Mac. > > Thanks, > > Kevin > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > From ruby at portfolio16.de Tue Aug 30 10:15:03 2005 From: ruby at portfolio16.de (Tobias Gruetzmacher) Date: Tue Aug 30 10:08:25 2005 Subject: [Wxruby-users] Alternatives to CVS? In-Reply-To: <4312895C.9010806@qualitycode.com> References: <20050809195824.GB19961@portfolio16.de> <42F97CD3.108@qualitycode.com> <4312895C.9010806@qualitycode.com> Message-ID: <20050830141501.GA13253@portfolio16.de> Hi, On Mon, Aug 29, 2005 at 12:04:44AM -0400, Kevin Smith wrote: > I'm having second thoughts about darcs. The repo-inside-working-tree > model is really bad for MS Windows users. Distributed SCM tools really > rely on branches being cheap, and if you don't have "hard links" (which > is true with most Windows boxes), then you either have to work > differently (inefficiently) or suffer with slowness and excessive disk > usage. This only becomes a problem when a Windows user wants to create branches, right? So he has to make a full copy of his repository. I just looked at the numbers with wxruby2 in darcs (created with cvs2darcs just yesterday): Size of source: 5084 kB Size of complete darcs repository: 23004 kB Size of _darcs (without _darcs/current): 12832 kB Now a way to optimize this in darcs is to create checkpoints and let the contributers checkout only partial repositories. I put a checkpoint to the tag "v0_0_28". This adds about 1300 kB to the repository. When I checkout that partial repository (onto anothe filesystem) I get a new repository: Complete size: 11492 kB Size of _darcs (without _darcs/current): 1364 kB So the best way to optimize the space-usage for Windows-User would be to add checkpoints whenever the repository grows over a certain size. Not too much a burden if you ask me. And people with space-problems probably would have a hard time compiling wxruby2 anyway: 60980 kB are the object files and the lib on my Linux box... Some statistics over the scalability of darcs from one user: http://article.gmane.org/gmane.comp.version-control.darcs.user/7082 > So I really believe that darcs would work for a while, but also that we > would end up switching to a different tool later. I'm concerned that > switching twice (once from CVS to darcs, and then from darcs to > something else) would be too confusing and painful. I agree that different switches are really not nice for all people who have to learn yet another tool... But I DO think that darcs scales well. BTW: So I already have done the CVS-to-darcs-thing, I can also put it online. I try to keep it current. The stuff is at http://darcs.portfolio16.de/wxruby2/ - use "darcs get --partial" to only get the changes from the last tag till now. Greetings Tobi -- GPG-Key 0xE2BEA341 - signed/encrypted mail preferred My, oh so small, homepage: http://portfolio16.de/ http://www.fli4l.de/ - ISDN- & DSL-Router on one disk! Registered FLI4L-User #00000003 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050830/90e5012a/attachment.bin From sean.m.long at gmail.com Tue Aug 30 20:10:43 2005 From: sean.m.long at gmail.com (Sean Long) Date: Tue Aug 30 20:03:59 2005 Subject: [Wxruby-users] Re: new RubyConstants.i In-Reply-To: References: Message-ID: Here is a small patch to apply the above RubyConstants.i, it makes it so all the samples run. Run the patch in the same directory as the RubyConstants.i Sean On 8/30/05, Sean Long wrote: > I went through RubyConstants.i and updated it so everything matches > wx2.6.1, I also did some rearranging so it is easy to see which files > the different constants came from. I changed so much that I think just > sending the new file is easier. I have tested it on Windows and a > previous incarnation on Mac OS X. > > Sean > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RubyConstants_i.patch Type: application/octet-stream Size: 2869 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050830/80100b22/RubyConstants_i.obj From sean.m.long at gmail.com Wed Aug 31 02:42:10 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 31 02:35:26 2005 Subject: [Wxruby-users] Re: event handlers for wxGrid In-Reply-To: References: Message-ID: I got a warning from the list about the attachments being too big so I am not sure if the original went through. So here is a zip of the files. Sean On 8/30/05, Sean Long wrote: > I added all the event handlers for wxGrid. These patches also have > changes from my previous patches that have not been commited yet > (choicebook). wxGrid is actually getting useful now! > > Sean > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: event_handlers_for_wxgrid.zip Type: application/zip Size: 4805 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050830/e7264aae/event_handlers_for_wxgrid-0001.zip From sean.m.long at gmail.com Wed Aug 31 02:44:56 2005 From: sean.m.long at gmail.com (Sean Long) Date: Wed Aug 31 02:38:13 2005 Subject: [Wxruby-users] Re: new RubyConstants.i In-Reply-To: References: Message-ID: I don't think the original file got sent to the list so here is a zipped version with the patch already applied. sorry Sean On 8/30/05, Sean Long wrote: > Here is a small patch to apply the above RubyConstants.i, it makes it > so all the samples run. > Run the patch in the same directory as the RubyConstants.i > > Sean > > On 8/30/05, Sean Long wrote: > > I went through RubyConstants.i and updated it so everything matches > > wx2.6.1, I also did some rearranging so it is easy to see which files > > the different constants came from. I changed so much that I think just > > sending the new file is easier. I have tested it on Windows and a > > previous incarnation on Mac OS X. > > > > Sean > > > > > > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RubyConstants.i.zip Type: application/zip Size: 18065 bytes Desc: not available Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20050830/e37e6198/RubyConstants.i.zip