class ItemButton(HBox):
    def __init__(self, item, name='ItemButton'):
        HBox.__init__(self)
        self.set_name(name)
        self._key_, self._val_ = item
        self.label = Label(self._key_)
        self.button = Button(label=self._val_)
        self.pack_start(self.label,0,0,0)
        self.pack_end(self.button,1,1,5)
        map(lambda x: x.show(), [self.label, self.button])
        self.show()

    def set(self, text):
        self._val_ = text
        self.button.set_label(self._val_)
Exemple #2
0
class ItemButton(HBox):
    def __init__(self, item, name='ItemButton'):
        HBox.__init__(self)
        self.set_name(name)
        self._key_, self._val_ = item
        self.label = Label(self._key_)
        self.button = Button(label=self._val_)
        self.pack_start(self.label, 0, 0, 0)
        self.pack_end(self.button, 1, 1, 5)
        map(lambda x: x.show(), [self.label, self.button])
        self.show()

    def set(self, text):
        self._val_ = text
        self.button.set_label(self._val_)
def start_stock_button(stock_code):
    but = Button()
    but.set_property('use-stock', True)
    but.set_label(stock_code)
    return but