diff --git a/readme.md b/readme.md index cf2dd530..925dc863 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ - + ## Text Input Element | `Input == In` @@ -2057,7 +2051,7 @@ InputText(default_text="", ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -2082,7 +2076,6 @@ InputText(default_text="", - ## 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. @@ -3761,7 +3758,7 @@ The return value for `OneLineProgressMeter` is: #### Progress Mater in Your window Another way of using a Progress Meter with PySimpleGUI is to build a custom window with a `ProgressBar` Element in the window. You will need to run your window as a non-blocking window. When you are ready to update your progress bar, you call the `UpdateBar` method for the `ProgressBar` element itself. - + ```python import PySimpleGUI as sg @@ -3805,7 +3802,7 @@ ProgressBar(max_value, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -3847,7 +3844,6 @@ ProgressBar(max_value, - @@ -3856,7 +3852,7 @@ The Output Element is a re-direction of Stdout. Anything "printed" will be disp Note that you will NOT see what you `print` until you call either window.Read or window.Refresh. If you want to immediately see what was printed, call window.Refresh() immediately after your print statement. - + @@ -3880,7 +3876,7 @@ Output(size=(None, None), ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -3897,7 +3893,6 @@ Output(size=(None, None), - ### Methods @@ -3907,7 +3902,7 @@ Update(value=None, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -3917,7 +3912,6 @@ Update(value=None, - @@ -4008,7 +4002,7 @@ Columns are specified in exactly the same way as a window is, as a list of lists Columns are needed when you have an element that has a height > 1 line on the left, with single-line elements on the right. Here's an example of this kind of layout: - + ![column](https://user-images.githubusercontent.com/13696193/44959988-66b92480-aec5-11e8-9c26-316ed24a68c0.jpg) @@ -4028,7 +4022,7 @@ Column(layout, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4046,7 +4040,6 @@ Column(layout, - --- ```python @@ -4088,7 +4081,7 @@ sg.Popup(event, values, line_width=200) Frames work exactly the same way as Columns. You create layout that is then used to initialize the Frame. - + ![frame element](https://user-images.githubusercontent.com/13696193/45889173-c2245700-bd8d-11e8-8f73-1e5f1be3ddb1.jpg) @@ -4117,7 +4110,7 @@ Frame(title, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4139,7 +4132,6 @@ Frame(title, - --- This code creates a window with a Frame and 2 buttons. @@ -4175,7 +4167,7 @@ window = sg.Window('Frame with buttons', font=("Helvetica", 12)).Layout(layout) In my opinion, the tkinter Canvas Widget is the most powerful of the tkinter widget. While I try my best to completely isolate the user from anything that is tkinter related, the Canvas Element is the one exception. It enables integration with a number of other packages, often with spectacular results. - + ```python @@ -4190,7 +4182,7 @@ Canvas(canvas=None, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -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. @@ -4294,7 +4285,7 @@ You can move your figures around on the canvas by supplying the Figure ID the x, This Element is relatively new and may have some parameter additions or deletions. It shouldn't break your code however. - + @@ -4310,11 +4301,12 @@ Graph(canvas_size, key=None, tooltip=None, right_click_menu=None, - visible=True) + visible=True, + float_values=False) ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -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
@@ -4360,7 +4352,7 @@ DrawLine(point_from, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4373,7 +4365,6 @@ DrawLine(point_from, - ```python DrawPoint(point, size=2, @@ -4381,7 +4372,7 @@ DrawPoint(point, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4393,7 +4384,6 @@ DrawPoint(point, - ```python DrawCircle(center_location, radius, @@ -4402,7 +4392,7 @@ DrawCircle(center_location, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4415,7 +4405,6 @@ DrawCircle(center_location, - ```python DrawOval(top_left, bottom_right, @@ -4424,7 +4413,7 @@ DrawOval(top_left, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4437,7 +4426,6 @@ DrawOval(top_left, - ```python DrawArc(top_left, bottom_right, @@ -4448,7 +4436,7 @@ DrawArc(top_left, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4463,7 +4451,6 @@ DrawArc(top_left, - ```python DrawRectangle(top_left, bottom_right, @@ -4472,7 +4459,7 @@ DrawRectangle(top_left, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4485,7 +4472,6 @@ DrawRectangle(top_left, - ```python DrawText(text, location, @@ -4495,7 +4481,7 @@ DrawText(text, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4510,8 +4496,13 @@ DrawText(text, +
-Erase()
+ +Erase() - method
+ + + @@ -4521,7 +4512,7 @@ DeleteFigure(id) ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4531,14 +4522,13 @@ DeleteFigure(id) - ```python Update(background_color, visible=None) ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4549,14 +4539,13 @@ Update(background_color, - ```python Move(x_direction, y_direction) ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4566,6 +4555,7 @@ Move(x_direction, + ```python MoveFigure(figure, x_direction, @@ -4573,7 +4563,7 @@ MoveFigure(figure, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4585,7 +4575,6 @@ MoveFigure(figure, - ```python RelocateFigure(figure, x, @@ -4593,7 +4582,7 @@ RelocateFigure(figure, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4604,6 +4593,8 @@ RelocateFigure(figure, + + ## Table Element Out of all of the Elements, it's the Table and the Tree that are the most "problematic" in the tkinter inter and Qt implementations. They're hard is my only defense. - + ```python @@ -4663,7 +4661,7 @@ Table(values, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -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. @@ -4718,7 +4715,7 @@ Update(values=None, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4730,7 +4727,6 @@ Update(values=None, - --- ### Known visualization problem.... @@ -4742,7 +4738,7 @@ If you click on the header, it can go into spasms for some tables. I don't under The Tree Element and Table Element are close cousins. Many of the parameters found in the Table Element apply to Tree Elements. In particular the heading information, column widths, etc. - + ```python @@ -4772,7 +4768,7 @@ Tree(data=None, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -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 @@ -4868,6 +4863,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')]] @@ -4920,7 +4917,7 @@ TabGroup(layout, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -4942,6 +4939,7 @@ TabGroup(layout, + + + + + + + + + + + + + + + ## Pane Element New in version 3.20 is the Pane Element, a super-cool tkinter feature. You won't find this one in PySimpleGUIQt, only PySimpleGUI. It's difficult to describe one of these things. Think of them as "Tabs without labels" that you can slide. - + ![pane3](https://user-images.githubusercontent.com/13696193/50035040-fcd50e80-ffcd-11e8-939c-df8ab8d64712.gif) @@ -5064,7 +5082,7 @@ Pane(pane_list, ``` - Parameters explained: +Parameters explained: |Name|Meaning| |-|-| @@ -5083,7 +5101,6 @@ Pane(pane_list, -