else: dimutatys = mutatya.format_rev_mutate( mutatya.rev_mutate(ent.fetch(), False, tradgraph.state()[0]), True) #print(mutatya.format_rev_mutate(mutatya.rev_mutate(ent.fetch(), False, tradgraph.state()[0]), True)) mutatys = textwrap.fill(dimutatys, 60) print(dimutatys) msg2.config(text=dimutatys, font=('Courier', 14, 'bold')) msg = tk.Label(root, text="Gorrewgh ger kernewek a-woles mar pleg", padx=5) msg.config(font=('Open Sans', 16, 'bold')) msg.pack() # text entry bar ent = Entrybar(root) ent.pack(padx=5, pady=5) msg2 = tk.Label(root) msg2.config(bg='light yellow', fg='dark red', font=('Courier', 16, 'bold')) msg2.pack(expand=tk.YES, fill=tk.BOTH, anchor=tk.CENTER) # buttons Kwitya(root).pack(side=tk.RIGHT) tk.Button(root, text='Mutatya', font=('Open Sans', 14), command=printmform).pack(side=tk.RIGHT) tk.Button(root, text='Kopi dhe\'n Klyppbordh', font=('Open Sans', 14), command=copyclipbd).pack(side=tk.LEFT) root.mainloop()
def make_widgets(self): """ display the GUI widgets """ self.mhead = tk.Label(self, text = "Dewisyow") self.mhead.config(font=('Open Sans', 16, 'bold'), padx=5, pady=5) self.mhead.pack(side=tk.TOP, anchor=tk.NW) # choose difficulty level self.options2 = Radiobar(self, ['Es', 'Kres', 'Kales', 'Pur Gales'], vals = [1, 2, 3, 4], side=tk.TOP, justify=tk.LEFT, anchor=tk.NW, default=1) self.options2.pack(side=tk.LEFT, fill=tk.Y) self.options2.config(relief=tk.RIDGE, bd=2, padx=5) # choose whether to have addition, subtraction or either at random self.options = Radiobar(self.options2, ['Keworra po marnas', 'Keworra', 'Marnas'], side=tk.TOP, justify=tk.LEFT, anchor=tk.NW, default='Keworra po marnas') self.options.pack(side=tk.LEFT, fill=tk.Y) #self.options.config(relief=tk.RIDGE, bd=2, padx=0) self.options.config(padx=0, pady=10) self.kalettermsg = tk.Label(self.options, text="Gwask 'Dalleth'\nwosa chanjya\n" "an nivel kaletter\nrag dastalleth\n" "an apposyans.") self.kalettermsg.config(font=('Open Sans', 11), padx=5, pady=5) self.kalettermsg.pack(side=tk.TOP, fill=tk.Y) self.msg = tk.Label(self, text="Govynn:") self.msg.config(font=('Open Sans', 16, 'bold'), padx=10, pady=10) self.msg.pack(anchor=tk.W) # question self.govynn = tk.Label(self) self.govynn.pack(anchor=tk.W) self.govynn.config(fg = 'black', bg='light yellow', font=('Open Sans', 18, 'bold'), text='', padx=10, pady=10) self.govynn.pack(expand=tk.YES,fill=tk.BOTH, anchor=tk.CENTER) self.msg2 = tk.Label(self, text="Gorrewgh gorthyp yn bysies " "a-woles mar pleg:") self.msg2.config(font=('Open Sans', 16, 'bold'), padx=10, pady=10) self.msg2.pack(anchor=tk.W) # text entry bar for answer self.gorthyp = Entrybar(self) self.gorthyp.config(padx=10, pady=5) self.gorthyp.pack(anchor=tk.W) self.gorthyp.focus() # bind both Enter and the numeric keypad Enter self.master.bind('<Return>', lambda event: self.rigorthyp()) self.master.bind('<KP_Enter>', lambda event: self.rigorthyp()) # output self.msg3 = tk.Label(self) self.msg3.config(fg = 'dark red', bg='light yellow', font=('Open Sans', 18, 'bold'), text='', padx=10, pady=10) self.msg3.pack(expand=tk.YES,fill=tk.BOTH, anchor=tk.CENTER) # buttons Kwitya(self).pack(side=tk.RIGHT) tk.Button(self, text = 'Profya Gorthyp', font=('Open Sans',14), command = self.rigorthyp).pack(side=tk.RIGHT) tk.Button(self, text = 'Dalleth', font=('Open Sans', 14), command = self.dalleth).pack(side=tk.LEFT)