From: SourceForge.net <no...@so...> - 2006-08-24 17:54:20
|
Bugs item #1484752, was opened at 2006-05-09 17:10 Message generated for change (Comment added) made by kaffeetisch You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=508618&aid=1484752&group_id=64773 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interface error Group: gtk2-perl-xs >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Chris (fettucine) Assigned to: Nobody/Anonymous (nobody) Summary: GtkWidget::modify_xxx methods should use SvXXX_ornull Initial Comment: This bug report is against gtk2-perl version 1.121 The Gtk2::Widget methods: modify_font modify_bg modify_base modify_fg modify_text (but not modify_style) should use the ornull for the passed in color/font properties. (for example in modify_font it is the SvPangoFontDescription (ST(1)) parameter). The Gtk documentation for those functions states that using NULL undoes previous modifications. I have modified the autogenerated xs/GtkWidget.c to use the xxx_ornull macros and then used them in perl, for example: $widget->modify_font(undef); $widget->modify_bg(undef); $widget->modify_fg(undef); and it worked and correctly reset the font and colours of the widget with no problems. (whereas beforehand it spat the dummy and told me that it expected a value). (I only tested bg, fg,and font but according to the docs the behaviour is the same for the 'base' and 'text). I havent looked into what produces the .c file from the .xs file yet, but I imagine you guys know where to change it. the following comments are probably overkill, but these methods are really needed to reset styles of widgets as you may notice even $widget->set_style(undef); does not have an effect until you later go and set some style properties (ie the widget seems to keep the current font until it is set to something differnt). There are other ways to reset the styles but they all seem to have drawbacks. ---------------------------------------------------------------------- >Comment By: Torsten Schoenfeld (kaffeetisch) Date: 2006-08-24 19:54 Message: Logged In: YES user_id=767050 Yes, the Gtk2::Widget::modify_* stuff is fixed already. Let's move the Gtk2::RcStyle issues to bugzilla: http://bugzilla.gnome.org/show_bug.cgi?id=352707 ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-06-20 06:22 Message: Logged In: NO Hey I havent tried it yet but it looks like this bug was just fixed (according to the other gtk2-perl home page). Also it doesnt look like it includes a fix for bg_pixmap_name in Gtk2::RcStyle to quote: Gtk2-Perl 2.14.2 Mon, 29 May 2006 by Torsten Schoenfeld This stable release contains a new version of Gtk2 which fixes Gtk2::Widget::modify_* to accept undef and also corrects some test suite issues. Get the tarball from our releases page ---------------------------------------------------------------------- Comment By: Chris (fettucine) Date: 2006-05-09 19:59 Message: Logged In: YES user_id=804740 GtkRcStyle (xs/GtkRc.xs approx line 224 ) seems to have the same problem (not treating a value of undef as a valid value). I believe that calling my $rcstyle=$widget->get_modifier_style(); $rcstyle->bg_pixmap_name('normal',undef); should set the value to undef/null. Instead if the parameter was specified at all, the XS code tries to create a string from the it (and fails), and if it was not specified (eg $rcstyle->bg_pixmap_name('normal') ) then it treats it as a read-only access and just retrieves the current value. I need this method to work because I need to be able to reset a widget to use the pixmap setting from the current Gtk theme. A workaround that works at the moment is to do this: #create an empty rcstyle with no bg_pixmap_name set. my $rcstyle=new Gtk2::RcStyle(); $widget->modify_style($rcstyle); #and then if you need to use the rcstyle to make other #changes, you should get it ask for it back like this: $rcstyle=$widget->get_modifier_style(); #and then call modify_style again with it when done. I am not sure but I think you probably lose all other style modifications when doing this and you would have to do them again on the new rcstyle. ---------------------------------------------------------------------- Comment By: Chris (fettucine) Date: 2006-05-09 18:05 Message: Logged In: YES user_id=804740 the color examples I used should have course have been more like: $widget->modify_bg('normal',undef); $widget->modify_fg('normal',undef); $widget->modify_base('normal',undef); $widget->modify_text('normal',undef); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=508618&aid=1484752&group_id=64773 |