[gtkmm] Problems with interface class derived from Gtk::Bin



Hi - I am having problems with a simple program I'm trying with Gtkmm. I want a Notebook, where each page contains a widget of type Foo, where Foo is an abstract class that can contain one item. This way, I can iterate through all pages of the notebook and call the same Foo->functions() on each page.

The Foo class I've written to be derived from Gtk::Bin. I then go on to derive specific classes from Foo -- like one with two text entry fields, etc...

THE PROBLEM: When I display the notebook, none of the foo class widgets display. I double-checked the packing, and it seems correct. Here is some code snippets if it helps... any ideas would be appreciated!

-Dave

class Foo : public Gtk::Bin
{
public:
 void onOK() = 0;
 void onCancel() = 0;
 void onApply() = 0;
};

class FooEntry : public Foo
{
public:
 void onOk();
 void onCancel();
 void onApply();
};

FooEntry::FooEntry()
{
 Gtk::Entry * email = manage( new Gtk::Entry() );
 Gtk::Entry * password = manage( new Gtk::Entry() );
 email->set_text("test_email test org");
 password->set_text("test_password");

 Gtk::VBox * vbox = manage( new Gtk::VBox() );
 vbox->pack_start(*email);
 vbox->pack_start(*password);
 add(*vbox); // added to parent Gtk::Bin
}

The code goes on to add an instance of FooEntry to a notebook, and then does a show_all() from the window which owns the Notebook. The FooEntry widgets do not display!

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




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