commit
052abec94e
|
@ -3125,7 +3125,7 @@ class Window:
|
||||||
except:
|
except:
|
||||||
self.TKrootDestroyed = True
|
self.TKrootDestroyed = True
|
||||||
_my_windows.Decrement()
|
_my_windows.Decrement()
|
||||||
print('ROOT Destroyed')
|
# print('ROOT Destroyed')
|
||||||
results = BuildResults(self, False, self)
|
results = BuildResults(self, False, self)
|
||||||
if results[0] != None and results[0] != timeout_key:
|
if results[0] != None and results[0] != timeout_key:
|
||||||
return results
|
return results
|
||||||
|
@ -3136,7 +3136,7 @@ class Window:
|
||||||
# print("** REALTIME PROBLEM FOUND **", results)
|
# print("** REALTIME PROBLEM FOUND **", results)
|
||||||
|
|
||||||
if self.RootNeedsDestroying:
|
if self.RootNeedsDestroying:
|
||||||
print('*** DESTROYING really late***')
|
# print('*** DESTROYING really late***')
|
||||||
self.TKroot.destroy()
|
self.TKroot.destroy()
|
||||||
# _my_windows.Decrement()
|
# _my_windows.Decrement()
|
||||||
self.LastButtonClicked = None
|
self.LastButtonClicked = None
|
||||||
|
@ -3191,7 +3191,8 @@ class Window:
|
||||||
self.TKroot.quit()
|
self.TKroot.quit()
|
||||||
self.TKroot.destroy()
|
self.TKroot.destroy()
|
||||||
except:
|
except:
|
||||||
print('DESTROY FAILED')
|
pass
|
||||||
|
# print('DESTROY FAILED')
|
||||||
return None, None
|
return None, None
|
||||||
if not self.Shown:
|
if not self.Shown:
|
||||||
self.Show(non_blocking=True)
|
self.Show(non_blocking=True)
|
||||||
|
@ -3200,10 +3201,10 @@ class Window:
|
||||||
except:
|
except:
|
||||||
self.TKrootDestroyed = True
|
self.TKrootDestroyed = True
|
||||||
_my_windows.Decrement()
|
_my_windows.Decrement()
|
||||||
print("read failed")
|
# print("read failed")
|
||||||
# return None, None
|
# return None, None
|
||||||
if self.RootNeedsDestroying:
|
if self.RootNeedsDestroying:
|
||||||
print('*** DESTROYING LATE ***', self.ReturnValues)
|
# print('*** DESTROYING LATE ***', self.ReturnValues)
|
||||||
self.TKroot.destroy()
|
self.TKroot.destroy()
|
||||||
_my_windows.Decrement()
|
_my_windows.Decrement()
|
||||||
self.Values = None
|
self.Values = None
|
||||||
|
@ -3864,8 +3865,7 @@ def BuildResultsForSubform(form, initialize_only, top_level_form):
|
||||||
value = element.ClickPosition
|
value = element.ClickPosition
|
||||||
elif element.Type == ELEM_TYPE_MENUBAR:
|
elif element.Type == ELEM_TYPE_MENUBAR:
|
||||||
if element.MenuItemChosen is not None:
|
if element.MenuItemChosen is not None:
|
||||||
top_level_form.LastButtonClicked = element.MenuItemChosen
|
button_pressed_text = top_level_form.LastButtonClicked = element.MenuItemChosen
|
||||||
button_pressed_text = top_level_form.LastButtonClicked
|
|
||||||
value = element.MenuItemChosen
|
value = element.MenuItemChosen
|
||||||
element.MenuItemChosen = None
|
element.MenuItemChosen = None
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -466,6 +466,20 @@ class Element():
|
||||||
if self.ParentForm.CurrentlyRunningMainloop:
|
if self.ParentForm.CurrentlyRunningMainloop:
|
||||||
self.ParentForm.TKroot.quit()
|
self.ParentForm.TKroot.quit()
|
||||||
|
|
||||||
|
|
||||||
|
def Update(self, widget, background_color=None, text_color=None, font=None):
|
||||||
|
style = str(widget.styleSheet())
|
||||||
|
if font is not None:
|
||||||
|
style = create_style_from_font(font)
|
||||||
|
if text_color is not None:
|
||||||
|
style += 'color: %s;' % text_color
|
||||||
|
if background_color is not None:
|
||||||
|
style += 'background-color: %s;' % background_color
|
||||||
|
# print(style)
|
||||||
|
widget.setStyleSheet(style)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
try:
|
try:
|
||||||
self.TKStringVar.__del__()
|
self.TKStringVar.__del__()
|
||||||
|
@ -539,7 +553,7 @@ class InputText(Element):
|
||||||
self.ReturnKeyHandler(None)
|
self.ReturnKeyHandler(None)
|
||||||
return
|
return
|
||||||
|
|
||||||
def Update(self, value=None, disabled=None, select=None):
|
def Update(self, value=None, disabled=None, select=None, background_color=None, text_color=None, font=None):
|
||||||
if disabled is True:
|
if disabled is True:
|
||||||
self.QT_QLineEdit.setDisabled(True)
|
self.QT_QLineEdit.setDisabled(True)
|
||||||
elif disabled is False:
|
elif disabled is False:
|
||||||
|
@ -549,6 +563,9 @@ class InputText(Element):
|
||||||
self.DefaultText = value
|
self.DefaultText = value
|
||||||
if select:
|
if select:
|
||||||
self.QT_QLineEdit.setSelection(0,QtGui.QTextCursor.End )
|
self.QT_QLineEdit.setSelection(0,QtGui.QTextCursor.End )
|
||||||
|
super().Update(self.QT_QLineEdit, background_color=background_color, text_color=text_color, font=font)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def Get(self):
|
def Get(self):
|
||||||
return self.QT_QLineEdit.text()
|
return self.QT_QLineEdit.text()
|
||||||
|
@ -2850,7 +2867,7 @@ class SystemTray:
|
||||||
elif messageicon is not None:
|
elif messageicon is not None:
|
||||||
self.TrayIcon.showMessage(title, message, messageicon, time)
|
self.TrayIcon.showMessage(title, message, messageicon, time)
|
||||||
else:
|
else:
|
||||||
self.TrayIcon.showMessage(title, message)
|
self.TrayIcon.showMessage(title, message, time)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -2915,13 +2932,15 @@ class Window:
|
||||||
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,
|
||||||
no_titlebar=False, grab_anywhere=False, keep_on_top=False, resizable=False, disable_close=False, background_image=None):
|
no_titlebar=False, grab_anywhere=False, keep_on_top=False, resizable=False, disable_close=False, background_image=None):
|
||||||
'''
|
'''
|
||||||
Window
|
|
||||||
:param title:
|
:param title:
|
||||||
:param default_element_size:
|
:param default_element_size:
|
||||||
:param default_button_element_size:
|
:param default_button_element_size:
|
||||||
:param auto_size_text:
|
:param auto_size_text:
|
||||||
:param auto_size_buttons:
|
:param auto_size_buttons:
|
||||||
:param location:
|
:param location:
|
||||||
|
:param size:
|
||||||
|
:param element_padding:
|
||||||
:param button_color:
|
:param button_color:
|
||||||
:param font:
|
:param font:
|
||||||
:param progress_bar_color:
|
:param progress_bar_color:
|
||||||
|
@ -2931,6 +2950,7 @@ class Window:
|
||||||
:param auto_close_duration:
|
:param auto_close_duration:
|
||||||
:param icon:
|
:param icon:
|
||||||
:param force_toplevel:
|
:param force_toplevel:
|
||||||
|
:param alpha_channel:
|
||||||
:param return_keyboard_events:
|
:param return_keyboard_events:
|
||||||
:param use_default_focus:
|
:param use_default_focus:
|
||||||
:param text_justification:
|
:param text_justification:
|
||||||
|
@ -2938,6 +2958,8 @@ class Window:
|
||||||
:param grab_anywhere:
|
:param grab_anywhere:
|
||||||
:param keep_on_top:
|
:param keep_on_top:
|
||||||
:param resizable:
|
:param resizable:
|
||||||
|
:param disable_close:
|
||||||
|
:param background_image:
|
||||||
'''
|
'''
|
||||||
self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT
|
self.AutoSizeText = auto_size_text if auto_size_text is not None else DEFAULT_AUTOSIZE_TEXT
|
||||||
self.AutoSizeButtons = auto_size_buttons if auto_size_buttons is not None else DEFAULT_AUTOSIZE_BUTTONS
|
self.AutoSizeButtons = auto_size_buttons if auto_size_buttons is not None else DEFAULT_AUTOSIZE_BUTTONS
|
||||||
|
|
Loading…
Reference in New Issue