commit
7a61e96f34
|
@ -477,7 +477,6 @@ class InputText(Element):
|
|||
super().__init__(ELEM_TYPE_INPUT_TEXT, size=size, background_color=bg, text_color=fg, key=key, pad=pad,
|
||||
font=font, tooltip=tooltip, visible=visible, size_px=size_px)
|
||||
|
||||
# def InputTextCallback(self, widget:remi.gui.TextInput, value, keycode):
|
||||
def InputTextCallback(self,widget, key, keycode, ctrl, shift, alt):
|
||||
# print(f'text widget value = {widget.get_value()}')
|
||||
# widget.set_value('')
|
||||
|
@ -490,23 +489,20 @@ class InputText(Element):
|
|||
|
||||
|
||||
def Update(self, value=None, disabled=None):
|
||||
if disabled is True:
|
||||
self.TKEntry['state'] = 'disabled'
|
||||
elif disabled is False:
|
||||
self.TKEntry['state'] = 'normal'
|
||||
if value is not None:
|
||||
try:
|
||||
self.TKStringVar.set(value)
|
||||
except:
|
||||
pass
|
||||
self.DefaultText = value
|
||||
self.Widget.set_value(str(value))
|
||||
if disabled is True:
|
||||
self.Widget.set_enabled(False)
|
||||
elif disabled is False:
|
||||
self.Widget.set_enabled(True)
|
||||
|
||||
def Get(self):
|
||||
return self.TKStringVar.get()
|
||||
return self.Widget.get_value()
|
||||
|
||||
def SetFocus(self):
|
||||
try:
|
||||
self.TKEntry.focus_set()
|
||||
# TODO NOT IMPLEMENTED YET
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
|
||||
|
@ -4032,10 +4028,8 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
|||
|
||||
# ------------------------- COLUMN element ------------------------- #
|
||||
if element_type == ELEM_TYPE_COLUMN:
|
||||
print('adding column')
|
||||
element = element # type: Column
|
||||
element.Widget = column_widget = remi.gui.VBox()
|
||||
|
||||
if element.Justification.startswith('c'):
|
||||
print('CENTERING')
|
||||
column_widget.style['align-items'] = 'center'
|
||||
|
@ -4048,30 +4042,6 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
|||
PackFormIntoFrame(element, column_widget, toplevel_form)
|
||||
tk_row_frame.append(element.Widget)
|
||||
|
||||
# if element.Scrollable:
|
||||
# col_frame = TkScrollableFrame(tk_row_frame,
|
||||
# element.VerticalScrollOnly) # do not use yet! not working
|
||||
# PackFormIntoFrame(element, col_frame.TKFrame, toplevel_form)
|
||||
# col_frame.TKFrame.update()
|
||||
# if element.Size == (None, None): # if no size specified, use column width x column height/2
|
||||
# col_frame.canvas.config(width=col_frame.TKFrame.winfo_reqwidth(),
|
||||
# height=col_frame.TKFrame.winfo_reqheight() / 2)
|
||||
# else:
|
||||
# col_frame.canvas.config(width=element.Size[0], height=element.Size[1])
|
||||
#
|
||||
# if not element.BackgroundColor in (None, COLOR_SYSTEM_DEFAULT):
|
||||
# col_frame.canvas.config(background=element.BackgroundColor)
|
||||
# col_frame.TKFrame.config(background=element.BackgroundColor, borderwidth=0,
|
||||
# highlightthickness=0)
|
||||
# col_frame.config(background=element.BackgroundColor, borderwidth=0, highlightthickness=0)
|
||||
# else:
|
||||
# col_frame = tk.Frame(tk_row_frame)
|
||||
# PackFormIntoFrame(element, col_frame, toplevel_form)
|
||||
#
|
||||
# col_frame.pack(side=tk.LEFT, padx=element.Pad[0], pady=element.Pad[1], expand=True, fill='both')
|
||||
# if element.BackgroundColor != COLOR_SYSTEM_DEFAULT and element.BackgroundColor is not None:
|
||||
# col_frame.configure(background=element.BackgroundColor, highlightbackground=element.BackgroundColor,
|
||||
# highlightcolor=element.BackgroundColor)
|
||||
# ------------------------- TEXT element ------------------------- #
|
||||
elif element_type == ELEM_TYPE_TEXT:
|
||||
element = element # type: Text
|
||||
|
@ -4089,7 +4059,6 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
|
|||
element.Widget.onclick.connect(element.ChangedCallback)
|
||||
tk_row_frame.append(element.Widget)
|
||||
|
||||
|
||||
# ------------------------- BUTTON element ------------------------- #
|
||||
elif element_type == ELEM_TYPE_BUTTON:
|
||||
element = element # type: Button
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
![Python Version](https://img.shields.io/badge/Python-3.x-yellow.svg)
|
||||
|
||||
![Python Version](https://img.shields.io/badge/PySimpleGUIWeb_-0.5.0-orange.svg?longCache=true&style=for-the-badge)
|
||||
![Python Version](https://img.shields.io/badge/PySimpleGUIWeb_-0.7.0-orange.svg?longCache=true&style=for-the-badge)
|
||||
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ This Readme is for information ***specific to*** the Web port of PySimpleGUI.
|
|||
PySimpleGUIWeb enables you to run your PySimpleGUI programs in your web browser. It utilizes a package called Remi to achieve this amazing package.
|
||||
|
||||
|
||||
## Engineering Pre-Release Version 0.5.0
|
||||
## Engineering Pre-Release Version 0.7.0
|
||||
|
||||
[Announcements of Latest Developments](https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/142)
|
||||
|
||||
|
@ -166,6 +166,15 @@ New features
|
|||
* Autosize Button Text
|
||||
|
||||
|
||||
## 0.6.0 PySimpleGUIWeb 3-Feb-2019
|
||||
|
||||
* Changed Remi port to 0 so will always get a new free port
|
||||
|
||||
## 0.7.0 PySimpleGUIWeb 3-Feb-2019
|
||||
|
||||
* Completed `InputText.Update` method so that more demos can be run
|
||||
|
||||
|
||||
# Design
|
||||
# Author
|
||||
Mike B.
|
||||
|
|
|
@ -19,6 +19,12 @@ with
|
|||
There is a short section in the Readme with instruction on installing PySimpleGUI
|
||||
|
||||
If you like this Cookbook, then you'll LOVE the 100+ sample programs that are just like these. You'll find them in the GitHub at http://www.PySimpleGUI.com. These Recipes are simply several of those programs displayed in document format.
|
||||
|
||||
# Experimental repl.it Embedded Windows
|
||||
|
||||
You'll find a few of these Recipes are running in your browser window using PySimpleGUIWeb. They are included so that you can immediately play around with the SDK before installing one of the PySimpleGUI variants on your computer.
|
||||
|
||||
This is a new capability for PySimpleGUI that has only very recently been started. Only a few of the elements are operational using PySimpleGUIWeb. So, be prepared for some bugs. It's got a ways to go, but still seemed valuable to include.
|
||||
|
||||
# Copy these design patterns!
|
||||
|
||||
|
@ -119,7 +125,7 @@ while True: # Event Loop
|
|||
window.Close()
|
||||
```
|
||||
|
||||
|
||||
<iframe height="800px" width="100%" src="https://repl.it/@PySimpleGUI/Design-Pattern-2B-Persistent-Window-with-Updates?lite=false" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
|
||||
|
||||
|
||||
# Simple Data Entry - Return Values As List
|
||||
|
@ -146,6 +152,8 @@ Same GUI screen except the return values are in a list instead of a dictionary a
|
|||
print(event, values[0], values[1], values[2])
|
||||
```
|
||||
|
||||
<iframe height="800px" width="100%" src="https://repl.it/@PySimpleGUI/Cookbook-Return-Values-as-List?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
|
||||
|
||||
# Simple data entry - Return Values As Dictionary
|
||||
A simple GUI with default values. Results returned in a dictionary.
|
||||
|
||||
|
@ -172,7 +180,11 @@ A simple GUI with default values. Results returned in a dictionary.
|
|||
|
||||
print(event, values['_NAME_'], values['_ADDRESS_'], values['_PHONE_'])
|
||||
```
|
||||
---------------------
|
||||
|
||||
|
||||
<iframe height="800px" width="100%" src="https://repl.it/@PySimpleGUI/Cookbook-Return-Values-As-Dictionary?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
|
||||
|
||||
-------
|
||||
|
||||
|
||||
|
||||
|
@ -333,7 +345,8 @@ while True:
|
|||
timer_running = not timer_running
|
||||
window.FindElement('_OUTPUT_').Update('{:02d}:{:02d}.{:02d}'.format((i // 100) // 60, (i // 100) % 60, i % 100))
|
||||
```
|
||||
|
||||
|
||||
<iframe height="800px" width="100%" src="https://repl.it/@PySimpleGUI/Cookbook-Timer?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
|
||||
|
||||
--------
|
||||
|
||||
|
@ -782,6 +795,8 @@ while True: # Event Loop
|
|||
window.Close()
|
||||
```
|
||||
|
||||
<iframe height="800px" width="100%" src="https://repl.it/@PySimpleGUI/Cookbook-Compound-Element?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
|
||||
|
||||
## Multiple Windows
|
||||
|
||||
This recipe is a design pattern for multiple windows where the first window is not active while the second window is showing. The first window is hidden to discourage continued interaction.
|
||||
|
@ -956,6 +971,9 @@ There are a number of features used in this Recipe including:
|
|||
|
||||
window.FindElement('input').Update(keys_entered) # change the window to reflect current key string
|
||||
```
|
||||
|
||||
<iframe height="800px" width="100%" src="https://repl.it/@PySimpleGUI/Cookbook-Keypad-Touchscreen-Entry?lite=true" scrolling="no" frameborder="no" allowtransparency="true" allowfullscreen="true" sandbox="allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-modals"></iframe>
|
||||
|
||||
|
||||
## Animated Matplotlib Graph
|
||||
|
||||
|
@ -1533,6 +1551,8 @@ That's all... Run your `my_program.exe` file on the Windows machine of your choo
|
|||
|
||||
Your EXE file should run without creating a "shell window". Only the GUI window should show up on your taskbar.
|
||||
<!--stackedit_data:
|
||||
eyJoaXN0b3J5IjpbNzE3MDQ5NjYwLC02Nzk1NDk2NzUsLTMzOT
|
||||
M3MTM1Ml19
|
||||
eyJoaXN0b3J5IjpbLTEzNTc5NjUyNTUsLTk0Mjc2ODgzNywtMz
|
||||
UwNzA2ODE4LC0xOTgzMjAzNjMwLC0xMDAwMjc2OTU0LC0xNDAy
|
||||
ODQwOTg2LDY2ODc4OTc0OSwtMTE3NDc5OTg5Miw3MTcwNDk2Nj
|
||||
AsLTY3OTU0OTY3NSwtMzM5MzcxMzUyXX0=
|
||||
-->
|
Loading…
Reference in New Issue