示例#1
0
 def create_button(self, name, text=''):
     '''
     make a button
     @param name: the button's name, a string
     @param text: the button's tooltip text, a string
     '''
     button = ImageButton(
         app_theme.get_pixbuf("action/" + name + "_normal.png"),
         app_theme.get_pixbuf("action/" + name + "_hover.png"),
         app_theme.get_pixbuf("action/" + name + "_press.png"))
     button.connect("enter-notify-event", self._show_tooltip, text)
     button.connect("clicked", self._button_clicked, name)
     button.set_name(name)
     #button.set_size_request(28, 28)
     self.toolbox.pack_start(button)
     return button
示例#2
0
 def create_button(self, name, text=''):
     '''
     make a button
     @param name: the button's name, a string
     @param text: the button's tooltip text, a string
     '''
     button = ImageButton(
         app_theme.get_pixbuf("action/" + name + "_normal.png"),
         app_theme.get_pixbuf("action/" + name + "_hover.png"),
         app_theme.get_pixbuf("action/" + name + "_press.png"))
     button.connect("enter-notify-event", self._show_tooltip, text)
     button.connect("clicked", self._button_clicked, name)
     button.set_name(name)
     #button.set_size_request(28, 28)
     self.toolbox.pack_start(button)
     return button