Re: [Java-gnome-developer] Problem getting change notifications from GConf
Brought to you by:
afcowie
From: Mark H. <mh...@ti...> - 2006-11-27 13:11:20
|
I've not tried, but I'd expect that this is integrated with the glib main loop, so you only get notifications when one of your threads is running gtk.main(). On 11/27/06, Pierre-Charles David <pc...@gm...> wrote: > Hi all, > > I'm trying to use the gconf bindings (libgconf-java-2.12.5) from Java. > It works well when requesting values, but I can't seem to get > notifications of changes. I'm new both to java-gnome and gconf itself, > so I may be missing something obvious. > > Below is the code I am running. While it is waiting on the last line, > I run gconf-editor and manually change the (boolean) value of the key > "/apps/baobab/properties/enable_home_monitor"; I was expecting my > listener to be called, but it is not. Am I doing something wrong / > misunderstanding gconf, or is this feature not supported yet? > > Thanks in advance. > > public static void main(String[] args) throws Exception { > ConfClient cc = ConfClient.getInstance(); > cc.addDirectory("/apps/baobab/properties", > ConfClientPreloadType.RECURSIVE); > System.out.println(cc.get("/apps/baobab/properties/enable_home_monitor")); > cc.addListener(new ConfClientListener() { > public void clientNotify(ConfEntry entry) { > System.out.println(entry.getKey() + " = " + entry.getValue()); > } > }, "/apps/baobab/properties"); > new BufferedReader(new InputStreamReader(System.in)).readLine(); > } > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > |