Merge pull request #680 from MikeTheWatchGuy/Dev-latest
new Window parameter size sets initial window size
This commit is contained in:
commit
2c479a3268
|
@ -2794,7 +2794,7 @@ class ErrorElement(Element):
|
||||||
class Window:
|
class Window:
|
||||||
|
|
||||||
def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size=(None, None),
|
def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size=(None, None),
|
||||||
auto_size_text=None, auto_size_buttons=None, location=(None, None), button_color=None, font=None,
|
auto_size_text=None, auto_size_buttons=None, location=(None, None), size=(None, None), button_color=None, font=None,
|
||||||
progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False,
|
progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False,
|
||||||
auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, force_toplevel=False,
|
auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, force_toplevel=False,
|
||||||
alpha_channel=1, return_keyboard_events=False, use_default_focus=True, text_justification=None,
|
alpha_channel=1, return_keyboard_events=False, use_default_focus=True, text_justification=None,
|
||||||
|
@ -2872,6 +2872,7 @@ class Window:
|
||||||
self.TimerCancelled = False
|
self.TimerCancelled = False
|
||||||
self.DisableClose = disable_close
|
self.DisableClose = disable_close
|
||||||
self._Hidden = False
|
self._Hidden = False
|
||||||
|
self._Size = size
|
||||||
|
|
||||||
# ------------------------- Add ONE Row to Form ------------------------- #
|
# ------------------------- Add ONE Row to Form ------------------------- #
|
||||||
def AddRow(self, *args):
|
def AddRow(self, *args):
|
||||||
|
@ -4771,6 +4772,8 @@ def ConvertFlexToTK(MyFlexForm):
|
||||||
pass
|
pass
|
||||||
PackFormIntoFrame(MyFlexForm, master, MyFlexForm)
|
PackFormIntoFrame(MyFlexForm, master, MyFlexForm)
|
||||||
# ....................................... DONE creating and laying out window ..........................#
|
# ....................................... DONE creating and laying out window ..........................#
|
||||||
|
if MyFlexForm._Size != (None, None):
|
||||||
|
master.geometry("%sx%s" % (MyFlexForm._Size[0], MyFlexForm._Size[1]))
|
||||||
screen_width = master.winfo_screenwidth() # get window info to move to middle of screen
|
screen_width = master.winfo_screenwidth() # get window info to move to middle of screen
|
||||||
screen_height = master.winfo_screenheight()
|
screen_height = master.winfo_screenheight()
|
||||||
if MyFlexForm.Location != (None, None):
|
if MyFlexForm.Location != (None, None):
|
||||||
|
|
Loading…
Reference in New Issue