hi patches and files for Wx::SystemSettings, with get_font included in swig file and a sample that doesn''t segfault wxruby. CVS patches: RubyConstants.i, type_map.i CVS new: system_settings.rb (sample) SystemSettings.i (SWIG file) The sample should allow you to view the available information about system colours, fonts and metrics (eg cursor size, display size) in a Grid. Incidentally, there seems to be a bug in Wx::Grid - when I double-click on a grid cell, I get samples/system_settings/system_settings.rb:245:in `get_text_extent'': No matching function for overloaded ''wxWindow_GetTextExtent'' (ArgumentError) from samples/system_settings/system_settings.rb:245:in `main_loop'' from samples/system_settings/system_settings.rb:245 There''s no explicit call to get_text_extent, so maybe something getting called by Wx that isn''t wrapped as expected? cheers alex _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
Alex Fenton wrote:> Incidentally, there seems to be a bug in Wx::Grid - when I > double-click on a grid cell, I get > > samples/system_settings/system_settings.rb:245:in `get_text_extent'': > No matching function for overloaded ''wxWindow_GetTextExtent'' > (ArgumentError) > from samples/system_settings/system_settings.rb:245:in `main_loop'' > from samples/system_settings/system_settings.rb:245 > > There''s no explicit call to get_text_extent, so maybe something > getting called by Wx that isn''t wrapped as expected? >This is a known bug and I suppose once we all get back to working on wxRuby again we''ll tackle the last of these problems.
Alex Fenton wrote:> hi > > patches and files for Wx::SystemSettings, with get_font included in swig > file and a sample that doesn''t segfault wxruby.Very nice, thanks. It''s in. I put the sample in etc/> Incidentally, there seems to be a bug in Wx::Grid - when I double-click > on a grid cell, I get > > samples/system_settings/system_settings.rb:245:in `get_text_extent'': No > matching function for overloaded ''wxWindow_GetTextExtent'' (ArgumentError) > from samples/system_settings/system_settings.rb:245:in `main_loop'' > from samples/system_settings/system_settings.rb:245 > > There''s no explicit call to get_text_extent, so maybe something getting > called by Wx that isn''t wrapped as expected?As Roy mentioned, we need to handle GetTextExtent specially. Hopefully we can just add a method to the %extend area in the .i file which calls the wx method, then packages the results into a ruby array to return. That''s how you can say x,y = some_function() right? We should probably match the Python approach and have two methods. Kevin
Reasonably Related Threads
- No matching function for overloaded ''wxWindow_GetTextExtent'' on Linux
- Wx::SystemSettings
- [922] branches/wxruby2/wxwidgets_282: Changes, additions and deprecations 2.6 -> 2.8 Wx API
- Wx::Window#get_text_extent patch
- Swig generates bad interface to GetTextExtent