diff --git a/PySimpleGUIWeb/PySimpleGUIWeb.py b/PySimpleGUIWeb/PySimpleGUIWeb.py
index 827235ab..f4b63d09 100644
--- a/PySimpleGUIWeb/PySimpleGUIWeb.py
+++ b/PySimpleGUIWeb/PySimpleGUIWeb.py
@@ -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
diff --git a/PySimpleGUIWeb/readme.md b/PySimpleGUIWeb/readme.md
index 4112c03c..e0ce5402 100644
--- a/PySimpleGUIWeb/readme.md
+++ b/PySimpleGUIWeb/readme.md
@@ -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.
diff --git a/docs/cookbook.md b/docs/cookbook.md
index 18877a10..f2fbf77d 100644
--- a/docs/cookbook.md
+++ b/docs/cookbook.md
@@ -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()
```
-
+
# 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])
```
+
+
# 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_'])
```
----------------------
+
+
+
+
+-------
@@ -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))
```
-
+
+
--------
@@ -782,6 +795,8 @@ while True: # Event Loop
window.Close()
```
+
+
## 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
```
+
+
+
## 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.
\ No newline at end of file