Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
df92528
Initial refactor and tests of the text_box class (and derived classes)
zadacka Apr 24, 2022
f361aba
remove BindArrows which don't seem to work (just generate errors when…
zadacka Apr 28, 2022
d7f1ce6
rename test requirements file so it sits next to regular requirements…
zadacka Apr 28, 2022
7fc779b
inline get_num_lines() which basically just called a tk internal method
zadacka Apr 28, 2022
f5f6238
refactor FillableBox: title goes before default (like all the other b…
zadacka Apr 28, 2022
5c261ee
Use an AbstractBox to DRY out the five custom box classes
zadacka Apr 28, 2022
efb2b76
Bugfix? x_pressed for choice_box.py had wrong signature
zadacka Apr 28, 2022
85fedbc
fixes to button box so it works with the AbstractBox parent
zadacka Apr 28, 2022
73a3807
add __name__ == main driver to text_box.py
zadacka Apr 28, 2022
383c338
removed 'x_pressed' callback which didn't seem to work at all
zadacka Apr 28, 2022
132b51d
refactor all the boxes to return a self.return_value which can then b…
zadacka Apr 28, 2022
e5d13e9
refactor all boxes to use the same cancel_button_pressed (except Butt…
zadacka Apr 28, 2022
2d18105
choice_box.py: various tidy-ups
zadacka Apr 30, 2022
cccfd52
text_box.py: update docstrings, refactor, change parameter 'codebox' …
zadacka Apr 30, 2022
817ce1c
all boxes: pull callback (self._user_specified_callback) up to the ba…
zadacka Apr 30, 2022
5ca8935
WIP rfactor of text box (incomplete!!)
zadacka Apr 30, 2022
7829ca0
Handle Close Window (X button) actions correctly
zadacka May 2, 2022
07320ae
More changes to text_box - about as much as I can push into AbstractBox
zadacka May 3, 2022
3011550
More changes to text_box:
zadacka May 4, 2022
2dae214
refactor multi_fillable_box
zadacka May 4, 2022
aaf3b3b
refactor fillable_box.py
zadacka May 5, 2022
df3e1de
refactor choice_box.py - including removal of the (unused?) keyboard …
zadacka May 5, 2022
b30f048
minor refactor to button_box.py
zadacka May 5, 2022
2a11bb2
import sooner from collections.abc
tomhea Aug 2, 2022
d2aab78
make sure boxRoot isn't None
tomhea Oct 6, 2023
313e15d
Update version information.
raoyi Jul 10, 2024
dee0d51
Update about.py
raoyi Jul 10, 2024
8e8fd15
Initial refactor and tests of the text_box class (and derived classes)
zadacka Apr 24, 2022
1c51350
convert some Unittest format tests to Pytest but intermittent tk impo…
zadacka Mar 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
python:
- "2.7"
# - "2.7" # killed it to simplify a lot of things ... hopefully everyone is on Py3.x now
- "3.4"
- "3.5"
- "3.6"
Expand All @@ -14,4 +14,4 @@ services:
# command to run tests
script: pytest

install: pip install -r test-requirements.txt
install: pip install -r requirements_for_tests.txt
20 changes: 10 additions & 10 deletions easygui/boxes/about.py → HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

"""

.. moduleauthor:: easygui developers and Stephen Raymond Ferg
Expand All @@ -10,7 +11,7 @@
except (SystemError, ValueError, ImportError):
from derived_boxes import codebox

eg_version = '0.98.2-RELEASED'
eg_version = '0.98.3-RELEASED'
egversion = eg_version


Expand All @@ -24,6 +25,11 @@ def abouteasygui():


EASYGUI_ABOUT_INFORMATION = '''
0.98.3
========================================================================
Update collections.abc import location (old location was deprecated since version 3.3, removed in version 3.10)
See: https://docs.python.org/3.9/library/collections.html#module-collections
for details Add some unit test coverage and test automation for TravisCI.

0.98.2
========================================================================
Expand All @@ -48,13 +54,12 @@ def abouteasygui():
* Refactored the easygui.py file into several smaller files to improve our ability to manage the code
* Added callbacks to allow for more dynamic dialogs. See the docs for usage.
* Added class access to dialogs so properties may be changed.
* Improved button boxes ability to resize during window resize by converting to Tkinter grid from packer.

KNOWN ISSUES
------------
* (old) In the documentation, there were previous references to issues when using the IDLE IDE. I haven't
experienced those, but also didn't do anything to fix them, so they may still be there. Please report
any problems and we'll try to address them
* There were previous issues when using easygui with the IDLE IDE.
I hope I resolved these problems, however, I've never actually been able to repeat them.
Please report any problems found in github.

OTHER CHANGES
-------------
Expand Down Expand Up @@ -254,8 +259,3 @@ def abouteasygui():

* Fixed a bug that was preventing Linux users from copying text out of
a textbox and a codebox. This was not a problem for Windows users.

'''

if __name__ == '__main__':
abouteasygui()
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include README.md
include README.rst
File renamed without changes.
122 changes: 0 additions & 122 deletions README.txt

This file was deleted.

8 changes: 0 additions & 8 deletions bld.bat

This file was deleted.

9 changes: 0 additions & 9 deletions build.sh

This file was deleted.

4 changes: 3 additions & 1 deletion test_cases/SimpleCv.py → demos/SimpleCv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
__author__ = 'Future Engineer'

import easygui.button_box

"""
from:
http://stackoverflow.com/questions/27873818/easygui-and-simplecv-typeerror-module-object-is-not-callable
Expand All @@ -22,7 +24,7 @@
# Set a breakpoint
code.interact("Code paused. Hit ctrl-D when ready to continue", local=dict(globals(), **locals()))
while True:
eg.msgbox("""Welcome to my program!""", image = "pi.jpg")
easygui.button_box.msgbox("""Welcome to my program!""", image ="pi.jpg")
msgbox("Select img ")
nam=fileopenbox(filetypes=['*'])
print(nam)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"""
import sys

import easygui.button_box

sys.path.append('..')
import easygui

Expand All @@ -16,21 +18,21 @@
name = easygui.enterbox("Arrg its me Davy Jones whats your name ye scallywab")
txt = "Do you fear DEATH {}? Lets play a game if ye win ye can go if ye lose"
txt += " then you are my a sailer on my ship the flying dutchman forever AHAAAA!"
easygui.msgbox(txt.format(name))
easygui.msgbox("The game be simple ye get 15 chances to guess a number between 1 and 100. Ye be ready?")
easygui.button_box.msgbox(txt.format(name))
easygui.button_box.msgbox("The game be simple ye get 15 chances to guess a number between 1 and 100. Ye be ready?")

while guess != secret and tries < 15:
guess = easygui.integerbox("What's your guess "+name)
if not guess: break
if guess < secret:
easygui.msgbox(str(guess) + " is too low "+name)
easygui.button_box.msgbox(str(guess) + " is too low " + name)
elif guess > secret:
easygui.msgbox(str(guess) + " is too high "+name)
easygui.button_box.msgbox(str(guess) + " is too high " + name)

tries += 1

if guess == secret:
easygui.msgbox("Arrg ye got it in {}. You can go.".format(tries))
easygui.button_box.msgbox("Arrg ye got it in {}. You can go.".format(tries))
if tries == 15:
easygui.msgbox("NO more guesses for ye. You're mine forever now {} !! AHAAHAA!!!".format(name))
easygui.button_box.msgbox("NO more guesses for ye. You're mine forever now {} !! AHAAHAA!!!".format(name))

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions demos/button_box.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os

from easygui import buttonbox


def demo_buttonbox_1():
print("hello from the demo")
value = buttonbox(
title="First demo",
msg="bonjour",
choices=["Button[1]", "Button[2]", "Button[3]"],
default_choice="Button[2]")
print("Return: {}".format(value))


def demo_buttonbox_2():
package_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) ;# My parent's directory
images = list()
images.append(os.path.join(package_dir, "python_and_check_logo.gif"))
images.append(os.path.join(package_dir, "zzzzz.gif"))
images.append(os.path.join(package_dir, "python_and_check_logo.png"))
images = [images, images, images, images, ]
value = buttonbox(
title="Second demo",
msg="Now is a good time to press buttons and show images",
choices=['ok', 'cancel'],
images=images)
print("Return: {}".format(value))
61 changes: 20 additions & 41 deletions easygui/boxes/demo.py → demos/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,22 @@

import os
import sys
from tkinter import TkVersion

from easygui import ROOT_DIR, diropenbox, fileopenbox, filesavebox, buttonbox, ynbox, ccbox, boolbox, indexbox, msgbox, \
version
from easygui.text_box import textbox, codebox, exceptionbox
from easygui.multi_fillable_box import multenterbox
from easygui.multi_fillable_box import multpasswordbox

from easygui.fillable_box import integerbox
from easygui.fillable_box import enterbox
from easygui.fillable_box import passwordbox

from easygui.choice_box import choicebox
from easygui.choice_box import multchoicebox


try:
from . import utils as ut
from .button_box import buttonbox
from .text_box import textbox
from .diropen_box import diropenbox
from .fileopen_box import fileopenbox
from .filesave_box import filesavebox
from .multi_fillable_box import multenterbox
from .multi_fillable_box import multpasswordbox

from .derived_boxes import ynbox
from .derived_boxes import ccbox
from .derived_boxes import boolbox
from .derived_boxes import indexbox
from .derived_boxes import msgbox
from .derived_boxes import integerbox
from .derived_boxes import enterbox
from .derived_boxes import exceptionbox
from .derived_boxes import codebox
from .derived_boxes import passwordbox

from .choice_box import choicebox
from .choice_box import multchoicebox

from . import about
from .about import eg_version
from .about import abouteasygui
except (SystemError, ValueError, ImportError):
print("Please run demo.py from outside the package")
exit()
# --------------------------------------------------------------
#
# test/demo easygui
Expand Down Expand Up @@ -82,7 +67,6 @@ def __init__(self):
("fileopenbox", demo_fileopenbox),
("diropenbox", demo_diropenbox),
("exceptionbox", demo_exceptionbox),
("About EasyGui", demo_about),
("Help", demo_help),
]

Expand Down Expand Up @@ -115,10 +99,10 @@ def easygui_demo():
msg = []
msg.append("Pick the kind of box that you wish to demo.")
msg.append(" * Python version {}".format(sys.version))
msg.append(" * EasyGui version {}".format(eg_version))
msg.append(" * Tk version {}".format(ut.TkVersion))
msg.append(" * EasyGui version {}".format(version))
msg.append(" * Tk version {}".format(TkVersion))
intro_message = "\n".join(msg)
title = "EasyGui " + eg_version
title = "EasyGui " + version
# Table that relates keys in choicebox with functions to execute
descriptions = demos.list_descriptions()
preselected = 0
Expand Down Expand Up @@ -272,12 +256,6 @@ def demo_integerbox():
return reply


def demo_about():
reply = abouteasygui()
print("Reply was: {!r}".format(reply))
return reply


def demo_enterbox():
image = os.path.join(package_dir, "python_and_check_logo.gif")
message = ("Enter the name of your best friend."
Expand Down Expand Up @@ -379,7 +357,8 @@ def demo_passwordbox():


def demo_help():
codebox("EasyGui Help", text=about.EASYGUI_ABOUT_INFORMATION)
with open(os.path.join(ROOT_DIR, "HISTORY.rst")) as f:
codebox("EasyGui Help", text=f.read())
return None


Expand Down
Loading