FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PySimpleGUI/DemoPrograms/Demo_Cursor_Previewer.py at master · PySimpleGUI/PySimpleGUI · GitHub
PySimpleGUI
/
PySimpleGUI
Public
Notifications
You must be signed in to change notification settings
Fork
1.8k
Star
13.8k
Code
Issues
708
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PySimpleGUI
/
DemoPrograms
/
Demo_Cursor_Previewer.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (38 loc) · 1.27 KB
Breadcrumbs
PySimpleGUI
/
DemoPrograms
/
Demo_Cursor_Previewer.py
Copy path
File metadata and controls
50 lines (38 loc) · 1.27 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
38
39
40
41
42
43
44
45
46
47
48
49
50
import
PySimpleGUI
as
sg
"""
Demo - Preview tkinter cursors
Shows the standard tkinter cursors using Buttons
The name of the cursor is on the Button. Mouse over the Button and you'll see
what that cursor looks like.
This list of cursors is a constant defined in PySimpleGUI. The constant name is:
sg.TKINTER_CURSORS
Copyright 2018-2026 PySimpleGUI. All rights reserved.
"""
cursors
=
sg
.
TKINTER_CURSORS
# Make a layout that's 10 buttons across
NUM_BUTTONS_PER_ROW
=
10
layout
=
[[]]
row
=
[]
for
i
,
c
in
enumerate
(
cursors
):
# print(i, c)
row
.
append
(
sg
.
Button
(
c
,
size
=
(
14
,
3
),
k
=
c
))
if
((
i
+
1
)
%
NUM_BUTTONS_PER_ROW
)
==
0
:
layout
.
append
(
row
)
row
=
[]
# print(row)
# Add on the last, partial row
start
=
len
(
cursors
)
//
NUM_BUTTONS_PER_ROW
*
NUM_BUTTONS_PER_ROW
row
=
[]
for
i
in
range
(
start
,
len
(
cursors
)):
row
.
append
(
sg
.
Button
(
cursors
[
i
],
size
=
(
14
,
3
),
k
=
cursors
[
i
]))
layout
.
append
(
row
)
window
=
sg
.
Window
(
'Cursor Previewer'
,
layout
,
finalize
=
True
)
# set the cursor on each of the buttons that has the name of the cursor as the text
for
c
in
cursors
:
window
[
c
].
set_cursor
(
c
)
# The ubiquitous event loop...
while
True
:
event
,
values
=
window
.
read
()
if
event
==
sg
.
WIN_CLOSED
:
break
window
.
close
()
Back
|
FazBrowse Home
|
New Git URL