Index: mygtk.py ================================================================== --- mygtk.py +++ mygtk.py @@ -133,11 +133,11 @@ for attr,val in list(cell[3].items()): col.add_attribute(rend, attr, val) # next datapos += 1 - __print__(cell) + __print__(dbg.INFO, cell) # add column to treeview widget.append_column(col) # finalize widget widget.set_search_column(5) #?? widget.set_search_column(4) #?? @@ -156,12 +156,12 @@ for var in xrange(2, len(desc)): vartypes.append(desc[var][1]) # content types rowmap.append(desc[var][0]) # dict{} column keys in entries[] list # create gtk array storage ls = gtk.ListStore(*vartypes) # could be a TreeStore, too - __print__(vartypes) - __print__(rowmap) + __print__(dbg.UI, vartypes) + __print__(dbg.DATA, rowmap) # prepare for missing values, and special variable types defaults = { str: "", unicode: "", @@ -172,11 +172,15 @@ if gtk.gdk.Pixbuf in vartypes: pix_entry = vartypes.index(gtk.gdk.Pixbuf) # sort data into gtk liststore array for row in entries: -# row["search_col"] = "white" + + # defaults + row["deleted"] = 0 + row["search_col"] = "#ffffff" + row["search_set"] = 0 # generate ordered list from dictionary, using rowmap association row = [ row.get( skey , defaults[vartypes[i]] ) for i,skey in enumerate(rowmap) ] # autotransform string -> gtk image object Index: st2.py ================================================================== --- st2.py +++ st2.py @@ -93,11 +93,11 @@ # add library path sys.path.insert(0, "/usr/share/streamtuner2") # pre-defined directory for modules sys.path.insert(0, ".") # pre-defined directory for modules # gtk modules -from mygtk import pygtk, gtk, gobject, ui_file, mygtk +from mygtk import pygtk, gtk, gobject, ui_file, mygtk, ver as GTK_VER # custom modules from config import conf # initializes itself, so all conf.vars are available right away from config import __print__, dbg import ahttp @@ -561,11 +561,14 @@ # right-click ? if event.button >= 3: path = treeview.get_path_at_pos(int(event.x), int(event.y))[0] treeview.grab_focus() treeview.set_cursor(path, None, False) - main.streamactions.popup(None, None, None, event.button, event.time) + if GTK_VER == 2: + main.streamactions.popup(None, None, None, event.button, event.time) + else: + main.streamactions.popup(None, None, None, None, event.button, event.time) return None # we need to pass on to normal left-button signal handler else: return False # this works better as callback function than as class - because of False/Object result for event trigger @@ -574,13 +577,13 @@ # encapsulates references to gtk objects AND properties in main window class auxiliary_window(object): def __getattr__(self, name): - if main.__dict__.has_key(name): + if name in main.__dict__: return main.__dict__[name] - elif StreamTunerTwo.__dict__.has_key(name): + elif name in StreamTunerTwo.__dict__: return StreamTunerTwo.__dict__[name] else: return main.get_widget(name) """ allows to use self. and main. almost interchangably """