diff options
author | Mike Fulbright <msf@redhat.com> | 2002-07-22 19:30:23 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-07-22 19:30:23 +0000 |
commit | 8ae09272ddc8b74df6a7cf4360d07ff7fd053ae0 (patch) | |
tree | 8b1f53f33b68539a278412e7c1998cfe80c854fb /gui.py | |
parent | 907533a4342bcc8c4b6947b6f5555a91949840d2 (diff) | |
download | anaconda-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-x | gui.py | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -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() |