Here''s a patch to fix Wx::Window#get_text_extent - it requires that the patches from teh last message are applied, to enable *INPUT etc typemaps. Roy - though the function works correctly when called from Ruby, it still causes a crash when called internally when clicking on a Wx::Grid cell. Saw your message on SWIG mailing list, hopefully someone there can help out. alex _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Alex, I meant to mention there are typemaps for that call in typemap.i. Perhaps we should update that one instead? Roy Alex Fenton wrote:> Here''s a patch to fix Wx::Window#get_text_extent - it requires that > the patches from teh last message are applied, to enable *INPUT etc > typemaps. > > Roy - though the function works correctly when called from Ruby, it > still causes a crash when called internally when clicking on a > Wx::Grid cell. Saw your message on SWIG mailing list, hopefully > someone there can help out. > > alex > ------------------------------------------------------------------------ > > Index: wxruby2/swig/classes/Window.i > ==================================================================> RCS file: /var/cvs/wxruby/wxruby2/swig/classes/Window.i,v > retrieving revision 1.13 > diff -b -u -r1.13 Window.i > --- wxruby2/swig/classes/Window.i 18 Sep 2005 17:08:05 -0000 1.13 > +++ wxruby2/swig/classes/Window.i 23 Apr 2006 17:45:00 -0000 > @@ -11,6 +11,10 @@ > %ignore wxWindow::PopEventHandler; > # %ignore wxWindow::SetCaret; > > +# For Wx::Window#get_text_extent > +%apply int *OUTPUT { int* x , int* y , int* descent, int* externalLeading}; > +%apply wxFont *INPUT { const wxFont* font }; > + > %rename(SetDimensions) wxWindow::SetSize(int x , int y , int width , int height , int sizeFlags = wxSIZE_AUTO) ; > > %{ > > ------------------------------------------------------------------------ > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users
Yep, I see DC and WindowDC have methods with the same or similar signatures - if it covers several classes it should live in typemap.i. I''ll send in an updated patch. thanks alex Roy Sutton wrote:> Alex, > > I meant to mention there are typemaps for that call in typemap.i. > Perhaps we should update that one instead? > > Roy > > Alex Fenton wrote: > >> Here''s a patch to fix Wx::Window#get_text_extent - it requires that >> the patches from teh last message are applied, to enable *INPUT etc >> typemaps. >> >> Roy - though the function works correctly when called from Ruby, it >> still causes a crash when called internally when clicking on a >> Wx::Grid cell. Saw your message on SWIG mailing list, hopefully >> someone there can help out. >> >> alex >> ------------------------------------------------------------------------ >> >> Index: wxruby2/swig/classes/Window.i >> ==================================================================>> RCS file: /var/cvs/wxruby/wxruby2/swig/classes/Window.i,v >> retrieving revision 1.13 >> diff -b -u -r1.13 Window.i >> --- wxruby2/swig/classes/Window.i 18 Sep 2005 17:08:05 -0000 1.13 >> +++ wxruby2/swig/classes/Window.i 23 Apr 2006 17:45:00 -0000 >> @@ -11,6 +11,10 @@ >> %ignore wxWindow::PopEventHandler; >> # %ignore wxWindow::SetCaret; >> >> +# For Wx::Window#get_text_extent >> +%apply int *OUTPUT { int* x , int* y , int* descent, int* externalLeading}; >> +%apply wxFont *INPUT { const wxFont* font }; >> + >> %rename(SetDimensions) wxWindow::SetSize(int x , int y , int width , int height , int sizeFlags = wxSIZE_AUTO) ; >> >> %{ >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >
> I meant to mention there are typemaps for that call in typemap.i. > Perhaps we should update that one instead? >see attached> Alex Fenton wrote: > >> Here''s a patch to fix Wx::Window#get_text_extent - it requires that >> the patches from teh last message are applied, to enable *INPUT etc >> typemaps. >> >> Roy - though the function works correctly when called from Ruby, it >> still causes a crash when called internally when clicking on a >> Wx::Grid cell. Saw your message on SWIG mailing list, hopefully >> someone there can help out. >> >> alex >> ------------------------------------------------------------------------ >> >> Index: wxruby2/swig/classes/Window.i >> ==================================================================>> RCS file: /var/cvs/wxruby/wxruby2/swig/classes/Window.i,v >> retrieving revision 1.13 >> diff -b -u -r1.13 Window.i >> --- wxruby2/swig/classes/Window.i 18 Sep 2005 17:08:05 -0000 1.13 >> +++ wxruby2/swig/classes/Window.i 23 Apr 2006 17:45:00 -0000 >> @@ -11,6 +11,10 @@ >> %ignore wxWindow::PopEventHandler; >> # %ignore wxWindow::SetCaret; >> >> +# For Wx::Window#get_text_extent >> +%apply int *OUTPUT { int* x , int* y , int* descent, int* externalLeading}; >> +%apply wxFont *INPUT { const wxFont* font }; >> + >> %rename(SetDimensions) wxWindow::SetSize(int x , int y , int width , int height , int sizeFlags = wxSIZE_AUTO) ; >> >> %{ >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> wxruby-users mailing list >> wxruby-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wxruby-users >> > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >-------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: typemap.i.patch Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20060425/2a96ed00/attachment.bat
On Tue, 2006-04-25 at 10:11 +0100, Alex Fenton wrote:> > I meant to mention there are typemaps for that call in typemap.i. > > Perhaps we should update that one instead? > > > see attachedApplied. Thanks. Kevin