PageRenderTime 111ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/beercalc/old/tabs/accounts/__init__.py

https://github.com/bjornua/beercalc
Python | 40 lines | 32 code | 7 blank | 1 comment | 2 complexity | 7cf514a2fbb66726220f75bc7e18785f MD5 | raw file
  1. # -*- coding: utf-8 -*-
  2. import gtk
  3. from .options import OptionsContainer
  4. from .store import AccountStore
  5. from .table import AccountTable
  6. class AccountBox(gtk.VBox):
  7. def __init__(self):
  8. super(type(self), self).__init__()
  9. store = AccountStore()
  10. table = AccountTable(store)
  11. vbox = gtk.VBox()
  12. hbox = gtk.HBox()
  13. scrollwin = gtk.ScrolledWindow()
  14. options = OptionsContainer(table)
  15. for parent, child in (
  16. (self, hbox),
  17. (hbox, vbox),
  18. (vbox, scrollwin),
  19. (scrollwin, table),
  20. (hbox, options),
  21. ):
  22. parent.add(child)
  23. for widget, name, value in (
  24. (self , "spacing" , 0 ),
  25. (vbox , "spacing" , 0 ),
  26. (hbox , "spacing" , 0 ),
  27. (scrollwin, "vscrollbar-policy", gtk.POLICY_ALWAYS),
  28. (scrollwin, "hscrollbar-policy", gtk.POLICY_NEVER ),
  29. (scrollwin, "shadow-type" , gtk.SHADOW_IN ),
  30. ):
  31. widget.set_property(name, value)
  32. hbox.child_set_property(options, "expand", False)
  33. hbox.child_set_property(vbox , "expand", True )