summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-07-22 19:30:23 +0000
committerMike Fulbright <msf@redhat.com>2002-07-22 19:30:23 +0000
commit8ae09272ddc8b74df6a7cf4360d07ff7fd053ae0 (patch)
tree8b1f53f33b68539a278412e7c1998cfe80c854fb /gui.py
parent907533a4342bcc8c4b6947b6f5555a91949840d2 (diff)
downloadanaconda-8ae09272ddc8b74df6a7cf4360d07ff7fd053ae0.tar.gz
anaconda-8ae09272ddc8b74df6a7cf4360d07ff7fd053ae0.tar.xz
anaconda-8ae09272ddc8b74df6a7cf4360d07ff7fd053ae0.zip
hack is back to make list/tree views to scroll_to correctly
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()