summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-06-25 16:33:12 +0000
committerMike Fulbright <msf@redhat.com>2002-06-25 16:33:12 +0000
commit9676ac1ecf2cdd09478099adc322716ea8913fc6 (patch)
treee637e32b39755567f487400c423bc6c411559930 /gui.py
parent63fa21d56b3e7137e409c013507513b9d9453a38 (diff)
downloadanaconda-9676ac1ecf2cdd09478099adc322716ea8913fc6.tar.gz
anaconda-9676ac1ecf2cdd09478099adc322716ea8913fc6.tar.xz
anaconda-9676ac1ecf2cdd09478099adc322716ea8913fc6.zip
fun wiz bang idle handler to make scroll_to_cell work yay dont do this at home kids
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/gui.py b/gui.py
index 83427f97e..9e618d13e 100755
--- a/gui.py
+++ b/gui.py
@@ -76,6 +76,33 @@ elif iutil.getArch() == 's390':
# setup globals
+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()
+ 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)
+
+
+
def processEvents():
gtk.gdk.flush()
while gtk.events_pending():