crystalwindow 5.4__py3-none-any.whl → 5.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
crystalwindow/window.py CHANGED
@@ -122,17 +122,26 @@ class Window:
122
122
  self.root.protocol("WM_DELETE_WINDOW", self.quit)
123
123
 
124
124
  # === ICON HANDLING ===
125
- if icon and os.path.exists(icon):
125
+ # === ICON HANDLING (SAFE + DEFERRED) ===
126
+ self._icon_ref = None # prevent GC
127
+
128
+ if icon:
126
129
  try:
127
- img = tk.PhotoImage(file=icon)
128
- self.root.iconphoto(True, img)
129
- except Exception:
130
- print("⚠️ Icon load failed, using default")
131
- img = decode_logo()
132
- if img: self.root.iconphoto(True, img)
133
- else:
130
+ if isinstance(icon, str) and os.path.exists(icon):
131
+ self._icon_ref = tk.PhotoImage(file=icon, master=self.root)
132
+ elif isinstance(icon, tk.PhotoImage):
133
+ self._icon_ref = icon
134
+ if self._icon_ref:
135
+ self.root.iconphoto(True, self._icon_ref)
136
+
137
+ except Exception as e:
138
+ print("⚠️ Icon load failed, using default", e)
139
+
140
+ # fallback logo
141
+ if not self._icon_ref:
134
142
  logo = decode_logo()
135
143
  if logo:
144
+ self._icon_ref = logo
136
145
  self.root.iconphoto(True, logo)
137
146
 
138
147
  # === Canvas setup ===
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crystalwindow
3
- Version: 5.4
3
+ Version: 5.5
4
4
  Summary: A Tkinter powered window + GUI toolkit made by Crystal (ME)! Easier apps, smoother UI and all-in-one helpers!, Gui, Buttons, FileHelper, Sprites, Animations, Colors, Math, Gravity, Camera, 3D and more!
5
5
  Home-page: https://pypi.org/project/crystalwindow/
6
6
  Author: CrystalBallyHereXD
@@ -26,7 +26,7 @@ crystalwindow/sprites.py,sha256=IADCQetFDQoat3qGpKkH93TdtqqgldfHl4N0HKX1Ajc,7480
26
26
  crystalwindow/tilemap.py,sha256=endJ8KcbP9EjPvL9qWsOpV4jc_Re1yH080aUyDkwufA,3378
27
27
  crystalwindow/ver_warner.py,sha256=qEN3ulc1NixBy15FFx2R3Zu0DhyJTVJwiESGAPwpynM,3373
28
28
  crystalwindow/websearch.py,sha256=IgsoKt27yCBHeq8yFVfSq_8sEj5KP6mqn2yNRTsRw1A,5161
29
- crystalwindow/window.py,sha256=BKCoWRvMPz2wpY8gud-pI8c7KlvN213g-Z0ma9NWgYo,32004
29
+ crystalwindow/window.py,sha256=i9VRJyVVMQoLzaHbOuZHsdmtmwXRA9h-pL_Tc8Kb5XY,32327
30
30
  crystalwindow/Icons/default_icon.png,sha256=Loq27Pxb8Wb3Sz-XwtNF1RmlLNxR4TcfOWfK-1lWcII,7724
31
31
  crystalwindow/Icons/file_icons.png,sha256=kqjvz3gMaIbepW4XGrLZOjDYu-yhFbVxjvylS-0RO4U,5659
32
32
  crystalwindow/docs/getting_started.md,sha256=e_XEhJk8eatS22MX0nRX7hQNkYkwN9both1ObabZSTw,5759
@@ -40,8 +40,8 @@ crystalwindow/gametests/sandbox.py,sha256=Oo2tU2N0y3BPVa6T5vs_h9N6islhQrjSrr_78X
40
40
  crystalwindow/gametests/squaremove.py,sha256=ei6DMnvcgpOhmxbGv-Yqmx5EqiZjKbVlZhI7YbT2hY8,643
41
41
  crystalwindow/gametests/testtttagain.py,sha256=oIhK9MGgMVly_W2lRwD9Hn9WyPdd8JnX2HGrLTGZdxY,373
42
42
  crystalwindow/gametests/windowtesting.py,sha256=_9X6wnV1-_X_PtNS-0zu-k209NtFIwAc4vpxLPp7V2o,97
43
- crystalwindow-5.4.dist-info/licenses/LICENSE,sha256=Gt5cJRchdNt0guxyQMHKsATN5PM5mjuDhdO6Gzs9qQc,1096
44
- crystalwindow-5.4.dist-info/METADATA,sha256=6wY4T022wXZn77X8N6Mp-ufH454O0bKFp24tMrjvG9A,7523
45
- crystalwindow-5.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- crystalwindow-5.4.dist-info/top_level.txt,sha256=PeQSld4b19XWT-zvbYkvE2Xg8sakIMbDzSzSdOSRN8o,14
47
- crystalwindow-5.4.dist-info/RECORD,,
43
+ crystalwindow-5.5.dist-info/licenses/LICENSE,sha256=Gt5cJRchdNt0guxyQMHKsATN5PM5mjuDhdO6Gzs9qQc,1096
44
+ crystalwindow-5.5.dist-info/METADATA,sha256=ZGYHwqby96I0Z_j7qmWzCYHJt3PbhbRKE9lOWppMuUs,7523
45
+ crystalwindow-5.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
+ crystalwindow-5.5.dist-info/top_level.txt,sha256=PeQSld4b19XWT-zvbYkvE2Xg8sakIMbDzSzSdOSRN8o,14
47
+ crystalwindow-5.5.dist-info/RECORD,,