Skip to content

Commit 2a84d92

Browse files
authored
Merge pull request PySimpleGUI#4980 from PySimpleGUI/Dev-latest
Dev latest
2 parents 717940a + de8e046 commit 2a84d92

6 files changed

Lines changed: 992 additions & 374 deletions

File tree

PySimpleGUI.py

Lines changed: 204 additions & 111 deletions
Large diffs are not rendered by default.

docs/call reference.md

Lines changed: 96 additions & 79 deletions
Large diffs are not rendered by default.

docs/index.md

Lines changed: 195 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3496,9 +3496,61 @@ And the window it creates looks like this:
34963496

34973497
# Elements
34983498

3499-
You will find information on Elements and all other classes and functions are located near the end of this manual. They are in 1 large section of the readme, in alphabetical order for easy lookups. This section's discussion of Elements is meant to teach you how they work. The other section has detailed call signatures and parameter definitions.
3500-
3501-
"Elements" are the building blocks used to create windows. Some GUI APIs use the term "Widget" to describe these graphic elements.
3499+
You will find information on Elements and all other classes and functions are located in the Call Reference Tab of the documentation.
3500+
3501+
"Elements" are the building blocks used to create windows. Some GUI APIs use the term "Widget" to describe these graphic elements. So that it's clear when a PySimpleGUI *Element* is being referenced versus an underlying GUI Framework's *Widget*. PySimpleGUI Elements map to a GUI Framework Widget, usually in a 1-to-1 manner. For example, a Text Element is implemented in tkinter using a Label Widget.
3502+
3503+
## Table of Elements in Tkinter Port
3504+
3505+
Each port of PySimpleGUI has a core set of Elements as well as port-specific elements. Some port-specific elements include the Dial element in the Qt port, and the Pane element in the tkinter port.
3506+
3507+
| Element Name | Aliases | tkinter Widget | Description |
3508+
| :------------------ | :----------------------------- | :------------- | :------------------------ |
3509+
| Text | T, Txt | tk.Label | One or more lines of Text |
3510+
| Input | I, In, InputText | tk.Entry | Single line text input |
3511+
| Combo | DD, Drop, DropDown, InputCombo | | |
3512+
| OptionMenu | InputOptionMenu | | |
3513+
| Multiline | ML, MLine | | |
3514+
| Output | | | |
3515+
| Radio | R, Rad | | |
3516+
| Checkbox | CB, CBox, Check | | |
3517+
| Spin | Sp | | |
3518+
| Button | B, Btn | | |
3519+
| Image | Im | | |
3520+
| Canvas | | | |
3521+
| Column | Col | | |
3522+
| Frame | Fr | | |
3523+
| Tab | | | |
3524+
| TabGroup | | | |
3525+
| Pane | | | |
3526+
| Graph | G | | |
3527+
| Slider | Sl | | |
3528+
| Listbox | LB, LBox | | |
3529+
| Menu | MenuBar, Menubar | | |
3530+
| MenubarCustom | | | |
3531+
| ButtonMenu | BM, BMenu | | |
3532+
| Titlebar | | | |
3533+
| ProgressBar | PBar, Prog, Progress | | |
3534+
| Table | | | |
3535+
| Tree | | | |
3536+
| VerticalSeparator | VSep, VSeparator | | |
3537+
| HorizontalSeparator | HSep, HSeparator | | |
3538+
| StatusBar | SBar | | |
3539+
| Sizegrip | SGrip | | |
3540+
| Push | P, Stretch | | |
3541+
| VPush | VP, VStretch | | |
3542+
| Sizer | | | |
3543+
3544+
## Layout Helper Functions
3545+
3546+
Your Window's layout is composed of lists of Elements. In addition to elements, these Layout Help Functions may also be present in a layout definition
3547+
3548+
| Layout Helper | Description |
3549+
| :------------ | :---------------------------------------------------------------------------------------------------------------------------------------- |
3550+
| pin | "Pins" an element to a location in a layout. If element transitions from invisible to visible, pin ensures element is in correct location |
3551+
| vtop | Vertically align element or row of elements to the top of the row |
3552+
| vbottom | Vertically align element or row of elements to the bottom of the row |
3553+
| vcenter | Vertically align element or row of elements to the center of the row |
35023554

35033555
- Text
35043556
- Single Line Input
@@ -3510,29 +3562,6 @@ You will find information on Elements and all other classes and functions are lo
35103562
- Read window
35113563
- Close window ("Button" & all shortcut buttons)
35123564
- Realtime
3513-
- Checkboxes
3514-
- Radio Buttons
3515-
- Listbox
3516-
- Slider
3517-
- Multi-line Text Input/Output
3518-
- Multi-line Text Output (not on tkinter version)
3519-
- Scroll-able Output
3520-
- Vertical Separator
3521-
- Progress Bar
3522-
- Option Menu
3523-
- Menu
3524-
- ButtonMenu
3525-
- Frame
3526-
- Column
3527-
- Graph
3528-
- Image
3529-
- Table
3530-
- Tree
3531-
- Tab, TabGroup
3532-
- StatusBar
3533-
- Pane
3534-
- Stretch (Qt only)
3535-
- Sizer (plain PySimpleGUI only)
35363565

35373566
## Keys
35383567

@@ -5568,29 +5597,159 @@ You can also set the cursor for the Window as a whole, including the margins and
55685597

55695598
## Valid Cursor Strings
55705599

