cengal.parallel_execution.coroutines.integrations.customtkinter.versions.v_0.customtkinter

 1#!/usr/bin/env python
 2# coding=utf-8
 3
 4# Copyright © 2012-2024 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>
 5# 
 6# Licensed under the Apache License, Version 2.0 (the "License");
 7# you may not use this file except in compliance with the License.
 8# You may obtain a copy of the License at
 9# 
10#     http://www.apache.org/licenses/LICENSE-2.0
11# 
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
18
19__all__ = ['prepare_mainloop']
20
21
22import sys
23import customtkinter
24
25
26"""
27Module Docstring
28Docstrings: http://www.python.org/dev/peps/pep-0257/
29"""
30
31__author__ = "ButenkoMS <gtalk@butenkoms.space>"
32__copyright__ = "Copyright © 2012-2024 ButenkoMS. All rights reserved. Contacts: <gtalk@butenkoms.space>"
33__credits__ = ["ButenkoMS <gtalk@butenkoms.space>", ]
34__license__ = "Apache License, Version 2.0"
35__version__ = "4.4.1"
36__maintainer__ = "ButenkoMS <gtalk@butenkoms.space>"
37__email__ = "gtalk@butenkoms.space"
38# __status__ = "Prototype"
39__status__ = "Development"
40# __status__ = "Production"
41
42
43def prepare_mainloop(app: customtkinter.CTk):
44    if '5.0.0' > customtkinter.__version__:
45        if app.window_exists is False:
46            app.deiconify()
47            app.window_exists = True
48    else:
49        if not app._window_exists:
50            if sys.platform.startswith("win"):
51                app._windows_set_titlebar_color(app._get_appearance_mode())
52
53                if not app._withdraw_called_before_window_exists and not app._iconify_called_before_window_exists:
54                    app.deiconify()
55
56            app._window_exists = True
def prepare_mainloop(app: customtkinter.windows.ctk_tk.CTk):
44def prepare_mainloop(app: customtkinter.CTk):
45    if '5.0.0' > customtkinter.__version__:
46        if app.window_exists is False:
47            app.deiconify()
48            app.window_exists = True
49    else:
50        if not app._window_exists:
51            if sys.platform.startswith("win"):
52                app._windows_set_titlebar_color(app._get_appearance_mode())
53
54                if not app._withdraw_called_before_window_exists and not app._iconify_called_before_window_exists:
55                    app.deiconify()
56
57            app._window_exists = True