Skip to content

Commit

Permalink
Merge pull request #58 from jjdenis/more_alt_text
Browse files Browse the repository at this point in the history
Changes look good.  i'll try them out a bit.
  • Loading branch information
robertlugg committed Jan 24, 2015
2 parents 4c49332 + eba4544 commit 8b98a1b
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 376 deletions.
267 changes: 181 additions & 86 deletions easygui/boxes/alt_text_box.py

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions easygui/boxes/choice_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

__choiceboxMultipleSelect = None


def __choicebox(msg, title, choices):
"""
internal routine to support choicebox() and multchoicebox()
Expand Down Expand Up @@ -201,7 +202,7 @@ def __choicebox(msg, title, choices):
# --- run it! -----
boxRoot.mainloop()
try:
boxRoot.quit()
boxRoot.destroy()
except:
pass
return __choiceboxResults
Expand Down Expand Up @@ -288,4 +289,4 @@ def __choiceboxClearAll(event):
def __choiceboxSelectAll(event):
global choiceboxWidget, choiceboxChoices

choiceboxWidget.selection_set(0, len(choiceboxChoices) - 1)
choiceboxWidget.selection_set(0, len(choiceboxChoices) - 1)
2 changes: 1 addition & 1 deletion easygui/boxes/diropen_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def diropenbox(msg=None, title=None, default=None):
f = ut.tk_FileDialog.askdirectory(
parent=localRoot, title=title, initialdir=default, initialfile=None
)
localRoot.quit()
localRoot.destroy()
if not f:
return None
return os.path.normpath(f)
Expand Down
2 changes: 1 addition & 1 deletion easygui/boxes/fileopen_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def fileopenbox(msg=None, title=None, default='*', filetypes=None, multiple=Fals
else:
f = os.path.normpath(ret_val)

localRoot.quit()
localRoot.destroy()

if not f:
return None
Expand Down
2 changes: 1 addition & 1 deletion easygui/boxes/filesave_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def filesavebox(msg=None, title=None, default="", filetypes=None):
initialfile=initialfile, initialdir=initialdir,
filetypes=filetypes
)
localRoot.quit()
localRoot.destroy()
if not f:
return None
return os.path.normpath(f)
5 changes: 3 additions & 2 deletions easygui/boxes/fillable_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
entryWidget = None
okButton = None


def __fillablebox(msg, title="", default="", mask=None, image=None, root=None):
"""
Show a box in which a user can enter some text.
Expand Down Expand Up @@ -127,7 +128,7 @@ def __fillablebox(msg, title="", default="", mask=None, image=None, root=None):
# -------- after the run has completed ----------------------------------
if root:
root.deiconify()
boxRoot.quit() # button_click didn't destroy boxRoot, so we do it now
boxRoot.destroy() # button_click didn't destroy boxRoot, so we do it now
return __enterboxText


Expand All @@ -153,4 +154,4 @@ def __enterboxRestore(event):
global entryWidget

entryWidget.delete(0, len(entryWidget.get()))
entryWidget.insert(0, __enterboxDefaultText)
entryWidget.insert(0, __enterboxDefaultText)
4 changes: 2 additions & 2 deletions easygui/boxes/multi_fillable_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __multfillablebox(msg="Fill in values for the fields.", title=" ", fields=()
boxRoot.mainloop() # run it!

# -------- after the run has completed ----------------------------------
boxRoot.quit() # button_click didn't destroy boxRoot, so we do it now
boxRoot.destroy() # button_click didn't destroy boxRoot, so we do it now
return __multenterboxText


Expand All @@ -141,4 +141,4 @@ def __multenterboxGetText(event):
__multenterboxText = list()
for entryWidget in entryWidgets:
__multenterboxText.append(entryWidget.get())
boxRoot.quit()
boxRoot.quit()
2 changes: 1 addition & 1 deletion easygui/boxes/text_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __textboxOK(event):

# this line MUST go before the line that destroys boxRoot
areaText = textArea.get(0.0, 'end-1c')
boxRoot.quit()
boxRoot.destroy()
return areaText # return __replyButtonText


Expand Down
277 changes: 0 additions & 277 deletions easygui/boxes/updatable_text_box.py

This file was deleted.

6 changes: 3 additions & 3 deletions easygui/easygui.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

if __name__ == '__main__':
from boxes.demo import egdemo
#egdemo()
egdemo()

from boxes.alt_text_box import demo_textbox
demo_textbox()
# from boxes.alt_text_box import demo_textbox
# demo_textbox()

0 comments on commit 8b98a1b

Please sign in to comment.