5571-
`X_cursor, arrow, based_arrow_down, based_arrow_up, boat, bogosity, bottom_left_corner, bottom_right_corner, bottom_side, bottom_tee, box_spiral, center_ptr, circle, clock, coffee_mug, cross, cross_reverse, crosshair, diamond_cross, dot, dotbox, double_arrow, draft_large, draft_small, draped_box, exchange, fleur, gobbler, gumby, hand1, hand2, heart, icon, iron_cross, left_ptr, left_side, left_tee, leftbutton, ll_angle, lr_angle, man, middlebutton, mouse, pencil, pirate, plus, question_arrow, right_ptr, right_side, right_tee, rightbutton, rtl_logo, sailboat, sb_down_arrow, sb_h_double_arrow, sb_left_arrow, sb_right_arrow, sb_up_arrow, sb_v_double_arrow, shuttle, sizing, spider, spraycan, star, target, tcross, top_left_arrow, top_left_corner, top_right_corner, top_side, top_tee, trek, ul_angle, umbrella, ur_angle, watch, xterm`
5600+
```
5601+
X_cursor
5602+
arrow
5603+
based_arrow_down
5604+
based_arrow_up
5605+
boat
5606+
bogosity
5607+
bottom_left_corner
5608+
bottom_right_corner
5609+
bottom_side
5610+
bottom_tee
5611+
box_spiral
5612+
center_ptr
5613+
circle
5614+
clock
5615+
coffee_mug
5616+
cross
5617+
cross_reverse
5618+
crosshair
5619+
diamond_cross
5620+
dot
5621+
dotbox
5622+
double_arrow
5623+
draft_large
5624+
draft_small
5625+
draped_box
5626+
exchange
5627+
fleur
5628+
gobbler
5629+
gumby
5630+
hand1
5631+
hand2
5632+
heart
5633+
icon
5634+
iron_cross
5635+
left_ptr
5636+
left_side
5637+
left_tee
5638+
leftbutton
5639+
ll_angle
5640+
lr_angle
5641+
man
5642+
middlebutton
5643+
mouse
5644+
pencil
5645+
pirate
5646+
plus
5647+
question_arrow
5648+
right_ptr
5649+
right_side
5650+
right_tee
5651+
rightbutton
5652+
rtl_logo
5653+
sailboat
5654+
sb_down_arrow
5655+
sb_h_double_arrow
5656+
sb_left_arrow
5657+
sb_right_arrow
5658+
sb_up_arrow
5659+
sb_v_double_arrow
5660+
shuttle
5661+
sizing
5662+
spider
5663+
spraycan
5664+
star
5665+
target
5666+
tcross
5667+
top_left_arrow
5668+
top_left_corner
5669+
top_right_corner
5670+
top_side
5671+
top_tee
5672+
trek
5673+
ul_angle
5674+
umbrella
5675+
ur_angle
5676+
watch
5677+
xterm
5678+
5679+
```
55725680

55735681
## No Cursor
55745682

5575-
To specify no cursor should be shown, the cursor `'no'` can be used on some platforms
5683+
If you want your mouse cursor to be invisible, then use the **string** `"none"` and your element or window will not show any cursor.
55765684

55775685
## Windows OS Specific
55785686

55795687
One windows, these cursors map to native Windows cursors:
55805688

5581-
`arrow, center_ptr, crosshair, fleur, ibeam, icon, sb_h_double_arrow, sb_v_double_arrow, watch, xterm`
5689+
```
5690+
arrow
5691+
center_ptr
5692+
crosshair
5693+
fleur
5694+
ibeam
5695+
icon
5696+
sb_h_double_arrow
5697+
sb_v_double_arrow
5698+
watch
5699+
xterm
5700+
```
55825701

5583-
And these are also available:
5702+
These are also available:
55845703

5585-
`no, starting, size, size_ne_sw, size_ns, size_nw_se, size_we, uparrow, wait`
5704+
```
5705+
no
5706+
starting
5707+
size
5708+
size_ne_sw
5709+
size_ns
5710+
size_nw_se
5711+
size_we
5712+
uparrow
5713+
wait
5714+
```
55865715

55875716
## Mac OS Specific
55885717

5589-
`arrow, cross, crosshair, ibeam, plus, watch, xterm`
5590-
5591-
And these additional native cursors are available for the Mac
5592-
5593-
`copyarrow, aliasarrow, contextualmenuarrow, text, cross-hair, closedhand, openhand, pointinghand, resizeleft, resizeright, resizeleftright, resizeup, resizedown, resizeupdown, none, notallowed, poof, countinguphand, countingdownhand, countingupanddownhand, spinning`
5718+
```
5719+
arrow
5720+
cross
5721+
crosshair
5722+
ibeam
5723+
plus
5724+
watch
5725+
xterm
5726+
```
5727+
5728+
These additional native cursors are available for the Mac
5729+
5730+
```
5731+
copyarrow
5732+
aliasarrow
5733+
contextualmenuarrow
5734+
text
5735+
cross-hair
5736+
closedhand
5737+
openhand
5738+
pointinghand
5739+
resizeleft
5740+
resizeright
5741+
resizeleftright
5742+
resizeup
5743+
resizedown
5744+
resizeupdown
5745+
none
5746+
notallowed
5747+
poof
5748+
countinguphand
5749+
countingdownhand
5750+
countingupanddownhand
5751+
spinning
5752+
```
55945753

55955754
# Keyboard & Mouse Capture
55965755

0 commit comments

Comments
 (0)