Skip to content

Commit 3feadf4

Browse files
committed
Col alias, added theme_add_new,
1 parent ef52d9b commit 3feadf4

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

PySimpleGUIWeb/PySimpleGUIWeb.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#usr/bin/python3
22

3-
version = __version__ = "0.39.0.4 Unreleased\n , VSeparator added (spelling error), added default key for one_line_progress_meter, auto-add keys to tables & trees, Graph.draw_image now uses image_data property instead of calling set_image"
3+
version = __version__ = "0.39.0.5 Unreleased\n , VSeparator added (spelling error), added default key for one_line_progress_meter, auto-add keys to tables & trees, Graph.draw_image now uses image_data property instead of calling set_image, added theme_add_new"
44

55
port = 'PySimpleGUIWeb'
66

@@ -1544,7 +1544,7 @@ def __init__(self, file_path_name=None, **kwargs):
15441544
self.load(image)
15451545

15461546
def load(self, file_path_name):
1547-
if type(file_path_name) is bytes or len(file_path_name) > 200:
1547+
if type(file_path_name) is bytes:
15481548
try:
15491549
#here a base64 image is received
15501550
self.imagedata = base64.b64decode(file_path_name, validate=True)
@@ -2309,6 +2309,9 @@ def _GetElementAtLocation(self, location):
23092309
layout = Layout
23102310

23112311

2312+
Col = Column
2313+
2314+
23122315
# ---------------------------------------------------------------------- #
23132316
# Menu #
23142317
# ---------------------------------------------------------------------- #
@@ -7261,6 +7264,22 @@ def theme_list():
72617264
return list_of_look_and_feel_values()
72627265

72637266

7267+
def theme_add_new(new_theme_name, new_theme_dict):
7268+
"""
7269+
Add a new theme to the dictionary of themes
7270+
7271+
:param new_theme_name: text to display in element
7272+
:type new_theme_name: (str)
7273+
:param new_theme_dict: text to display in element
7274+
:type new_theme_dict: (dict)
7275+
"""
7276+
global LOOK_AND_FEEL_TABLE
7277+
try:
7278+
LOOK_AND_FEEL_TABLE[new_theme_name] = new_theme_dict
7279+
except Exception as e:
7280+
print('Exception during adding new theme {}'.format(e))
7281+
7282+
72647283
def theme_previewer(columns=12):
72657284
"""
72667285
Show a window with all of the color themes - takes a while so be patient

0 commit comments

Comments
 (0)