Apr-02-2019, 11:46 AM
Hi DT2000
My sample is also working with pack only:
My sample is also working with pack only:
import tkinter as tk class Application(object): INTERIOR_BORDER = 10 def __init__(self, mainm_win): self.main_win = main_win self.build() def build(self): main_frame = tk.Frame(self.main_win, relief='sunken', bd=1, bg='white') main_frame.pack(fill='both', expand=True, padx=5, pady=5) list_item_values = ["one", "two", "three", "four", "five"]*5 listbox = tk.Listbox(main_frame, width=42, height=20, bd=0, highlightthickness=0) listbox.pack(side='left', fill='both',expand=True, padx=self.INTERIOR_BORDER, pady=self.INTERIOR_BORDER) listbox.insert('end', *list_item_values) yscroll1 = tk.Scrollbar(main_frame, command=listbox.yview, orient=tk.VERTICAL) yscroll1.pack(side='left', fill='y') listbox.configure(yscrollcommand=yscroll1.set) listbox.bind('<ButtonRelease-1>', self.get_recipe) def get_recipe(self, event=None): print("Get Recipe") if __name__ == "__main__": main_win = tk.Tk() main_win.title("Listbox with internal border") app = Application(main_win) main_win.mainloop()wuf :-)