Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 784c611

Browse files
committed
Dialogs and there windows were still confused in some spots. Fixed.
1 parent def0d8d commit 784c611

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

Mac/Lib/EasyDialogs.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,27 +220,28 @@ def __init__(self, title="Working...", maxval=100, label="", id=263):
220220
self.maxval = maxval
221221
self.curval = -1
222222
self.d = GetNewDialog(id, -1)
223+
self.w = self.d.GetDialogWindow()
223224
self.label(label)
224225
self._update(0)
225226
self.d.AutoSizeDialog()
226227
self.title(title)
227-
self.d.GetDialogWindow().ShowWindow()
228+
self.w.ShowWindow()
228229
self.d.DrawDialog()
229230

230231
def __del__( self ):
231-
self.d.BringToFront()
232-
self.d.HideWindow()
232+
self.w.BringToFront()
233+
self.w.HideWindow()
234+
del self.w
233235
del self.d
234236

235237
def title(self, newstr=""):
236238
"""title(text) - Set title of progress window"""
237-
w = self.d.GetDialogWindow()
238-
w.BringToFront()
239-
w.SetWTitle(newstr)
239+
self.w.BringToFront()
240+
self.w.SetWTitle(newstr)
240241

241242
def label( self, *newstr ):
242243
"""label(text) - Set text in progress box"""
243-
self.d.GetDialogWindow().BringToFront()
244+
self.w.BringToFront()
244245
if newstr:
245246
self._label = lf2cr(newstr[0])
246247
text_h = self.d.GetDialogItemAsControl(2)

0 commit comments

Comments
 (0)