summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/gui.py b/gui.py
index 2ffef865c..1f2ecbaf2 100755
--- a/gui.py
+++ b/gui.py
@@ -75,6 +75,39 @@ if iutil.getArch() == 'sparc':
elif iutil.getArch() == 's390':
stepToClass["bootloader"] = ("zipl_gui", "ZiplWindow")
+
+#
+# HACK to make treeview work
+#
+
+def setupTreeViewFixupIdleHandler(view, store):
+ id = {}
+ id["id"] = gtk.idle_add(scrollToIdleHandler, (view, store, id))
+
+def scrollToIdleHandler((view, store, iddict)):
+ if not view or not store or not iddict:
+ return
+
+ try:
+ id = iddict["id"]
+ except:
+ return
+
+ selection = view.get_selection()
+ if not selection:
+ return
+
+ model, iter = selection.get_selected()
+ if not iter:
+ return
+
+ path = store.get_path(iter)
+ col = view.get_column(0)
+ view.scroll_to_cell(path, col, gtk.TRUE, 0.5, 0.5)
+
+ if id:
+ gtk.idle_remove(id)
+
# setup globals
def processEvents():
gtk.gdk.flush()