Re: Custom widget children not shown

Thomas Clark wrote:
You need to have the child widgets as member objects.  If you create them as local variables of the on_expose_event function, they will be destroyed when they go out of scope.

On Sun, Dec 5, 2010 at 8:49 AM, Kees Kling <ckling upcmail nl> wrote:

2 weeks ago I wrote a mail about custom widgets, but till now nobody reacted on it , so I try again

I want to make a custom widget which has several  standard  widgets as child,  like  butoons labels, etc. First I did it on the standard way, deribing from a Gtk:;Frame and adding the widgets to the frame and that is working pretty well. But I wnat to give the user the abillity to move the set of widgets around and I got the Idea to give the widget its own Gdk::Window and I tried to change the example in the book (chapter 26.2). instead of deriving the widget from Gtk::Widget I took a Gtk::Bin object and added the childwidgets to this container. In the on_expose_event method I create a new Gdk::window and attached it to Gtk::bin. It compiles and runs without warnings, but no widgets are shown. I only noticed a an eventbox inserted in the custom widget is working, because I can connect callbacks to it .

What amI doing wrong or is the way I want to do it not possible.

Please Help

Kees Kling
My child widgets are private members of my class, so the are not out of scope

Kees Kling

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