I'm trying to combine some frames in a GUI as a toolbar and content area. Currently I'm on windows and using python 3, and I want preferrably my app to work on *nix and mac as well.
The problem is that in the following app, when I resize it the toolbar area is increasing/decreasing, and the content area is staying the same. I would like the opposite to happen. In other words, the area with the 'up' button shouldn't be resized, but the area with the 'down' button should.
My reasoning is that since the lower area, b, is using a sticky in all directions, and the upper button is sticking north, so the lower area should be resized.
Thanks for your help!
from tkinter import * class app( Frame ): def __init__( self, master=None ): Frame.__init__( self, master ) self.grid( sticky='nswe' ) self.top = root.winfo_toplevel() self.top.rowconfigure( 0, weight=1 ) self.top.columnconfigure( 0, weight=1 ) self.rowconfigure( 0, weight=1 ) self.columnconfigure( 0, weight=1 ) a = Button( self, text="up" ) a.grid( row=0, column=0, sticky='n') self.b = Canvas( self, bg='black' ) self.b.grid( row=1, column=0, sticky='nswe' ) c = Button( self.b, text="down" ) c.grid( sticky='nswe') d = self.b.create_window( 10, 10, window=c, anchor=NW ) if __name__ == "__main__": root = Tk() appl = app( master=root ) appl.mainloop()