seed r96 - in trunk/examples: . ide



Author: racarr
Date: Tue Nov  4 02:49:07 2008
New Revision: 96
URL: http://svn.gnome.org/viewvc/seed?rev=96&view=rev

Log:
Add GConf example. Make IDE use GEdit settings.


Added:
   trunk/examples/gconf.js   (contents, props changed)
Modified:
   trunk/examples/Makefile.am
   trunk/examples/ide/ide.js   (contents, props changed)

Modified: trunk/examples/Makefile.am
==============================================================================
--- trunk/examples/Makefile.am	(original)
+++ trunk/examples/Makefile.am	Tue Nov  4 02:49:07 2008
@@ -4,6 +4,7 @@
           
 EXTRA_DIST = \
 	calculator.js \
+	gconf.js \
 	clutter.js \
 	introspect.js \
 	json2.js \

Added: trunk/examples/gconf.js
==============================================================================
--- (empty file)
+++ trunk/examples/gconf.js	Tue Nov  4 02:49:07 2008
@@ -0,0 +1,8 @@
+#!/usr/local/bin/seed
+Seed.import_namespace("GConf");
+
+GConf.init(null, null);
+
+client = GConf.client_get_default();
+value = client.get_string("/apps/gedit-2/preferences/editor/colors/scheme");
+Seed.print(value);

Modified: trunk/examples/ide/ide.js
==============================================================================
--- trunk/examples/ide/ide.js	(original)
+++ trunk/examples/ide/ide.js	Tue Nov  4 02:49:07 2008
@@ -5,8 +5,10 @@
 Seed.import_namespace("GtkSource");
 Seed.import_namespace("Gio");
 Seed.import_namespace("Pango");
+Seed.import_namespace("GConf");
 
 Gtk.init(null, null);
+GConf.init(null, null);
 
 Seed.include("toolbar.js");
 Seed.include("tabview.js");
@@ -83,6 +85,7 @@
 {
     var source_lang_mgr = new GtkSource.SourceLanguageManager();
     var js_lang = source_lang_mgr.get_language("js");
+    var client = GConf.client_get_default();
 
     this.source_buf = new GtkSource.SourceBuffer({language: js_lang});
     
@@ -118,7 +121,8 @@
     this.source_view.modify_font(Pango.font_description_from_string("monospace 10"));
     
     var source_style_mgr = GtkSource.style_scheme_manager_get_default();
-    var source_style = source_style_mgr.get_scheme("oblivion");
+    var gedit_style = client.get_string("/apps/gedit-2/preferences/editor/colors/scheme");
+    var source_style = source_style_mgr.get_scheme(gedit_style);
     
     this.source_buf.style_scheme = source_style;
 }



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