add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / tests / child_widget_managed / main.cc
1 #include <gtkmm.h>
2
3 class MyButton : public Gtk::Button
4 {
5 public:
6     MyButton();
7     virtual ~MyButton();
8 };
9
10 MyButton::MyButton()
11 : Gtk::Button("Ok", true)
12 { }
13
14 MyButton::~MyButton()
15 {
16     g_warning("MyButtom::~MyButton()");
17 }
18
19 class ExampleWindow : public Gtk::Window
20 {
21 public:
22     ExampleWindow();
23     virtual ~ExampleWindow();
24
25 protected:
26
27     MyButton* m_button;
28 };
29
30 ExampleWindow::ExampleWindow()
31 {
32     set_default_size(150, 150);
33
34     m_button = manage(new MyButton);
35     add(*m_button);
36         
37     show_all_children();
38 }
39
40 ExampleWindow::~ExampleWindow()
41 {
42   g_warning("ExampleWindow::~ExampleWindow()");
43 }
44
45
46 int main(int argc, char* argv[])
47 {
48     Gtk::Main kit(argc, argv);
49     ExampleWindow window;
50     kit.run(window);
51     return 0;
52 }