Gtk--: Gtk_Dialog with inheritance, virtual functions



Hi,

first of all, thanks to the people who have so far replied to my
queries. While I've solved some of my older problems, I have again
run into something that I don't quite understand. I'm using
Gtk--0.11.11 and Gtk+-1.0.5.

I have built a Dialog class (D1), that I use as a base class for my other
dialogs. Usually there is only one level of inheritance (D2). I now however

have built a class which builds on D2 (D3). In this class (which so far
is mostly an empty shell), the call to the inherited function
D1->fillActionArea (which adds the buttons) now results in the following
error messages being returned:

** WARNING **: file gtkbox.c: line 163
(gtk_box_pack_start): "child->parent == NULL"

** WARNING **: file gtkbox.c: line 163
(gtk_box_pack_start): "child->parent == NULL"

** WARNING **: file gtkbox.c: line 163
(gtk_box_pack_start): "child->parent == NULL"


Doing the same when using class D2 (rather than D3) works just fine.

I have no idea why this is happening. Obviouslsy it's got something
to do with inheritance, I just don't know what. I'd appreciate any
hints people would have for me. The actual definitions I used are
appended. If need be, I could throw together an actual test case.

Thanks
--> Robert


---------------------------- *.h definitions -----------------------------


// Dialog with an OK, APPLY and CANCEL button
class D1 : public Gtk_Dialog
     {
     public:
                    D1 (char *title=NULL, char *messagage=NULL);
                    ~D1 ();
          virtual void   buildDialogWindow (); //called by constructor

     protected:
          virtual void        fillVBox ();
          virtual void        fillActionArea ();
          virtual void        buttonCallbackOK ();
          virtual void        buttonCallbackApply ();
          virtual void        buttonCallbackCancel ();
          virtual gint        delete_event_impl (GdkEventAny *e);


          Gtk_Button          d_buttonOK,
                         d_buttonApply,
                         d_buttonCancel;
          char           *d_title,
                         *d_message;

     private:
          Gtk_Label      *d_defaultLabel;
          Gtk_HBox       *d_defaultHBox;
     };


// D1 with 3 frames
class D2 : public D1
     {
     public:
                    D2 (char *title, char *fTitle1,
                        char *fTitle2, char *fTitle3);
                    ~D2 ();
          virtual void   buildDialogWindow (); // called by constructor

     protected:
          virtual void        buttonCallbackOK ();
          virtual void        buttonCallbackApply ();
          virtual void        fillVBox ();
          virtual gint        delete_event_impl (GdkEventAny *);

          // screen will be split: 2 frames on left half, 1 frame on right
          Gtk_HBox       d_hBoxMain;     // main hbox to fill this->vbox()
          Gtk_VBox       d_vBoxLeft,     // vbox for left half of window
                         d_vBoxRight,    // vbox for right half of window
                         d_vBox1,  // vbox for frame1
                         d_vBox2,  // vbox for frame2
                         d_vBox3;  // vbox for frame3
          Gtk_Frame      d_frame1,
                         d_frame2,
                         d_frame3;
     };


// D2 with proper stuff added into the frames
class D3 : public D2
     {
     public:
                    D3 ();
                    ~D3 ();  // calls D2->buildDialogWindow()

     protected:
          virtual void   buttonCallbackOK ();
          virtual void   buttonCallbackApply ();
          virtual gint   delete_event_impl (GdkEventAny *);

          GuiBufferedDrawingArea   *d_bufDraw;
     };




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