Giter Club home page Giter Club logo

easygui's People

Contributors

aklaver avatar asweigart avatar cmgreenspon avatar davidism avatar dotlambda avatar doyousketch2 avatar godfoder avatar horstjens avatar hrpzcf avatar jjdenis avatar kr-ish avatar marcelotrevisani avatar miniluigi008 avatar robertlugg avatar shura1oplot avatar slootsky avatar spyoungtech avatar tomhea avatar xanderayes avatar zadacka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easygui's Issues

Failed compile

I tried compile for some distributions linux, but fail.

Traceback (most recent call last):
File "setup.py", line 3, in
import easygui
File "/home/david/Downloads/python-easygui/src/easygui/easygui/init.py", line 3, in
all = easygui.all
NameError: name 'easygui' is not defined

Why is this password box on easygui showing the characters before anythings typed?

Here is my code, it is supposed to produce a password box for the user to enter their password with hidden characters showing instead of letters. When I run it, the hidden characters are showing even before I've typed anything.

import easygui as eg

message="Enter Password"
title="New User"
fieldNames=["Enter Password"]
fieldVals=eg.passwordbox(message,title,fieldNames)

from:
http://stackoverflow.com/questions/27800574/why-is-this-password-box-on-easygui-showing-the-characters-before-anythings-type

get_string has duplicate window

get_string has a duplicate window behind it that can be seen when the top dialog is moved.

from easygui_qt import *
from sys import exit

s = get_string('Enter a string')

print("String entered was %s" % s)
if s == "None":
exit()
input()

When the top dialog is moved to the right, the other is visible behind it.

easyguiqt

Ability to fill entry boxes if user does not

Original text from:
http://all-you-need-is-tech.blogspot.com/2013/01/improving-easygui-for-python.html

Andrew S08 June, 2013 23:32
Thanks Robbie this is very useful for building GUIs that look decent without much effort. One question: I have a multenterbox where one field can be left blank; if left blank, the program will autogenerate a number for the user. I would like to update the onscreen field with this number without closing the window (remain inside the callback). How can this be achieved?

Reply
Replies

Robbie Brook09 June, 2013 12:00
Hi Andrew,
What you're asking to do is actually populate the values in easygui.multenterbox after you sent them. This feature isn't supported.
I would go for a simple solution like:

import easygui_callback 
import random

def get_auto_value():
    # your logic here
    return random.random()
choices = ["name", "address", "auto-field"]
values= ['default-name','default-address','']
input= ''

while True:
    input = easygui_callback.multenterbox("auto field","generator", choices,values)
    if input == None: break
if input[2] == "":
    values= [input[0],input[1],get_auto_value()]
else:
    # save data somewhere or whatever
    pass

If you really have to work with callback, you can hack easygui_callback.multenterbox to send also 'values' list to callback and set it there. On return from callback, you'll need to set this value list into its matching widget.

documentation: internal links and table of contents for API.html

in file https://github.com/robertlugg/easygui/blob/master/documentation/api.html
it would be fantastic to have internal links for each easygui function ( msgbox, buttonbox, yesnobox etc) and have sphinx make an table of content with hyperlinks in the upper left corner (left sidebar). this would remove the need to browse the very long api text (or use strg+f) if you already know the name of a function but want to look up it's exact parameters. Likewise, it would give the reader an fast-to-recognize overview over all easygui functions.

Windows 7 - dialog boxes spawn behind other windows.

