Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter.ttk import Frame, Style
- from tkinter import *
- import sys
- class Okno(Frame):
- def __init__(self,parent):
- super().__init__(parent)
- self.parent=parent
- self.inicjalizuj()
- def inicjalizuj(self):
- self.parent.title("Maurycy ziomal")
- self.styl=Style()
- self.styl.theme_use("default")
- self.pack(fill=BOTH, expand=1)
- def printName(event):
- print("Siema jestem \n Maurycy")
- def LeftClick(event):
- print("Left")
- def RigthClcik(event):
- print("right")
- def main():
- root = Tk()
- #root.geometry("300x300")
- #app=Okno(root)
- #theLabel = Label(root, text="This is easy ziom")
- #theLabel.pack()
- #topFrame = Frame(root)
- #topFrame.pack()
- #bottomFrame = Frame(root)
- #bottomFrame.pack(side=BOTTOM)
- #button1 = Button(topFrame, text="Button 1",fg="red")
- #button2 = Button(topFrame, text="Button 2",fg="blue")
- #button3 = Button(topFrame, text="Button 3",fg="green")
- #button4 = Button(bottomFrame, text="Button 4",fg="purple")
- #button1.pack(side=LEFT)
- #button3.pack(side=TOP)
- #button2.pack(side=LEFT)
- #button4.pack(side=BOTTOM)
- #one=Label(root, text="One", bg="red", fg="white")
- #one.pack()
- #two=Label(root, text="Two", bg="green", fg="black")
- #two.pack(fill=Y)
- #three=Label(root, text="Three", bg="blue", fg="white")
- #three.pack(side=LEFT, fill=X)
- #label_1 = Label(root, text="Nick")
- #label_2 = Label(root, text="Password")
- #entry_1 = Entry(root)
- #entry_2 = Entry(root)
- #label_1.grid(row=0, sticky=E)
- #label_2.grid(row=1, sticky=E)
- #entry_1.grid(row=0, column=1)
- #entry_2.grid(row=1, column=1)
- #c = Checkbutton(root, text="Zapamiętaj mnie")
- #c.grid(columnspan=2, column=1)
- #button_1 = Button(root, text="Wypisz imie")
- #button_1.bind("<Button-1>",printName)
- #button_1.pack()
- frame = Frame(root, width=300, height=250)
- frame.bind("<Button-1>", LeftClick)
- frame.bind("<Button-3>", RigthClcik)
- frame.pack()
- #canvas = Canvas(root, width=200, height=100)
- #canvas.pack()
- #blackline = canvas.create_line(0,0,200,50)
- #redline = canvas.create_line(0,100,200,50, fill="red")
- #greenBox = canvas.create_rectangle(25,25, 130, 60, fill="green")
- root = Tk()
- #b = Okno(root)
- tkinter.messagebox.showinfo('gitara siema',"Małpy to ziomale")
- answer = tkinter.messagebox.askquestion('Pytanie 1', 'Lubisz w dupe?')
- if answer == 'Tak':
- print('haha pedal')
- root.mainloop()
- if __name__=='__main__':
- main()
Add Comment
Please, Sign In to add comment