help on graphics context colors not honored? (newbie)



Hello,
 
I'm new to GTK+ programming and I may have to do some custom drawing. I have gone through the tutorial for DrawingArea at http://library.gnome.org/devel/gtk-tutorial/stable/x2472.html and did everything as written there, yet my window remains the default gray when compiled on Ubuntu 9.04. So the tutorials directives already don't work!
I've made sure it's not the exposing of the pixmap by always copying the entire pixmap, so I suspect the graphics context isn't honored. I haven't yet understood the default gcs but I also did this: gc=gdk_gc_new_with_values(pixmap,&values,values_mask); for which I defined a GdkGCValues structure with foreground.r.../g.../b...=0 and background.~=65535 and an appropriate mask. Yet the window remains gray.
In particular gdk_draw_rectangle and gdk_draw_line don't have any visual effect.
Regarding GdkColor s (for graphic contexts fore- and background), what is an allocated color?
I've noticed that the configure_event gets fired whenever my window (the window from above tutorial link) gets partially hidden, moved or selected rather than the expose_event. I thought the configure_event gets fired only when the window is resized, according to the tutorial? That would be less cpu and memory bandwidth-consuming :-)
Summarised I need help to get a primitive visible in my window in a custom color.
Thanks for any help in advance!
Lars



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