def __init__(self): HBox.__init__(self, False, 2) self.toolBox = VBox(False, 2) self.shapeCategoryCombo = DirCombo(join(data_path, 'shapes')) self.toolBox.pack_start(self.shapeCategoryCombo, False, False, 0) self.drawArea = DrawArea() root = self.drawArea.canvas.get_root_item() text = Text(text='Testing', x=200, y=200) rect = Rect(height=50, width=100, radius_x=10, radius_y=10, x=200, y=500, fill_color='gray') buttonText = Text(text='Button', x=250, y=525, fill_color='dark-gray', anchor=ANCHOR_CENTER) root.add_child(text, -1) root.add_child(rect, -1) root.add_child(buttonText, -1) self.pack_start(self.toolBox, False, False, 0) self.pack_start(self.drawArea, True, True, 0)
def __init__(self): HBox.__init__(self) self.set_spacing(3) #hour spin self.__hour_spin = SpinButton() self.__hour_spin.set_range(00, 99) self.__hour_spin.set_width_chars(2) self.__hour_spin.set_increments(1, 1) self.__hour_spin.set_numeric(True) self.__hour_spin.set_update_policy(UPDATE_IF_VALID) self.__hour_spin.set_snap_to_ticks(True) self.__hour_spin.connect("output", self._on_spin_output) self.__hour_spin_handler = (self.__hour_spin.connect( "value-changed", self.hour_spin_changed)) self.pack_start(self.__hour_spin) self.__hour_spin.show() #separator sep = Label(":") self.pack_start(sep, expand=False) sep.show() #minute spin self.__minute_spin = SpinButton() self.__minute_spin.set_range(00, 59) self.__minute_spin.set_width_chars(2) self.__minute_spin.set_increments(1, 1) self.__minute_spin.set_numeric(True) self.__minute_spin.set_wrap(True) self.__minute_spin.set_update_policy(UPDATE_IF_VALID) self.__minute_spin.set_snap_to_ticks(True) self.__minute_spin.connect("output", self._on_spin_output) self.__minute_spin.connect("wrapped", self._on_minute_wrap) self.__minute_spin_handler = (self.__minute_spin.connect( "value-changed", self.minute_spin_changed)) self.pack_start(self.__minute_spin) self.__minute_spin.show() #separator self.__second_sep = Label(":") self.pack_start(self.__second_sep, expand=False) self.__second_sep.show() #seconds spin self.__second_spin = SpinButton() self.__second_spin.set_range(00, 59) self.__second_spin.set_width_chars(2) self.__second_spin.set_increments(1, 1) self.__second_spin.set_numeric(True) self.__second_spin.set_wrap(True) self.__second_spin.set_update_policy(UPDATE_IF_VALID) self.__second_spin.set_snap_to_ticks(True) self.__second_spin.connect("output", self._on_spin_output) self.__second_spin.connect("wrapped", self._on_second_wrap) self.__second_spin_handler = (self.__second_spin.connect( "value-changed", self.second_spin_changed)) self.pack_start(self.__second_spin) self.__second_spin.show()
def __init__(self): HBox.__init__(self) self.set_spacing(3) #hour spin self.__hour_spin = SpinButton() self.__hour_spin.set_range(00, 99) self.__hour_spin.set_width_chars(2) self.__hour_spin.set_increments(1, 1) self.__hour_spin.set_numeric(True) self.__hour_spin.set_update_policy(UPDATE_IF_VALID) self.__hour_spin.set_snap_to_ticks(True) self.__hour_spin.connect("output", self._on_spin_output) self.__hour_spin_handler = (self.__hour_spin.connect("value-changed", self.hour_spin_changed)) self.pack_start(self.__hour_spin) self.__hour_spin.show() #separator sep = Label(":") self.pack_start(sep, expand=False) sep.show() #minute spin self.__minute_spin = SpinButton() self.__minute_spin.set_range(00, 59) self.__minute_spin.set_width_chars(2) self.__minute_spin.set_increments(1, 1) self.__minute_spin.set_numeric(True) self.__minute_spin.set_wrap(True) self.__minute_spin.set_update_policy(UPDATE_IF_VALID) self.__minute_spin.set_snap_to_ticks(True) self.__minute_spin.connect("output", self._on_spin_output) self.__minute_spin.connect("wrapped", self._on_minute_wrap) self.__minute_spin_handler = (self.__minute_spin.connect("value-changed", self.minute_spin_changed)) self.pack_start(self.__minute_spin) self.__minute_spin.show() #separator self.__second_sep = Label(":") self.pack_start(self.__second_sep, expand=False) self.__second_sep.show() #seconds spin self.__second_spin = SpinButton() self.__second_spin.set_range(00, 59) self.__second_spin.set_width_chars(2) self.__second_spin.set_increments(1, 1) self.__second_spin.set_numeric(True) self.__second_spin.set_wrap(True) self.__second_spin.set_update_policy(UPDATE_IF_VALID) self.__second_spin.set_snap_to_ticks(True) self.__second_spin.connect("output", self._on_spin_output) self.__second_spin.connect("wrapped", self._on_second_wrap) self.__second_spin_handler = (self.__second_spin.connect("value-changed", self.second_spin_changed)) self.pack_start(self.__second_spin) self.__second_spin.show()
def __init__(self, item, name='ItemLabel'): HBox.__init__(self) self.set_name(name) self._key_, self._val_ = item self.label = Label(self._key_) self.vlabel = Label(self._val_) self.pack_start(self.label, 0, 0, 0) self.pack_end(self.vlabel, 0, 0, 0) map(lambda x: x.show(), [self.label, self.vlabel]) self.show()
def __init__(self, name='UDBar'): HBox.__init__(self) self.set_name(name) self.ubutton = Button('update') self.dbutton = Button('diff') self.pack_start(self.ubutton, 0, 0, 0) self.pack_end(self.dbutton, 0, 0, 0) self.ubutton.show() self.dbutton.show() self.show()
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 __init__(self, item, name='ItemLabel'): HBox.__init__(self) self.set_name(name) self._key_, self._val_ = item self.label = Label(self._key_) self.vlabel = Label(self._val_) self.pack_start(self.label,0,0,0) self.pack_end(self.vlabel,0,0,0) map(lambda x: x.show(), [self.label, self.vlabel]) self.show()
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 __init__(self, item, name='ItemEntry'): HBox.__init__(self) self.set_name(name) self._key_, self._val_ = item self.label = Label(self._key_) self.entry = Entry() self.entry.set_text(self._val_) self.pack_start(self.label,0,0,0) self.pack_end(self.entry,0,0,0) map(lambda x: x.show(), [self.label, self.entry]) self.show()
def __init__(self, item, name='ItemEntry'): HBox.__init__(self) self.set_name(name) self._key_, self._val_ = item self.label = Label(self._key_) self.entry = Entry() self.entry.set_text(self._val_) self.pack_start(self.label, 0, 0, 0) self.pack_end(self.entry, 0, 0, 0) map(lambda x: x.show(), [self.label, self.entry]) self.show()
def __init__(self, name, default=None): HBox.__init__(self) self.set_name(name) self.label = Label(name) self.entry = Entry() self.pack_start(self.label, True, True, 0) self.add(self.entry) self.label.show() self.entry.show() if default: self.set(default) self.show()
def __init__(self, name, default=None): HBox.__init__(self) self.set_name(name) self.label = Label(name) self.entry = Entry() self.pack_start(self.label, TRUE, TRUE, 0) self.add(self.entry) self.label.show() self.entry.show() if default: self.set(default) self.show()
def __init__(self, queue): HBox.__init__(self) self.thread = DlWorker(queue, self.progress, self.set_url) self.label = Label('hello') self.pbar = ProgressBar() self.pack_start(self.label, FALSE, FALSE, 0) self.pack_end(self.pbar, FALSE, FALSE, 0) self.label.show() self.pbar.show() self.show() self._done = False self._started = False
def __init__(self): HBox.__init__(self) MDSplusWidget.__init__(self) HBox.set_homogeneous(self, False) self.node_state = CheckButton('') self.button = Button() HBox.pack_start(self, self.node_state, False, False, 0) HBox.pack_start(self, self.button, False, False, 0) HBox.pack_start(self, Label(''), True, False, 0) if not guibuilder: self.button.connect("clicked", self.popupXd) self.button.connect("realize", self.setButtonLabel)
def __init__(self): HBox.__init__(self) MDSplusWidget.__init__(self) HBox.set_homogeneous(self,False) self.node_state=CheckButton('') self.button=Button() HBox.pack_start(self,self.node_state,False,False,0) HBox.pack_start(self,self.button,False,False,0) HBox.pack_start(self,Label(''),True,False,0) if not guibuilder: self.button.connect("clicked",self.popupXd) self.button.connect("realize",self.setButtonLabel)
def __init__(self, queue): HBox.__init__(self) self.thread = DlWorker(queue, self.progress, self.set_url) self.label = Label("hello") self.pbar = ProgressBar() self.pack_start(self.label, FALSE, FALSE, 0) self.pack_end(self.pbar, FALSE, FALSE, 0) self.label.show() self.pbar.show() self.show() self._done = False self._started = False
def __init__(self, name='TraitBar'): HBox.__init__(self) self.set_name(name) self.lcombo = MyCombo() self.rcombo = MyCombo() self.lcombo.set('') self.rcombo.set('') self.cbutton = Button('clear') self.cbutton.show() self.pack_start(self.lcombo, 0, 0, 0) self.pack_end(self.rcombo, 0, 0, 0) self.add(self.cbutton) self.show()
def __init__(self, item, name='ItemEntry'): if len(item) != 2: raise Error, 'ItemEntry needs item not %s' % item field, value = item HBox.__init__(self) self.set_name(name) self.label = Label(field) self.pack_start(self.label, FALSE, FALSE, 0) self.entry = Entry() self.set(str(value)) self.pack_end(self.entry, TRUE, TRUE, 0) self.label.show() self.entry.show() self.show()
def __init__(self, item, name='ItemEntry'): if len(item) != 2: raise Error, 'ItemEntry needs item not %s' %item field, value = item HBox.__init__(self) self.set_name(name) self.label = Label(field) self.pack_start(self.label, FALSE, FALSE, 0) self.entry = Entry() self.set(str(value)) self.pack_end(self.entry, TRUE, TRUE, 0) self.label.show() self.entry.show() self.show()
def __init__(self, suites, name='SuiteBar'): HBox.__init__(self) self.set_name(name) self.lcombo = MyCombo(suites) self.lcombo.set(suites[0]) self.rcombo = MyCombo(suites) self.rcombo.set(suites[0]) self.ubutton = Button('update') self.dbutton = Button('diff') self.pack_start(self.lcombo, 0, 0, 0) self.pack_end(self.rcombo, 0, 0, 0) self.add(self.ubutton) self.add(self.dbutton) self.ubutton.show() self.dbutton.show() self.show()
def __init__(self, dir=None): HBox.__init__(self, False, 2) buttonImage = Image() buttonImage.set_from_stock(STOCK_REFRESH, ICON_SIZE_MENU) self.combo = ComboBox() self.refreshButton = Button() self.refreshButton.set_image(buttonImage) self.refreshButton.connect('clicked', self.refreshButton_clicked, None) self.model = ListStore(str) self.combo.set_model(self.model) self.dir = dir self.pack_start(self.combo, False, False, 0) self.pack_start(self.refreshButton, False, False, 0) if self.dir != None and exists(self.dir): self.refresh()