def __create_buttons_bar(self): # Send button send_button = etk.Button(label='Send') send_button.on_clicked(self.__send_button_clicked) # Connect button conn_button = etk.Button(label='Connect') conn_button.on_clicked(self.__login_window_cb) # New account button new_acc_button = etk.Button(label='New Account') new_acc_button.on_clicked(self.__new_account_button_clicked) # Appending all buttons to HBox hbox = etk.HBox(homogeneous=False) hbox.append(send_button, etk.HBox.START, etk.HBox.NONE, 0) hbox.append(conn_button, etk.HBox.START, etk.HBox.NONE, 0) hbox.append(new_acc_button, etk.HBox.START, etk.HBox.NONE, 0) return hbox
def __new_account_button_clicked(self, pointer): # Username entry self.login_username = etk.Entry() # Confirm username button confirm_username_bt = etk.Button(label='Ok') confirm_username_bt.on_clicked(self.add_account) # Username VBox vbox = etk.VBox() vbox.append(self.login_username, etk.VBox.START, etk.VBox.FILL, 0) vbox.append(confirm_username_bt, etk.VBox.END, etk.VBox.NONE, 0) # Username window self.username_window = etk.Window(title='Username', \ size_request=(190, 80), child=vbox) self.username_window.show_all()
def __login_window_cb(self, pointer): # Password entry self.login_password = etk.Entry() # Confirm login button confirm_login_bt = etk.Button(label='Ok') confirm_login_bt.on_clicked(self.__connect_button_clicked) # Login VBox vbox = etk.VBox() vbox.append(self.login_password, etk.VBox.START, etk.VBox.FILL, 0) vbox.append(confirm_login_bt, etk.VBox.END, etk.VBox.NONE, 0) # Login window self.login_window = etk.Window(title='Password', \ size_request=(190, 80), child=vbox) self.login_window.show_all()
def __init__(self, parent, **kargs): etk_obj = etk.Button() super(Button, self).__init__(parent, etk_obj=etk_obj, **kargs) self.etk_obj.connect('clicked', self.on_clicked)