def __init__(self, parent, *args, **kwargs): self.name = kwargs["name"] self.table_name = kwargs["table_name"] del kwargs["name"] del kwargs["table_name"] tk.Frame.__init__(self, parent, *args, **kwargs) self.parent = parent self.parent.title("Usuń " + self.name) self.connector = Connector.getInstance() self.column_names = self.connector.get_column_names(self.table_name) self.field = tk.Entry(self.parent, width=30) self.field.grid(row=0, column=1, padx=20) field_label = tk.Label(self.parent, text=self.column_names[0]) field_label.grid(row=0, column=0, padx=20) self.submitButton = tk.Button(self.parent, text="Usuń", command=self.submit) self.submitButton.grid(row=1, column=0, pady=10, padx=10, ipadx=100) self.cancelButton = tk.Button(self.parent, text="Anuluj", command=self.close_windows) self.cancelButton.grid(row=1, column=1, pady=10, padx=10, ipadx=100)
def __init__(self, parent, *args, **kwargs): self.name = kwargs["name"] self.table_name = kwargs["table_name"] self.view_table_name = kwargs["view_table_name"] del kwargs["name"] del kwargs["table_name"] del kwargs["view_table_name"] tk.Frame.__init__(self, parent, *args, **kwargs) self.connector = Connector.getInstance() self.parent = parent self.show_buttons()
def main(): print( "Ja łaczyłem się za pomocą: ssh -L 5432:pascal.fis.agh.edu.pl:5432 [email protected]" ) root = tk.Tk() root.title("FIT PLANNER") connector = Connector() connector.connect() MainApplication(root).pack(side="top", fill="both", expand=True) root.mainloop() connector.disconnect()
def __init__(self, parent, *args, **kwargs): self.name = kwargs["name"] self.table_name = kwargs["table_name"] del kwargs["name"] del kwargs["table_name"] tk.Frame.__init__(self, parent, *args, **kwargs) self.parent = parent self.parent.title("Dodaj " + self.name) self.connector = Connector.getInstance() self.column_names = self.connector.get_column_names(self.table_name) self.field_table = [] self.counter = 0 for value in self.column_names[1:]: field = tk.Entry(self.parent, width=30) field.grid(row=self.counter, column=1, padx=20) field_label = tk.Label(self.parent, text=value) field_label.grid(row=self.counter, column=0, padx=20) self.field_table.append(field) self.counter += 1 self.submitButton = tk.Button(self.parent, text="Dodaj", command=self.submit) self.submitButton.grid(row=self.counter, column=0, pady=10, padx=10, ipadx=100) self.cancelButton = tk.Button(self.parent, text="Anuluj", command=self.close_windows) self.cancelButton.grid(row=self.counter, column=1, pady=10, padx=10, ipadx=100)