This patch fixes background color problems (at least on Windows). It uses the dreaded ''FIXME'' My plan for next weekend is to try building wxPython from the source to see how they manage to achieve several things with SWIG that we''re not (yet) able to. If I''m successful it might lead to wrapping a significant portion of wxWidgets more correctly than we''ve been able to. Hint to Ruby lurkers: There are some classes implemented in wxRuby that do not have corresponding demos in bigdemo. You can almost exactly copy the source from the wxPython demo program to wxRuby. Doing this can help reveal shortcomings and bugs that we haven''t even had time to discover yet. Here''s a link to the source for the wxPython demo program: http://prdownloads.sourceforge.net/wxpython/wxPython2.6-win32-docs-demos-2.6.3.3.exe Final note in case anyone is reading this far: The version of wxRuby I made into a gem uses ANSI strings. Does anyone have a strong preference for or against Unicode? I don''t use it so it just didn''t occur to me to build it. Should we make both available? Roy
Roy Sutton wrote:> Hint to Ruby lurkers: There are some classes implemented in wxRuby that > do not have corresponding demos in bigdemo. You can almost exactly copy > the source from the wxPython demo program to wxRuby. Doing this can > help reveal shortcomings and bugs that we haven''t even had time to > discover yet. Here''s a link to the source for the wxPython demo program: > > http://prdownloads.sourceforge.net/wxpython/wxPython2.6-win32-docs-demos-2.6.3.3.exe > >Use this link instead: http://www.wxpython.org/download.php#binaries There are demo binaries (as well as the executable for wxPython if you actually want to try it out) for each platform there. Roy
Hi Roy Sutton wrote:> This patch fixes background color problems (at least on Windows). It > uses the dreaded ''FIXME'' >Should there be an attachment with this please?> Final note in case anyone is reading this far: The version of wxRuby I > made into a gem uses ANSI strings. Does anyone have a strong preference > for or against Unicode?I would prefer unicode. i18n is one of the main things I want to use wxruby2 for. A unicode build should be able to do everything an ANSI one can?> I don''t use it so it just didn''t occur to me to > build it. Should we make both available? >We could. I think it would be better to decide that one or other is the standard for our binary distributions at least. What do others think? a
Yes, it should. I replied immediately to my own message but, apparently, it went only to me. Alex Fenton wrote:> Should there be an attachment with this please? > >-------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: wxWindow.h.patch Url: http://rubyforge.org/pipermail/wxruby-users/attachments/20060906/f1545286/attachment.pl
Thank you. I tried applying this patch, but it seems to cause lots of fairly ordinary code to crash (inc samples, eg listbook.rb, bigdemo/wxButton.rbw) on OS X at least. This is because get_default_attributes is not available. It seems this method is called internally in a lot of cases. Is there some other way to avoid the background colour bug? Thanks alex Roy Sutton wrote:> Yes, it should. I replied immediately to my own message but, > apparently, it went only to me.
I don''t see how removing this from SWIG prevents it from being called internally. Those two were fairly recent additions. Are you certain it''s that change that''s causing the crashing? I suppose it could be because the internal functions are calling back to some -other- function that shouldn''t be wrapped or is wrapped for the wrong object. The only other way to fix the background color bug is to redeclare that function (sometimes protected!) in all the base classes that override it. We''d have to do that for each platform. Roy Alex Fenton wrote:> Thank you. I tried applying this patch, but it seems to cause lots of > fairly ordinary code to crash (inc samples, eg listbook.rb, > bigdemo/wxButton.rbw) on OS X at least. This is because > get_default_attributes is not available. It seems this method is called > internally in a lot of cases. > > Is there some other way to avoid the background colour bug? > > Thanks > alex > > > > > Roy Sutton wrote: > >> Yes, it should. I replied immediately to my own message but, >> apparently, it went only to me. >> > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > >
Roy Sutton wrote:> I don''t see how removing this from SWIG prevents it from being called > internally.Nor do I.> Those two were fairly recent additions. Are you certain > it''s that change that''s causing the crashing?I have just double-checked. listbook.rb runs fine before the patch, but when I apply the patch and recompile I get: ruby -Ilib samples/listbook/listbook.rb Our Initialize was called Their Initialize returned 1 samples/listbook/listbook.rb:21:in `load_frame_subclass'': undefined method `get_default_attributes'' for #<SimpleFrame:0x3aa958> (NoMethodError) from samples/listbook/listbook.rb:21:in `initialize'' from samples/listbook/listbook.rb:167:in `new'' from samples/listbook/listbook.rb:167:in `on_init'' from samples/listbook/listbook.rb:175:in `main_loop'' from samples/listbook/listbook.rb:175> I suppose it could be > because the internal functions are calling back to some -other- function > that shouldn''t be wrapped or is wrapped for the wrong object. >Sorry I can''t help here - it reminds me of the bug with get_text_extent, which would crash when it was called implicitly when starting editing a Grid cell, even though the ruby code didn''t mention that method. alex
I bet you didn''t do a clean and recompile. About a bazillion files %import wxWindow.h. Try doing a clean build Alex Fenton wrote:> Roy Sutton wrote: > >> I don''t see how removing this from SWIG prevents it from being called >> internally. >> > Nor do I. > >> Those two were fairly recent additions. Are you certain >> it''s that change that''s causing the crashing? >> > I have just double-checked. listbook.rb runs fine before the patch, but > when I apply the patch and recompile I get: > > ruby -Ilib samples/listbook/listbook.rb > Our Initialize was called > Their Initialize returned 1 > samples/listbook/listbook.rb:21:in `load_frame_subclass'': undefined > method `get_default_attributes'' for #<SimpleFrame:0x3aa958> (NoMethodError) > from samples/listbook/listbook.rb:21:in `initialize'' > from samples/listbook/listbook.rb:167:in `new'' > from samples/listbook/listbook.rb:167:in `on_init'' > from samples/listbook/listbook.rb:175:in `main_loop'' > from samples/listbook/listbook.rb:175 > > >> I suppose it could be >> because the internal functions are calling back to some -other- function >> that shouldn''t be wrapped or is wrapped for the wrong object. >> >> > Sorry I can''t help here - it reminds me of the bug with get_text_extent, > which would crash when it was called implicitly when starting editing a > Grid cell, even though the ruby code didn''t mention that method. > > alex > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > >
Roy Sutton wrote:> I bet you didn''t do a clean and recompile. About a bazillion files > %import wxWindow.h. Try doing a clean build >Thanks. I didn''t realise that was needed. It works now. Will commit tomorrow. alex
Roy Sutton wrote:> Yes, it should. I replied immediately to my own message but, > apparently, it went only to me.Committed (eventually). Thank you a
Roy Sutton wrote:> Final note in case anyone is reading this far: The version of wxRuby I > made into a gem uses ANSI strings. Does anyone have a strong preference > for or against Unicode? I don''t use it so it just didn''t occur to me to > build it. Should we make both available?As a huge fan of unicode, and as a believer in consistency where possible, I would strongly prefer to have all wxruby binary gems use unicode. I think it will greatly minimize confusion when trying to run wxruby apps on multiple platforms. Kevin
I''ll rebuild with Unicode and see how it works out. You don''t have to do anything different with Ruby, I assume, just because you compiled with Unicode. Roy Kevin Smith wrote:> Roy Sutton wrote: > >> Final note in case anyone is reading this far: The version of wxRuby I >> made into a gem uses ANSI strings. Does anyone have a strong preference >> for or against Unicode? I don''t use it so it just didn''t occur to me to >> build it. Should we make both available? >> > > As a huge fan of unicode, and as a believer in consistency where > possible, I would strongly prefer to have all wxruby binary gems use > unicode. > > I think it will greatly minimize confusion when trying to run wxruby > apps on multiple platforms. > > Kevin > > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > > >
Roy Sutton wrote:> I''ll rebuild with Unicode and see how it works out. You don''t have to > do anything different with Ruby, I assume, just because you compiled > with Unicode. >You don''t have to change anything about ruby. You don''t need to change scripts either, unless you actually want to use unicode characters in them. If you do, you need to tell ruby what encoding the script is written in, and ensure non-ASCII characters are passed to WxRuby in UTF-8. The text/unicode.rb sample is a decent guide to this (using Arabic, Chinese, accented Latin etc in the same GUI - which couldn''t be done w/o a unicode build). Thanks - let me know when you have a gem available alex