Python Tkinter Layout Management with Grids -


for few days, i'm trying set simple application tkinter , have problems choose between pack, grid frames , widgets.

here mockup of app. decided delete 2 buttons "générer" don't pay attention that.

http://www.gilawhost.com/images/taajvonq.png

i have 3 frames : framematrix (for checkboxes), frameimage (for flashcode) , framelink bottom part.

those frames implemented grids. exemple link part (bottom), have :

labellink = labelframe(framelink, text='mini lien', padx=5, pady=5) labelminilien = label(framelink, text = "http://minilien.fr/").grid(row=0, column=0) entrylink = entry(framelink, text=self.flashcode.lien).grid(row=0, column=1) buttonlink = button(framelink, text="suivre le lien").grid(row=0, column=2) 

however, don't know how put 3 frames together. main frame is

self.frame=frame(root) 

and tried set frames below

framematrix=frame(self.frame).grid(row=0, column=0) frameimage=frame(self.frame).grid(row=0, column=1) framelink=frame(self.frame).grid(row=1, column=0, columnspan=2) 

if can me, tried several others things nothing correct code above, frames overlap if grid of each frame same.

thanks

the easiest imo use pack. pack perfect sort of layout, have frames fill complete sides of area. it's better (and arguably easier) separate widget creation widget layout)

for example:

frameline = frame(...) framematrix = frame(...) frameimage = frame(...) ... framelink.pack(side="bottom", fill="x") framematrix.pack(side="left", fill="both") frameimage.pack(side="right", fill="both") 

you'll want add expand=true 1 or more of widgets, depending on sort of resize behavior desire.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -