Apr-02-2019, 07:30 PM
wuf, I greatly appreciate the heads up on this working with pack as well. I have tried your example and have modified my lines to have what you have modified and it is not working for whatever reason. The widget is displayed and the query inserts the data but without the margin.
Here is the code that I have modified to follow your example.
I believe it may have something to do with the frame setup which is not the same as my "window_2" setup:
Here is the code that I have modified to follow your example.
INTERIOR_BORDER = 10 output = tkinter.Listbox(window_2, width=42, height=20, bd=0, highlightthickness=0, bg = '#FFD599', fg = '#9A0615', selectmode=SINGLE) output.pack(side='left', fill='both',expand=True, padx=INTERIOR_BORDER, pady=INTERIOR_BORDER) output.place(x=210, y=195) yscroll1 = tkinter.Scrollbar(window_2, command=output.yview, orient=tk.VERTICAL) yscroll1.pack(side='left', fill='y') yscroll1.place(x=463, y=196) output.configure(yscrollcommand=yscroll1.set) output.bind('<ButtonRelease-1>', getRecipe)Am I overlooking something?
I believe it may have something to do with the frame setup which is not the same as my "window_2" setup:
main_frame = tk.Frame(self.main_win, relief='sunken', bd=1, bg = 'white') main_frame.pack(fill='both', expand=True, padx=5, pady=5)My window_2 setup uses a gif for the background:
def window_2(): root.destroy() window_2 = tkinter.Tk() image2 = 'window2.gif' bg_image2 = tkinter.PhotoImage(file=image2) w = 1024 h = 612 ws = window_2.winfo_screenwidth() hs = window_2.winfo_screenheight() x = (ws/2) - (w/2) y = (hs/2) - (h/2) window_2.geometry('%dx%d+%d+%d' % (w, h, x, y)) panel2 =tkinter.Label(window_2, image=bg_image2) panel2.pack(side='top', fill='both', expand='yes') panel2.image = bg_image2 window_2.title('Recipes')Would you have any suggestions how to get around this part?
"Often stumped... But never defeated."