13
0
livetrax/libs/gtkmm2/tests/property_notification/main.cc
David Robillard 35fc31a1de Remove ancient/unused flowcanvas and libglademm from repository.
Update libraries to latest stable released version (except gnomecanvasmm, which is strangely packaged...).
Fixes building (at least here).


git-svn-id: svn://localhost/ardour2/trunk@2790 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-12-18 06:05:55 +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);
}