-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsamplegui.py
More file actions
37 lines (27 loc) · 743 Bytes
/
samplegui.py
File metadata and controls
37 lines (27 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- coding: utf-8 -*-
#import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
#import simplegui
#import SimpleGUICS2Pygame
#try:
# import simplegui
#except ImportError:
# import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
from SimpleGUICS2Pygame import simpleguics2pygame
name = "Welcome"
counter = 0
def greet():
global name
global counter
counter = counter + 1
def tick():
greet()
print(counter)
print("Welcome " + name)
def buttonpress():
global name
name = "man"
frame = simpleguics2pygame.create_frame("Hello", 100, 100)
timer = simpleguics2pygame.create_timer(500, tick)
frame.add_button("Click me!", buttonpress)
frame.start()
timer.start()