Merge pull request #1610 from PySimpleGUI/Dev-latest

Dev latest
This commit is contained in:
MikeTheWatchGuy 2019-06-23 14:26:20 -04:00 committed by GitHub
commit 8238fc74d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 143 additions and 127 deletions

126
readme.md
View File

@ -1,4 +1,4 @@
<!-- CREATED: 2019-06-19 16.12.46 -->
<!-- CREATED: 2019-06-23 14.19.18 -->
<!--
HOW DO I INSERT IMAGES ???
easy.
@ -691,11 +691,8 @@ There are Popup calls for single-item inputs. These follow the pattern of `Popup
- `PopupGetFolder` - get a folder name
Use these Popups instead of making a custom window to get one data value, call the Popup input function to get the item from the user. If you find the parameters are unable to create the kind of window you are looking for, then it's time for you to create your own window.
### PopupGetText
Use this Popup to get a line of text from the user.<br>
```
PopupGetText(message,The message you wish to display with the input field
default_text='', Text to initially fill into the input field
@ -812,7 +809,6 @@ def PopupAnimated(image_source,
alpha_channel=.8,
time_between_frames=0)
```
| name | meaning |
|-|-|
|image_source | The GIF file specified as a string filename or a base64 variable |
@ -1809,6 +1805,8 @@ Many of the main method calls and Element names have shortcuts. This enables yo
Basic Element. It displays text. That's it.
Text - Display some text in the window. Can be single or multiple lines but no scrolling if multiple lines.
```python
@ -1843,7 +1841,7 @@ Text(text,
|Name|Meaning|
|-|-|
|text||
|text|The text to display (required)|
|size|(common_key) (w,h) w=characters-wide, h=rows-high (Default value = (None, None))|
|auto_size_text|True if size should fit the text length (Default value = None)|
|click_submits|(Default value = False)|
@ -1862,7 +1860,6 @@ Text(text,
### Methods
@ -1888,7 +1885,6 @@ Update(value=None,
---
### Fonts
@ -1985,7 +1981,6 @@ Multiline(default_text="",
### Methods
@ -2024,7 +2019,6 @@ Update(value=None,
<!-- %!% -->
## Text Input Element | `Input == In`
@ -2082,7 +2076,6 @@ InputText(default_text="",
<!--
```python
def InputText(default_text ='',
@ -2163,8 +2156,13 @@ Update(value=None,
<br>
Get()<br>
Get() - method <br>
@ -2246,7 +2244,6 @@ Combo(values,
<!--
```
InputCombo(values,
@ -2311,7 +2308,6 @@ Update(value=None,
<!-- ```python
Update(value=None, values=None, set_to_index=None, disabled=None, readonly=None)
```
@ -2336,6 +2332,9 @@ A List Box. Provide a list of values for the user to choose one or more of. R
when a window.Read() is executed.
```python
layout = [[sg.Listbox(values=['Listbox 1', 'Listbox 2', 'Listbox 3'], size=(30, 6))]]
```
@ -2390,7 +2389,6 @@ Listbox(values,
The `select_mode` option can be a string or a constant value defined as a variable. Generally speaking strings are used for these kinds of options.
@ -2420,7 +2418,6 @@ Update(values=None,
```python
SetValue(values)
```
@ -2437,8 +2434,13 @@ SetValue(values)
<br>
GetListValues()<br>
GetListValues() - method <br>
@ -2539,7 +2541,6 @@ Slider(range=(None, None),
<!--
Slider(range=(None,None),
default_value=None,
@ -2613,7 +2614,6 @@ Update(value=None,
<!-- ```python
Update(self, value=None, range=(None, None), disabled=None, visible=None):
```
@ -2643,6 +2643,9 @@ Creates one radio button that is assigned to a group of radio buttons. Only 1 o
Radio Button Element - Used in a group of other Radio Elements to provide user with ability to select only
1 choice in a list of choices.
```python
layout = [
[sg.Radio('My first Radio!', "RADIO1", default=True),
@ -2695,7 +2698,6 @@ Radio(text,
<!--
Radio(text,
group_id,
@ -2748,7 +2750,6 @@ Update(value=None,
<!-- ```python
Update(value=None, disabled=None, visible=None)
```
@ -2813,7 +2814,6 @@ Checkbox(text,
<!-- Checkbox(text,
default=False,
size=(None, None),
@ -2914,7 +2914,6 @@ Spin(values,
<!--
Spin(values,
intiial_value=None,
@ -2978,7 +2977,6 @@ Update(value=None,
<!-- ```python
Update(value=None, values=None, disabled=None, visible=None)
```
@ -3049,7 +3047,6 @@ Image(filename=None,
<!--
```python
Image(filename=None,
@ -3105,7 +3102,6 @@ Update(filename=None,
Choose **either** a filename or in-ram data image to use to replace current image
@ -3132,7 +3128,6 @@ UpdateAnimation(source,
You can call the method without setting the `time_between_frames` value and it will show a frame and immediately move on to the next frame. This enables you to do the inter-frame timing.
@ -3274,7 +3269,6 @@ Button(button_text="",
<!-- Button(button_text=''
button_type=BUTTON_TYPE_CLOSES_WIN
target=(None, None)
@ -3555,7 +3549,6 @@ Update(text=None,
<!-- ```python
Update(text=None, button_color=(None, None), disabled=None, image_data=None, image_filename=None, visible=None)
@ -3574,8 +3567,14 @@ Update - Change the button element
GetText - Returns the current text shown on a button
<br>
GetText()<br>
GetText() - method <br>
@ -3654,7 +3653,6 @@ ButtonMenu(button_text,
<!--
```python
ButtonMenu( button_text,
@ -3742,7 +3740,6 @@ VerticalSeparator(pad=None)
<!-- %!% -->
## ProgressBar Element
The `ProgressBar` element is used to build custom Progress Bar windows. It is HIGHLY recommended that you use OneLineProgressMeter that provides a complete progress meter solution for you. Progress Meters are not easy to work with because the windows have to be non-blocking and they are tricky to debug.
@ -3847,7 +3844,6 @@ ProgressBar(max_value,
<!-- %!% -->
@ -3897,7 +3893,6 @@ Output(size=(None, None),
### Methods
@ -3917,7 +3912,6 @@ Update(value=None,
<!-- size - Size of Output Element (width, height) in characters
You should be quite familiar with these parameters by now. If not, read able another element or read about common parameters.
-->
@ -4046,7 +4040,6 @@ Column(layout,
---
```python
@ -4139,7 +4132,6 @@ Frame(title,
---
This code creates a window with a Frame and 2 buttons.
@ -4207,7 +4199,6 @@ Canvas(canvas=None,
### Matplotlib, Pyplot Integration
One such integration is with Matploplib and Pyplot. There is a Demo program written that you can use as a design pattern to get an understanding of how to use the Canvas Widget once you get it.
@ -4310,7 +4301,8 @@ Graph(canvas_size,
key=None,
tooltip=None,
right_click_menu=None,
visible=True)
visible=True,
float_values=False)
```
@ -4330,12 +4322,12 @@ Graph(canvas_size,
|tooltip|text, that will appear the you hover on (Default value = None)|
|right_click_menu|see "Right Click Menus" (Default value = None)|
|visible|set visibility state of the element (Default value = True)|
|float_values|bool: If True x,y coordinates are returned as floats, not ints|
|||
### Methods
`DrawLine` - draws a point, line, circle, oval, arc, rectangle, text <br>
@ -4373,7 +4365,6 @@ DrawLine(point_from,
```python
DrawPoint(point,
size=2,
@ -4393,7 +4384,6 @@ DrawPoint(point,
```python
DrawCircle(center_location,
radius,
@ -4415,7 +4405,6 @@ DrawCircle(center_location,
```python
DrawOval(top_left,
bottom_right,
@ -4437,7 +4426,6 @@ DrawOval(top_left,
```python
DrawArc(top_left,
bottom_right,
@ -4463,7 +4451,6 @@ DrawArc(top_left,
```python
DrawRectangle(top_left,
bottom_right,
@ -4485,7 +4472,6 @@ DrawRectangle(top_left,
```python
DrawText(text,
location,
@ -4510,8 +4496,13 @@ DrawText(text,
<br>
Erase()<br>
Erase() - method <br>
@ -4531,7 +4522,6 @@ DeleteFigure(id)
```python
Update(background_color,
visible=None)
@ -4549,7 +4539,6 @@ Update(background_color,
```python
Move(x_direction,
y_direction)
@ -4566,6 +4555,7 @@ Move(x_direction,
```python
MoveFigure(figure,
x_direction,
@ -4585,7 +4575,6 @@ MoveFigure(figure,
```python
RelocateFigure(figure,
x,
@ -4604,6 +4593,8 @@ RelocateFigure(figure,
<!--
# DrawLine(self, point_from, point_to, color='black', width=1)
# DrawPoint(self, point, size=2, color='black')
@ -4623,6 +4614,13 @@ RelocateFigure(figure,
<!-- %!% -->
## Table Element
@ -4699,7 +4697,6 @@ Table(values,
### Read return values from Table Element
The values returned from a `Window.Read` call for the Tree Element are a list of row numbers that are currently highlighted.
@ -4730,7 +4727,6 @@ Update(values=None,
---
### Known visualization problem....
@ -4803,7 +4799,6 @@ Tree(data=None,
Unlike Tables there is no standard format for trees. Thus the data structure passed to the Tree Element must be constructed. This is done using the TreeData class. The process is as follows:
* Get a TreeData Object
* "Insert" data into the tree
@ -4869,6 +4864,8 @@ View of second tab:
First we have the Tab layout definitions. They mirror what you see in the screen shots. Tab 1 has 1 Text Element in it. Tab 2 has a Text and an Input Element.
```python
tab1_layout = [[sg.T('This is inside tab 1')]]
@ -4942,6 +4939,7 @@ TabGroup(layout,
<!-- The definition of a TabGroup is -->
<!-- TabGroup(layout,
title_color=None
@ -4995,6 +4993,7 @@ Tab(title,
|||
<!--
Tab(title,
layout,
@ -5025,6 +5024,7 @@ Update(values=None,
visible=None)
```
Parameters explained:
|Name|Meaning|
@ -5039,6 +5039,24 @@ Update(values=None,
<!-- ```python
Update(disabled = None, visible=None)
```
WARNING - This Update method may not be working correctly -->
<!-- %!% -->
## Pane Element
@ -5083,7 +5101,6 @@ Pane(pane_list,
<!--
```python
@ -5827,7 +5844,6 @@ Update(menu_definition,
---
To add a menu to a Window place the `Menu` or `MenuBar` element into your layout.