13
0
livetrax/libs/gtkmm2/tests/property_notification/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

44 lines
910 B
C++

#include <gtkmm.h>
#include <iostream>
void on_property_color_changed()
{
std::cout << "color property changed" << std::endl;
}
void on_property_color_changed_nicer_api()
{
std::cout << "color property changed (nicer API)" << std::endl;
}
void on_property_name_changed()
{
//Check that we don't get notification of the wrong property:
std::cout << "name property changed" << std::endl;
}
int main (int argc, char **argv)
{
Gtk::Main kit (argc, argv);
Gtk::Window window;
Gtk::ColorButton button;
button.show();
button.connect_property_changed("color", sigc::ptr_fun(&on_property_color_changed));
#ifdef GLIBMM_PROPERTIES_ENABLED
button.property_color().signal_changed().connect(sigc::ptr_fun(&on_property_color_changed_nicer_api));
#endif
button.connect_property_changed("name", sigc::ptr_fun(&on_property_name_changed));
window.add(button);
Gtk::Main::run(window);
}