~gnomenu-team/gnomenu/trunk

« back to all changes in this revision

Viewing changes to src/lib/gnomenu/Menu_Widgets.py

  • Committer: helder
  • Date: 2010-06-15 01:45:50 UTC
  • Revision ID: helder@helder-laptop-20100615014550-r1p2zycy8abrtcw0
fixed bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
1700
1700
        
1701
1701
                        elif key == 113: #Left
1702
1702
                                self.Restart('previous')
1703
 
                        else:
1704
 
                                pass
1705
1703
                else:
1706
1704
                        if key == 36 or key == 65 or key == 114:        #Enter or Space or right
1707
1705
                                self.index = i
1823
1821
                self.tree1.set_spacing(0)
1824
1822
 
1825
1823
                #self.tree1.set_cursor_on_cell((0,0), focus_column=None,focus_cell=None, start_editing=False)
1826
 
                if Globals.Settings['Show_Tips']:
1827
 
                        self.model = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING, gobject.TYPE_STRING)
1828
 
                else:
1829
 
                        self.model = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING)
 
1824
                self.model = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING)
1830
1825
                self.tree1.set_events(gtk.gdk.ALL_EVENTS_MASK)
1831
1826
                self.tree1.connect("key-press-event", self.PGListButtonKey)
1832
1827
                self.tree1.connect("motion-notify-event", self.move)
1930
1925
                        self.Label.destroy()
1931
1926
                except:pass
1932
1927
                # doing the following is faster then self.model.clear()
1933
 
                if Globals.Settings['Show_Tips']:
1934
 
                        self.model = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING, gobject.TYPE_STRING)
1935
 
                else:
1936
 
                        self.model = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING)
 
1928
                self.model = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING)
1937
1929
                self.tree1.set_model(self.model)
1938
1930
                
1939
1931
 
1996
1988
 
1997
1989
                self.ScrollFrame.set_size_request(Globals.PG_buttonframedimensions[0],Globals.PG_buttonframedimensions[1])
1998
1990
                if Globals.Settings['Show_Tips']:
1999
 
                        try:
2000
 
                                comment = self.XDG.ItemComments[name]
2001
 
                        except KeyError: 
2002
 
                                comment = name
2003
 
                        self.model.insert(i,[icon,name,comment])
2004
 
                else:
2005
 
                        self.model.insert(i,[icon,name])
 
1991
                        pass
 
1992
                self.model.insert(i,[icon,name])
2006
1993
                icon = None
2007
1994
                
2008
1995
 
2063
2050
 
2064
2051
        def PGListButtonKey(self, widget, event,i=None):
2065
2052
                key = event.hardware_keycode
 
2053
                
2066
2054
                if widget == self.tree1:
 
2055
                        
2067
2056
                        if key == 36 or key == 65 or key == 114:        #Enter or Space or right
2068
 
                                selection = widget.get_selection()
2069
 
                                selection.set_mode('single')
2070
 
                                rows = selection.get_selected_rows()[1]
2071
 
                                if rows:
2072
 
                                        self.index = int(rows[0][0])
 
2057
                                selection = widget.get_selected_items()
 
2058
                                if selection != []:
 
2059
                                        self.index = int(selection[0][0])
2073
2060
                                        self.ActivateButton(event)
2074
 
        
2075
2061
                        elif key == 113: #Left
2076
2062
                                self.Restart('previous')
2077
 
                        else:
2078
 
                                pass
2079
2063
                else:
2080
2064
                        if key == 36 or key == 65 or key == 114:        #Enter or Space or right
2081
2065
                                self.index = i