PageRenderTime 631ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/beercalc/view/menubar.py

https://github.com/bjornua/beercalc
Python | 33 lines | 22 code | 10 blank | 1 comment | 0 complexity | 7aa39ff4cfc2c58bc4c88df6931a48f7 MD5 | raw file
  1. # -*- coding: utf-8 -*-
  2. import gtk
  3. class MenuBar(gtk.MenuBar):
  4. def __init__(self):
  5. super(type(self), self).__init__()
  6. self.append(FileMenu())
  7. self.append(HelpMenu())
  8. class FileMenu(gtk.MenuItem):
  9. def __init__(self):
  10. super(type(self), self).__init__(u"_Filer")
  11. self.menu = gtk.Menu()
  12. self.set_submenu(self.menu)
  13. save = gtk.MenuItem(u"_Gem")
  14. quit = gtk.MenuItem(u"_Afslut")
  15. self.menu.append(save)
  16. self.menu.append(quit)
  17. class HelpMenu(gtk.MenuItem):
  18. def __init__(self):
  19. super(type(self), self).__init__(u"_Hjælp")
  20. self.menu = gtk.Menu()
  21. self.set_submenu(self.menu)
  22. about = gtk.MenuItem(u"_Om BeerCalc")
  23. self.menu.append(about)