/beercalc/old/tabs/accounts/__init__.py
Python | 40 lines | 32 code | 7 blank | 1 comment | 2 complexity | 7cf514a2fbb66726220f75bc7e18785f MD5 | raw file
- # -*- coding: utf-8 -*-
- import gtk
- from .options import OptionsContainer
- from .store import AccountStore
- from .table import AccountTable
- class AccountBox(gtk.VBox):
- def __init__(self):
- super(type(self), self).__init__()
-
- store = AccountStore()
- table = AccountTable(store)
-
- vbox = gtk.VBox()
- hbox = gtk.HBox()
- scrollwin = gtk.ScrolledWindow()
-
- options = OptionsContainer(table)
-
- for parent, child in (
- (self, hbox),
- (hbox, vbox),
- (vbox, scrollwin),
- (scrollwin, table),
- (hbox, options),
- ):
- parent.add(child)
-
- for widget, name, value in (
- (self , "spacing" , 0 ),
- (vbox , "spacing" , 0 ),
- (hbox , "spacing" , 0 ),
- (scrollwin, "vscrollbar-policy", gtk.POLICY_ALWAYS),
- (scrollwin, "hscrollbar-policy", gtk.POLICY_NEVER ),
- (scrollwin, "shadow-type" , gtk.SHADOW_IN ),
- ):
- widget.set_property(name, value)
-
- hbox.child_set_property(options, "expand", False)
- hbox.child_set_property(vbox , "expand", True )