painting widget (checkbutton) lookalikes.



Hi

I'm trying to improve an existing spreadsheet-like control which paints
cells, and  if the cell is editted creates a widget inplace.

Ideally I'd like to ensure the cell when not being editting is painted
similiarly to the widget (to meet the principle of least suprise).

I've been trying the following code under debain stable (gtk+1.2.10 and
gtk+2.0.2):-

        GtkRequisition rect_size = { 7 , 13 };
        GdkRectangle   area =  { rect.GetX() , rect.GetY() ,
                                 rect.GetWidth(), rect.GetHeight() };

        static GtkWidget*    chkbox = gtk_check_button_new();

#ifdef GTK > 2
        // Gtk2.0 supports styles so overwrite the size with
        // the values from the current theme.
        gtk_widget_style_get(chkbox, "indicator_size", &rect_size, NULL);
#endif

        gtk_paint_check(gtk_widget_get_default_style(),
                        my_window,state,shadow,
                        &area,chkbox,"checkbutton",
                        dc.XLOG2DEV(rect.x) -1, rect.y -1,
                        rect_size.width, rect_size.width);


However this doesn't paint under either gtk versions in stable
altougth gtk1.2.10 as in debian testing works, although gtk2 (2.2.4)
there doesn't.

The not working behaviour is characterised by failure to draw anything 
but usefully gives many wanings. Itheh gtk1.2 case all the warnings
are 'gc != NULL' assertion failues, and in gtk2 we have GDK_IS_GC(gc) 
assertion failures . 

So what do I have to do to get gtk_paint_check() to find/create a
valid gc?

TTFN
-- 
Roger.                          Home| http://www.sandman.uklinux.net/
Master of Peng Shui.      (Ancient oriental art of Penguin Arranging)
Work|Independent Sys Consultant | http://www.computer-surgery.co.uk/
So what are the eigenvalues and eigenvectors of 'The Matrix'? --anon

Attachment: pgpkqaqS3f7Hd.pgp
Description: PGP signature



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