diff options
author | Mike Fulbright <msf@redhat.com> | 2002-06-25 16:33:12 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-06-25 16:33:12 +0000 |
commit | 9676ac1ecf2cdd09478099adc322716ea8913fc6 (patch) | |
tree | e637e32b39755567f487400c423bc6c411559930 /gui.py | |
parent | 63fa21d56b3e7137e409c013507513b9d9453a38 (diff) | |
download | anaconda-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-x | gui.py | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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(): |