2016-04-13 22 views
1

how can i put widget next row using tkinter pack() method?? i used pack(side= LEFT) but i can't make like my upload picture . pack(side= LEFT) is only left... i can't put next row widget. i wonder..Tkinter pack() yöntemini kullanarak sonraki satır öğesini nasıl ekleyebilirim?

[I can't like this image using tkinter.. click to show image]

from tkinter import * 
app = Tk() 

app.title('') 
app.geometry("800x1200") 



Label(app, text = 'a:').pack(side= LEFT) 
a = Entry(app) 
a.insert(0, "") 
a.pack(side= LEFT) 


Label(app, text = 'b:').pack(side= LEFT) 
b = Entry(app) 
b.insert(0, "") 
b.pack(side= LEFT) 




Label(app, text = 'c:').pack(side= LEFT) 
c = Entry(app) 
c.insert(0, "") 
c.pack(side= LEFT) 



Label(app, text = 'd:').pack(side= LEFT) 
d = Entry(app) 
d.insert(0, "") 
d.pack(side= LEFT) 

Label(app, text = 'e:').pack(side= LEFT) 
e = Entry(app) 
e.insert(0, "") 
e.pack(side= LEFT) 





Label(app, text = 'f:').pack(side= LEFT) 
f = Entry(app) 
f.insert(0, "") 
f.pack(side= LEFT) 


Label(app, text = 'g:').pack(side= LEFT) 
g = Entry(app) 
g.insert(0, "") 
g.pack(side= LEFT) 


Label(app, text = 'h:').pack(side= LEFT) 
h = Entry(app) 
h.insert(0, "") 
h.pack(side= LEFT) 



Label(app, text = '').pack() 
text = Text(app, width=100,height=12) 
text.insert('1.0', "text") 
text.pack() 




Label(app, text = '').pack() 
text2 = Text(app, width=100,height=12) 
text2.insert('1.0', "text") 
text2.pack() 



Button(app, text = 'save ').pack() 

app.mainloop() 

Traceback (most recent call last): File "D:/34545.py", line 2, in Label(app, text = 'a:').pack(side= LEFT) NameError: name 'Label' is not defined

+0

Bu sayfadaki bilgileri okumak isteyebilirsiniz: [Nasıl Yapılır Kılavuzu] (https://stackoverflow.com/help/how-to-ask) böylece her zaman olduğundan emin olabilirsiniz. Sorularınız kolayca cevaplanabilir ve olabildiğince açık. Yaşadığınız sorunu çözmek için yaptığınız tüm çabaları ve bu düzeltmeleri denediğinizde ne olduğunu eklemeyi unutmayın. Ayrıca, gösteri kodunuzu ve herhangi bir hata mesajınızı da unutmayın! –

+1

Widget'larınızı gruplandırmak için ek Çerçeveler kullanın. Herhangi bir tiner eğitimi bu tür düzen sorusunu kapsar. Onlardan birini oku. Ayrıca, bu zaten SO üzerinde bir cevap ile yinelenen bir soru olabilir. – mkiever

cevap

2

, sonra tek bir çerçeve içinde düğmeler, A, B, C ve D koymak gerekir, ve düğmeler, E, F, G, pack kullanmak için ve başka bir çerçevede H. Diğer bir seçenek de bu düğmeleri grid kullanarak tek bir kareye koymak olabilir.

İlgili konular