Gio::Settings get notified about changes



I am trying to use Gio::Settings to get notified about changes to a
particular property value, doing something like

   class X {
      public:
         X();   
      private:
         Glib::RefPtr<Gio::Settings> settings;
         void                        handler();
   }

   X::X() 
      {
      settings =
         Gio::Settings::create("org.cinnamon.desktop.interface"); 
 
      settings->connect_property_changed("text-scaling-factor",
                              sigc::mem_fun(*this, &X::handler));
      }

   void X::handler()
      {
      // do something with changed setting.
      }

However, the X::handler() is never called when I change the setting. 

I did check that if I monitor the setting with

  gsettings monitor org.cinnamon.desktop.interface text-scaling-factor

and make a change using e.g. dconf-editor I can see that the value
changes.

Any ideas on what I'm doing wrong? Or is there someone with a simple
Gio::Settings example able to help me out? (Would, incidentally, make a
good addition to the gtkmm book.) Thanks!

Cheers,
Kasper


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