Custom widget background



Hi,
I have a custom widget that does not have a window of its own, and the content to be displayed is not rectangular in shape. I am able to draw on the parent window to make the custom widget visible. How ever the rectangular area of the widget is getting initialized with the default system color and not the window background that I had set using
modify_bg(Gtk::STATE_NORMAL, Gdk::Color("#FF9900"));
I am overriding the
1. on_size_request
2. on_size_allocate and
3. on_expose_event
methods of my custom widget. Map and realize methods are not overridden since my widget has no window or children.

I got doubtful about the modify_bg and tried calling Gdk::Window::set_background inside the on_realize override of my main window after calling Gtk::Window::on_realize(). It didn't give me any errors but didn't even set the background color of the window!

What could be wrong



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