[Skencil-commits] r802 - in skencil/branches/skencil-0.6/src/Sketch: . UI
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Sun Feb 6 21:36:54 CET 2011
Author: bh
Date: 2011-02-06 21:36:54 +0100 (Sun, 06 Feb 2011)
New Revision: 802
Modified:
skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py
skencil/branches/skencil-0.6/src/Sketch/UI/skapp.py
skencil/branches/skencil-0.6/src/Sketch/__init__.py
Log:
Fetch the gtk settings only when instantiating a TkApplication.
The color and font settings are made available as attributes of the
application object. Adapt the mainwindow code accordingly.
Now the gtkutils code is not called from the main Sketch package anymore
and importing it will not try to run the gtk sub-processes at all.
Modified: skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py 2011-02-06 20:32:29 UTC (rev 801)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py 2011-02-06 20:36:54 UTC (rev 802)
@@ -599,10 +599,10 @@
vbar.grid(in_ = frame, column = 2, row = 1, sticky = 'ns')
hbar = Scrollbar(frame, orient = HORIZONTAL)
hbar.grid(in_ = frame, column = 1, row = 2, sticky = 'ew')
- hrule = ruler.Ruler(root, ruler.HORIZONTAL, Sketch.ui_colors)
+ hrule = ruler.Ruler(root, ruler.HORIZONTAL, self.application.ui_colors)
hrule.grid(in_ = frame, column = 1, row = 0, sticky = 'ew',
columnspan = 2)
- vrule = ruler.Ruler(root, ruler.VERTICAL, Sketch.ui_colors)
+ vrule = ruler.Ruler(root, ruler.VERTICAL, self.application.ui_colors)
vrule.grid(in_ = frame, column = 0, row = 1, sticky = 'ns',
rowspan = 2)
tmp = Frame(frame, name = 'rulercorner')
Modified: skencil/branches/skencil-0.6/src/Sketch/UI/skapp.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/skapp.py 2011-02-06 20:32:29 UTC (rev 801)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/skapp.py 2011-02-06 20:36:54 UTC (rev 802)
@@ -20,6 +20,7 @@
from Sketch.warn import pdebug
from Sketch import _, config, plugins, Publisher, gtkutils
import Sketch
+import Sketch.gtkutils
from Sketch.Graphics import document
from Sketch.const import CLIPBOARD
@@ -104,10 +105,13 @@
self.root = Tk(screenName = screen_name,
baseName = self.tk_basename,
className = self.tk_class_name)
-
- gtkutils.set_ui_fonts(self.root, Sketch.ui_fonts)
- gtkutils.set_ui_colors(self.root, Sketch.ui_colors)
-
+
+ self.ui_fonts = Sketch.gtkutils.get_gtk_fonts()
+ self.ui_colors = Sketch.gtkutils.ColorScheme()
+
+ gtkutils.set_ui_fonts(self.root, self.ui_fonts)
+ gtkutils.set_ui_colors(self.root, self.ui_colors)
+
# Reset locale again to make sure we get properly translated
# messages if desired by the user. For some reason it may
# have been reset by Tcl/Tk.
Modified: skencil/branches/skencil-0.6/src/Sketch/__init__.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/__init__.py 2011-02-06 20:32:29 UTC (rev 801)
+++ skencil/branches/skencil-0.6/src/Sketch/__init__.py 2011-02-06 20:36:54 UTC (rev 802)
@@ -53,10 +53,6 @@
pass
_ = gettext
-import gtkutils
-ui_fonts = gtkutils.get_gtk_fonts()
-ui_colors = gtkutils.ColorScheme()
-
import _sketch
from _sketch import Point, Polar, PointType
NullPoint = Point(0, 0)
More information about the Skencil-commits
mailing list