Re: [gtk-list] On Drawing a Red Line



> Here, I attempt to allocate a new color (red), and set the 'fg'
>(foreground) color to red, and draw the line. I do not get a red
>line, just the black background. You will note that if you uncomment
>the line where I reference the 'white_gc', the program works and I
>see the white line.

try using show_event_impl() instead of configure_event_impl(). the
latter happens before a window is mapped, the former happens after (or
just as) it gets mapped. if you really want configure_event_impl(),
you should check whether the window is mapped yet before trying to
fetch a gc from its style.

the white_gc works because its actually not owned by the widget, but
is global across all widgets, and created before any of them are.

i think.

--p



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