GUI component interaction: Difference between revisions
Content added Content deleted
(→{{header|Python}}: Python3) |
|||
Line 2,546: | Line 2,546: | ||
===Python3 - no classes=== |
===Python3 - no classes=== |
||
{{libheader|Tkinter}} |
{{libheader|Tkinter}} |
||
{{works with|Python|3. |
{{works with|Python|3.7}} |
||
<lang python> |
<lang python> |
||
import random, tkinter.messagebox |
import random, tkinter.messagebox |
||
Line 2,552: | Line 2,552: | ||
window = Tk() |
window = Tk() |
||
window.geometry(" |
window.geometry("330x50+100+100") |
||
options = { "padx":5, "pady":5} |
options = { "padx":5, "pady":5} |
||
s=StringVar() |
s=StringVar() |
||
Line 2,575: | Line 2,575: | ||
b2 = Button(text="Random", command=rand, **options) |
b2 = Button(text="Random", command=rand, **options) |
||
b2.grid(column=2, row=0, **options) |
b2.grid(column=2, row=0, **options) |
||
⚫ | |||
⚫ | |||
===Python2 - With classes=== |
===Python2 - With classes=== |