Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ka_widget.py
diff options
context:
space:
mode:
authorThomas Jourdan <b.vehikel@googlemail.com>2009-12-06 12:37:03 (GMT)
committer Thomas Jourdan <b.vehikel@googlemail.com>2009-12-06 12:37:03 (GMT)
commitbcde11455168a07de8a3b17f2a4d77ce8931e75d (patch)
treea5ba40242065b6c68940311f0d5335ab4656baa0 /ka_widget.py
parent572b826a4446ce3d44a57f4d29a9edeca086df42 (diff)
Layers are now arranged as a tree data structure.
Diffstat (limited to 'ka_widget.py')
-rw-r--r--ka_widget.py59
1 files changed, 59 insertions, 0 deletions
diff --git a/ka_widget.py b/ka_widget.py
new file mode 100644
index 0000000..e70a977
--- /dev/null
+++ b/ka_widget.py
@@ -0,0 +1,59 @@
+# coding: UTF8
+# Copyright 2009 Thomas Jourdan
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+import gtk
+import gtk.glade
+
+class KandidWidget(object):
+ """
+ inv: self._widget_tree is not None
+ """
+
+ def __init__(self, main_view):
+ # Create GUI and attach that widget to our window
+ # Load Glade XML
+ self._widget_tree = gtk.glade.XML("kandid.glade")
+
+ # Get Window
+ window1 = self._widget_tree.get_widget('window1')
+ # Get Windows child
+ window1_child = window1.get_child()
+
+ # Remove the widget's parent
+ if window1_child.parent:
+ window1_child.parent.remove(window1_child)
+
+ # self.widget will be attached to the Activity
+ # This can be any GTK widget except a window
+ main_view.pack_start(window1_child)
+
+ # Display everything
+ window1_child.show()
+ main_view.show()
+# try:
+# ka_debug.info('set_canvas(self._main_view) [%s]' % (self._main_view))
+# self.set_canvas(self._main_view)
+# except:
+# traceback.print_exc(file=sys.__stderr__)
+# ka_debug.err('failed sugar 0.86 set_canvas [%s] [%s] [%s]' % \
+# (sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2]))
+
+ def getWidget_tree(self):
+ return self._widget_tree
+
+ widget_tree = property(getWidget_tree)
+