~evfool/+junk/eGame

« back to all changes in this revision

Viewing changes to src/AppMenu.py

  • Committer: Robert Roth
  • Date: 2011-03-13 21:57:13 UTC
  • Revision ID: robert.roth.off@gmail.com-20110313215713-p3yo5v2r3ccjpye8
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
import gtk
 
4
from ToolButtonWithMenu import ToolButtonWithMenu
 
5
 
 
6
class AppMenu(ToolButtonWithMenu):
 
7
    @classmethod
 
8
    def create(self, stock, size, label, _menu):
 
9
        image = gtk.Image()
 
10
        image.set_from_stock(stock, size)
 
11
        return self(image, label, _menu)
 
12
    def __init__(self, image, label, _menu):
 
13
        super(AppMenu, self).__init__(image, label, _menu)
 
14
        self.connect("clicked",self.on_click)
 
15
    def on_click(self, event):
 
16
        self.menu.select_first(False)
 
17
        self.popup_menu(None)
 
18
    
 
19
                
 
20