Re: [gtk-list] Gtk+ 1.1.5 gtktoolbar bug ?



Mario Motta wrote:
> 
> hi all,
> seems that in gtk+ 1.1.5 a code like this:
> =================================================================
> widget = gtk_toolbar_new(orientation,GTK_TOOLBAR_ICONS);
> button = gtk_toolbar_append_item (GTK_TOOLBAR (widget),
>                                     text,
>                                     tip,
>                                     NULL,
>                                     pixmap,
>                                     GTK_SIGNAL_FUNC(ButtonSignal),
>                                     (gpointer) data);
> gtk_widget_set_sensitive(button,FALSE);
> =================================================================
> gets this gdk message:
> Gdk-CRITICAL **:
> file gdkdraw.c: line 312 (gdk_draw_pixmap): assertion `src != NULL'
> failed.
> After that no pixmap appears over button.
> 
> With "gtk_widget_set_sensitive(button,TRUE);"
> or commenting out offending line situation returns normal.

Looking more deeply into above bug seems that in 
gtkpixmap.c the offending code is:
gtkpixmap.c line 221:
======================================================
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE
          && pixmap->build_insensitive)
        {
          if (!pixmap->pixmap_insensitive)
            build_insensitive_pixmap (pixmap);
        // fails to create unsensitive pixmap
        // so pixmap->pixmap_insensitive is NULL
          gdk_draw_pixmap (widget->window,
                           widget->style->black_gc,
                           pixmap->pixmap_insensitive,
                           0, 0, x, y, -1, -1);
        }
=======================================================
function build_insensitive_pixmap(), called by gtk_pixmap_expose(),
fails to create "insensitive" pixmap, so following gdk_draw_pixmap()
fails.
Same bug apply to all gtkpixmaps. Setting a gtkpixmap to unsensitive
fail to:
Gdk-CRITICAL **:
file gdkdraw.c: line 312 (gdk_draw_pixmap): assertion `src != NULL'

My system is Linux box , kernel 2.0.34, Xfree86 3.3.2, card S3 Virge 4Mb

hope this helps.

regards.

-- 
Mario Motta
AI Research Group - Rimini
mmotta@guest.net
http://www.guest.net/homepages/mmotta/VDKHome/index.htm




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]