diff --git a/tkinter-enter-classed.py b/tkinter-enter-classed.py index 84d2d67..532b8e3 100644 --- a/tkinter-enter-classed.py +++ b/tkinter-enter-classed.py @@ -7,8 +7,9 @@ from tkinter import ttk from generic import sanitize, type_hosts_listed -ENTRY_LABEL = "Enter some IPs, domains, email addresses:" APP_TITLE = "Extract and look up hosts" +ENTRY_LABEL = "Enter some IPs, domains, email addresses:" +IP_LABEL = "IP => hostname" class InputFrame(ttk.Frame): @@ -37,6 +38,23 @@ class InputFrame(ttk.Frame): typed = type_hosts_listed.type_hosts(sanitized) +class LookupFrame(ttk.Frame): + def __init__(self, container): + super().__init__(container) + self.columnconfigure(0, weight=2) + + self.__create_widgets() + + def __create_widgets(self) -> None: + ttk.Label(self, text=IP_LABEL).grid(column=0, row=3) + self.ip_listbox = tk.Listbox(self).grid( + column=0, row=3, columnspan=2, sticky="nsew" + ) + + for widget in self.winfo_children(): + widget.grid(padx=0, pady=5) + + class App(tk.Tk): def __init__(self): super().__init__() @@ -54,6 +72,8 @@ class App(tk.Tk): # create the input frame input_frame = InputFrame(self) input_frame.grid(column=0, row=0) + lookup_frame = LookupFrame(self) + lookup_frame.grid(column=0, row=2) if __name__ == "__main__":