13
0
livetrax/libs/gtkmm2/tests/refcount_dialog/main.cc
Paul Davis 449aab3c46 rollback to 3428, before the mysterious removal of libs/* at 3431/3432
git-svn-id: svn://localhost/ardour2/branches/3.0@3435 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-06-02 21:41:35 +00:00

61 lines
1.0 KiB
C++

#include <gtkmm.h>
#include <gtk/gtkdialog.h>
#include <iostream>
#include <list>
class MyDialog : public Gtk::Dialog {
public:
MyDialog()
{
add_button("Ok", 0);
}
};
class MyWindow : public Gtk::Window
{
public:
MyWindow();
void on_button_clicked();
protected:
Gtk::HBox m_Box;
Gtk::Button m_Button;
};
MyWindow::MyWindow()
: m_Button("Show Dialog")
{
set_size_request(200, 200);
m_Button.signal_clicked().connect( sigc::mem_fun(*this, &MyWindow::on_button_clicked) );
m_Box.pack_start(m_Button);
add(m_Box);
}
void MyWindow::on_button_clicked()
{
{
MyDialog d;
d.run();
std::cout << "After d.run()" << std::endl;
}
std::cout << "before list_toplevel" << std::endl;
std::list<Gtk::Window*> toplevelwindows = list_toplevels();
std::cout << "after list_toplevel" << std::endl;
std::cout << "toplevelwindows.size = " << toplevelwindows.size() << std::endl;
}
int main(int argc, char* argv[])
{
Gtk::Main kit(argc, argv);
MyWindow win;
win.show_all();
kit.run(win);
return 0;
}