(Cross posting from http://stackoverflow.com/questions/31223583/easygui-dialogs-are-not-given-focus-when-created .)

I am using Python 2.7.9, easygui 0.97.4, and Windows 7.

I am trying to pop up a dialog box using the following:

import easygui
easygui.msgbox()

I would expect a dialog box to pop up and come to the foreground, taking focus. Sometimes, this happens. Other times, the dialog box does not come to the front, and spawns behind all other windows.

Whether the dialog box comes to the front, or hides behind other windows, seems to depend on something unpredictable. Giving different arguments to easygui.msgbox() doesn't seem to help. Restarting the Python interpreter sometimes makes it work, and sometimes doesn't.

The issue is not so bad for simple dialogs, which at least give a flashing button in the task bar to get your attention.

enter image description here

It is worse for diropenbox() which does not spawn a flashing button in the taskbar. The dialog spawns behind a window and gives no evidence it's there, until you minimise all other windows.

enter image description here

enter image description here

Is this normal and expected behaviour? I would like easygui dialogs to always come to the front and always take focus, instead of hiding behind other windows.

egStore remembers cached-like location of Settings file and refuses valid file name input

My application provides a path in which the Settings file should be created. Say, it was built on Machine A, in my case (Win 7) with path D:\Trials\Trial2\filenamehere.txt.

I copied my application source to another machine, say Machine B ( in my case Win XP) and ran the python code. I supplied a valid filename and path to create the settings file, say, (E:\Temp\somefilenamehere.txt) .

As suggested in the easyGUI tutorial on the easyGUI page, I created an inherited class based on EgStore, called Settings.

However, when valid file name is provided and the store method is invoked, the Settings / EgStore class, still look for the settings file in the path in D:\ i.e. the path in the machine in which the code originally ran.

When I tried to run the code from B, from my application's folder, where the D:\ path doesn't exist, it gives an error, saying FileNotFound (Errno 2).
When I tried a minimal version of settings storage in the same folder, it didn't work.
The minimal version of settings storage in another folder worked.

davidism at stack overflow, suggested I put an additional method in my subclass called restore, that reads thus :

def restore(self):
filename = self.filename
EgStore.restore(self)
self.filename = filename

This fixed it.
An example program where I have used it is in Line No.128 of ModiBatudu.
https://github.com/whirlmind/ModiBatudu/blob/master/ModiBatudu_Python_Source/ModiBatudu.py

How the same code that uses the application path runs correctly in one folder and incorrectly in another folder is seen in this screenshot. Notice the D:\Trials.... etc in the error message. Where did that come from ? (Hint : From the path on the other machine where EgStore was used before. )

problem_screenshot

The sample file called in that screenshot, from two different locations producing two different results is here :

from easygui import *
import pprint
import os

This class partially copy-pasted from easygui library demo.

class Settings(EgStore):
def init(self, filename): # filename is required
#-------------------------------------------------
# Specify default/initial values for variables that
# this particular application wants to remember.
#-------------------------------------------------
print("Test printing the path inside the Settings class");
pprint.pprint(settingsFile);
pprint.pprint("Exists ? " + str(os.path.isfile(settingsFile)));

    self.Last_Alert_TimeStamp_Num = ""

    #-------------------------------------------------
    # For subclasses of EgStore, these must be
    # the last two statements in  __init__
    #-------------------------------------------------
    self.filename = filename  # this is required
    self.restore()            # restore values from the storage file if possible

-----------------------------------------------------------------------------------------

settingsFile = os.path.join(os.path.dirname(file), "ModiBatudu_LastAlertTime.txt")

print("Test printing the path before calling the Settings class");
pprint.pprint(settingsFile);
pprint.pprint("Exists ? " + str(os.path.isfile(settingsFile)));

Likely Problem Area begins ?......

settings = Settings(settingsFile)
settings.Last_Alert_TimeStamp_Num = "Some junk goes here";
settings.store()

Show Image only in a dialog

Provide ability to only show an image (no buttons, etc) in a dialog. perhaps modify buttonbox to do that...have 'choices' argument support an empty list in which case no buttons are displayed and the image is shown in the entire window.

Window widths are too wide when on a dual screen system

When using a dual screen, side-by-side system the default way of calculating window sizes generates windows that are too wide. It would be better to restrict the aspect ration of the windows to some more reasonable one rather than purely going by the system screen height and width.

Buttonbox: Accept a dict for images

support dict-like objects to be passed in as images parameter.

Treat them as OrderedDicts to preserve their order if the user passes in an OrderedDict.
If the user selects a particular item, don't return the value, but instead return the key.

easygui multchoicebox does not work on Win7, python 2.7.9

as per subject. The choicebox is always in 'single selection' mode.
The problem lies in the scope of the global variable __choiceboxMultipleSelect. A simple modification in the lines 472-473 and 493-494 (remove global, add bb. in front of the variable) in the file derived_boxes.py does the trick for me.
New to GitHub, so sorry if this could have been done easily in other ways.

animated gifs / image animation inside easygui

wished by all my underage rpg-programming students:

the possibility to display ether animated gifs instead of the image inside a button/messagebox,
or
the possibility to play an animation inside a buttonbox by providing a list of images / list of pairs (image, displaytime in seconds)

def msgbox(msg="",
title="",
ok_button="ok",
image=None,
root=None,
animation=[("image1.png", 0.1), ("image2.png",0.1), ("image3.png",0.5)],
cycle_animation=True )

The animation should stop as soon as a button in the window is clicked.
The animation should not loop if cycle_animation parameter is set to False.
animation would only work if image is set to None.

For game programming, this feature would be most needed for buttonbox and msgbox (and, if possible, for gridbox/multi-image-box)

windows 7 x64 / python 3.4 amd64 issue

python
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:16:31) [MSC v.1600 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import easygui
Traceback (most recent call last):
File "", line 1, in
File "C:\python\Python34\lib\site-packages\easygui__init__.py", line 3, in
all = easygui.all
NameError: name 'easygui' is not defined

feature request: floatbox (like integerbox)

a box to enter numeric float (and integer) values, with default, lowerbound and upperbound.
Ideally a list of accepted decimal point signs should be an optional parameter

def floatbox(msg="please enter float or integer",
title="",
default=0.0,
lowerbound=0.0,
upperbound=99.9999,
acceptable_decimal_signs=[".",","] ):

The floatbox shows an error message like the integerbox when the entered value is not integer nor float, or if the entered value is below lowerbound and above upperbound.
Error message is also shown if more than one single decimal sign is entered.

multchoicebox() does not allow multiple selections in 0.97.4, return variable incorrect

Using easygui 0.97.4 (installed from the *.whl file on PyPI) on Python 2.7.9, in a Linux OS, a script I've used for months now has an issue where only 1 selection can be made on any multchoicebox() interface. Also, that function now returns a string containing the selected option, instead of a list of strings:

user_choices = eg.multchoicebox(choices=['choice1', 'choice2'])

In the above case, I can only choose "choice1" or "choice2" in the GUI and the value of "user_choices" is the string "choice1" or "choice2", instead of a list like ["choice1"] or ["choice2"].

I reverted to 0.97.2 and it works fine.

default and cancel buttons as user options

I was thinking about adding two options to many of the dialogs:
default_button=(string)
cancel_button=(string)

So, when the dialog opens, the default is set to the Choices button that matches the default_button string.

Also, if user presses red 'x' or maybe hits , the cancel_button is "pressed"

Horst comment:
that would be fantastic. it allows gameplay without mouse

Python 2/3 support: replace utils with __future__, etc

Based on this article, I'm really taking on too much when trying to allow easygui to run in both python 2 and python 3. At some point we may need to give up, but there is more I should have been doing. Review this website:
http://python-future.org/imports.html

  • Change the Tkinter/tkinter to get it working consistently
  • Change import lines to actually work in all use-cases
    • File in a module run as main
    • File imported from another file
    • easygui module imported into a user's program

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.