Re: The correct way to gtk_draw?



Boris_Shingarov OTI COM writes:

I am trying to gtk_draw_check on a pixmap.  Like this:

    GtkToggleButton *toggle;
    GtkStyle *style;
    GdkPixmap *pixmap; 

toggle = gtk_toggle_button_new();
style = GTK_WIDGET(toggle)->style;
pixmap = gdk_pixmap_new (0, 12,12, 24);
gtk_draw_check (style,
                pixmap,
                GTK_STATE_NORMAL,
                GTK_SHADOW_NONE,
                0,0,
                12,12);

This dumps warnings about GC being NULL.  The weird thing is that it only 
happens on some machines and with only some theme engines.
I also tried using gtk_paint_box, to the same outcome.
What a I doing wrong?

You probably want to read the "scribble" example in the GTK tutorial,
one of the later chapters, if you haven't.

Regarding the NULL GC specifically, I would guess the problem is that
your toggle button is not realized (to be realized it needs to be in a
toplevel window).

Havoc




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