Styles problem: continues



Hi all,

        Following with my previous post, and after considering some tips by
Taura, I've changed my GtkStyle-based code and now use directly the RC
file for setting the background for buttons. I have the following in the
RC file:

--- RC ---
style "Jukebox_abesti_botoia_musika"
{
        bg_pixmap[NORMAL]="button_cancion.png"
        bg_pixmap[PRELIGHT] = "button_cancion.png"
        bg_pixmap[ACTIVE] = "button_cancion_pulsado.png"
}


style "Jukebox_abesti_botoia_bideoa"
{
        bg_pixmap[NORMAL]="button_cancion_video.png"
        bg_pixmap[PRELIGHT] = "button_cancion_video.png"
        bg_pixmap[ACTIVE] = "button_cancion_video_pulsado.png"
}

widget "*buttonAbestiaMusika*" style "Jukebox_abesti_botoia_musika"
widget "*buttonAbestiaBideoa*" style "Jukebox_abesti_botoia_bideoa"
--- RC end ---

Then I use gtk_widget_set_name to toggle the style of a button,
depending if it's a video-name or song-name:

--- style switch ---
        if(VIDEO)
        {
            gtk_widget_set_name(AP_botoiak[i], "buttonAbestiaBideoa");
        }
        else
        {
            gtk_widget_set_name(AP_botoiak[i], "buttonAbestiaMusika");
        }
--- style switch end ---

The background images change correctly, but when a number of changes
have ocurred, I get a 


---
Gdk-CRITICAL **: file gdkpixmap.c: line 823 (gdk_pixmap_unref):
assertion `private->ref_count > 0' failed.
---

This is quite courious, as I get the error only once for 12 buttons (it
seems that only the last one complains, even if I change 11 or 2).

After 2 errors, GTK (and my app) crashes:

---crash---
Gdk-ERROR **: BadPixmap (invalid Pixmap parameter)
  serial 9462 error_code 4 request_code 2 minor_code 0
Gdk-ERROR **: BadPixmap (invalid Pixmap parameter)
  serial 9507 error_code 4 request_code 2 minor_code 0
---crash end---

Curiously enough (!), it doesn't happen with my own modified version of
GTK 1.2.5 (I changed some of the drawing of buttons not to happen, to
prevente flikering, just drawing from my app the backgrounds, that I
separately load)

If someone has any clue about why I get those crashes, I'll love to hear
from him/her.

Thanks a lot.

-- 
Eneko Lacunza
Desarrollo y Sistemas
DJB Digital Jukebox S.L.
España




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