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 _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
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
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 <wxruby@qualitycode.com> 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 >
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
> 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
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