Tkinter grid problem 4-6 dinge in eine Zeilenspalte?

Fragen zu Tkinter.
Antworten
sea-live
User
Beiträge: 440
Registriert: Montag 18. Februar 2008, 12:24
Wohnort: RP

Samstag 31. Juli 2010, 19:20

Guten Tag ,mal wieder ein Problem !
Bild

Die Units MM/Inch würden wunderbar in die Zeilenspalte Shape hinein passen !
Ich bekomme sie da aber nicht Hin !
bitte um logische Hilfe.

Code: Alles auswählen

from Tkinter import *

class Application(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.grid()
        self.createWidgets()
        

    def createWidgets(self):
        self.PreviewFrame = Frame(self,bd=3)
        self.PreviewFrame.grid(row=0, column=0)
        self.PreviewCanvas = Canvas(self.PreviewFrame,width=300, height=300, bg='white', bd='3', relief = 'raised')
        self.PreviewCanvas.grid(sticky=N+S+E+W)
        self.XLine = self.PreviewCanvas.create_line(15,150,285,150, fill = 'green')
        self.YLine = self.PreviewCanvas.create_line(150,15,150,285, fill = 'green')
        self.EntryFrame = Frame(self,bd=5)
        self.EntryFrame.grid(row=0, column=1)

        self.rownumber = 0

        self.st00 = Label(self.EntryFrame, text='Eingabe Areal',width=40)
        self.st00.grid(row=self.rownumber, column=0, columnspan=2)
 
        self.rownumber += 1
        self.st000 = Label(self.EntryFrame, text='Shape')
        self.st000.grid(row=self.rownumber, column=0,sticky=W)
        self.ShapeVar = IntVar()
        self.ShapeVar.set(0)
        Radiobutton(self.EntryFrame, text='Circle', variable=self.ShapeVar, value = 0, command=self.DoIt,indicatoron=0,width=5).grid(row=self.rownumber,column=1,sticky=W)
        Radiobutton(self.EntryFrame, text=' Rect ', variable=self.ShapeVar, value = 2, command=self.DoIt,indicatoron=0,width=5).grid(row=self.rownumber,column=1,sticky=N)

        #self.rownumber += 1
        self.st13 = Label(self.EntryFrame, text='Units',width=5)
        self.st13.grid(row=self.rownumber,column=3,sticky=W)
        self.UnitVar = IntVar()
        self.UnitVar.set(1)
        Radiobutton(self.EntryFrame, text='Inch', variable=self.UnitVar, value = 0, command=self.DoIt ,indicatoron=0,width=5,).grid(row=self.rownumber+1,column=3)
        Radiobutton(self.EntryFrame, text=' MM ', variable=self.UnitVar, value = 1, command=self.DoIt ,indicatoron=0,width=5,).grid(row=self.rownumber+2,column=3,sticky=E)
        self.rownumber += 1

        self.st01 = Label(self.EntryFrame, text='Preamble')
        self.st01.grid(row=self.rownumber, column=0)
        self.PreambleVar = StringVar()
        self.PreambleVar.set('G17 G21 G90 G64 P0.01 M3 S3000 M7')
        self.Preamble = Entry(self.EntryFrame, textvariable=self.PreambleVar ,width=35)
        self.Preamble.grid(row=self.rownumber, column=1)

        self.NormalColor =  self.Preamble.cget('bg')
 
        self.quitButton = Button(self, text='Quit', command=self.quit)
        self.quitButton.grid(row=13, column=0, sticky=S)

    def DoIt(self):
        return
app = Application()
app.master.title("Test grid")
app.mainloop()

sea-live
User
Beiträge: 440
Registriert: Montag 18. Februar 2008, 12:24
Wohnort: RP

Sonntag 1. August 2010, 17:45

Na da hab ich mal das Layout etwas geändert so gehts dann mit nur 5 in einer zeile!
Bild
Antworten