Skip to main content

PGU - Phil's pyGame Utilities - 0.10.2

A collection of handy modules and scripts for PyGame.


Peter Rogers
(petros)
Simple GUI widgets for use in pygame. (eg buttons, text boxes, windows, etc) NOTE: PGU is in need of a new maintainer. Please email me at peter.rogers-at-gmail.com if you're interested in taking over the code base, or becoming a contributor.

Changes

- fixed: gui11, when everything is removed scroll bar is removed
    too soon!
- fixed: gui11, graphical crud shows up after removing stuff, sometimes
- fixed: Select can drop below window sometimes, and it looks bad.
    now Selects that are at the bottom of the screen may go upwards.
- added: ProgressBar widget & documentation.
- fixed: if the widget in the scroll doesn't fill it up,
    doing any scrolling causes a crash
- fixed: gui.Menus not working due to focus related fixes
- added: widget.connect gets *values, not just value to pass on
    so that you can have multi-param methods.  See widget.connect
    documentation for details.
- added: widget.send can send the event and the widget to
    the reciever if the receiving fnc has the params named
    _widget or _event or _code.  See widget.connect documentation.
- fixed: disabled items in scrollarea don't get alpha-ized due to 
   alpha image that is being drawn to.
- fixed: scrollers don't scroll quite like normal scrollers do...
- fixed: slider size can get too small
- added: scrollbars added in arrows, so that they are scrollbars
    instead of just sliders.
- fixed: sliders & scrollbars inconsistent, and don't look good
- fixed: weird border in scrollarea, sometimes...
- fixed: internal cleanup of ScrollBox, etc.  the scollers will
    automatically appear when the sub-widget gets bigger, smaller, etc.
- fixed: when you click on a disabled widget, 
    the click can slip to a non-disabled widget
- added: .disabled, .focusable attributes to widgets, 
    see widget.widget documentation
- fixed: .add, .remove for Container, Table, Document so they
    all work properly.  gui14.py adjusted to demo accordingly
- fixed: select to work, by adding an improper use of resize ;)
- fixed: a number of improper uses of resize()
- fixed: gui.Table to only resize() something a second time
    if it _really_ needs to
- fixed: gui.Table to clear() out old rows properly
- fixed: gui.Widget so that chsize() would work a lot faster (thus
    the gui13.py example is very nice and smooth now, doesn't feel like
    it is lagging anymore.)
- fixed: ScrollBox a lot faster by using double buffering
    this will, however, require a lot of memory for large buffers
    but hopefully that won't be a problem, it makes examples/gui12.py blaze
    during scrolling, whereas before it was quite slow even on my 2x3 GHz machine.
- fixed: "calling Button.event() before Button.paint() causes crash"
- fixed: "container.remove makes a widget stop working but not disappear"
- fixed: some docs about a bug whereby container.add(w) won't work     
    after the app is running

Links

Home Page
https://github.com/parogers/pgu
Source
https://sourceforge.net/project/showfiles.php?group_id=145281

Releases

PGU - Phil's pyGame Utilities 0.5 — 7 Oct, 2005

PGU - Phil's pyGame Utilities 0.1.0pre — 24 Jul, 2005

PGU - Phil's pyGame Utilities 0.10.1 — 24 Feb, 2006

PGU - Phil's pyGame Utilities 0.10.2 — 13 Mar, 2006

PGU - Phil's pyGame Utilities 0.3 — 25 Aug, 2005

PGU - Phil's pyGame Utilities 0.9 — 1 Dec, 2005

PGU - Phil's pyGame Utilities 0.1.0 — 4 Aug, 2005

PGU - Phil's pyGame Utilities 0.6 — 24 Oct, 2005

PGU - Phil's pyGame Utilities 0.7 — 19 Nov, 2005

PGU - Phil's pyGame Utilities 0.16 — 16 Mar, 2011

PGU - Phil's pyGame Utilities 0.10.3 — 7 Apr, 2006

PGU - Phil's pyGame Utilities 0.10.6 — 25 Mar, 2007

PGU - Phil's pyGame Utilities 0.10.5 — 1 Sep, 2006

PGU - Phil's pyGame Utilities 0.10 — 11 Feb, 2006

PGU - Phil's pyGame Utilities 0.12.2 — 1 Mar, 2009

PGU - Phil's pyGame Utilities 0.12.1 — 23 Feb, 2009

PGU - Phil's pyGame Utilities 0.14 — 3 Jan, 2011

Pygame.org account Comments

  • Zhangyrmath 2011-06-12 01:20

    good!I'll have a try on that

  • Happyfanatic 2012-04-08 19:51

    I downloaded PGU to use the iso engine.  The example code makes reference to a set of "tilevid tutorials" They are not included in the download; I couldn't find them on the homepage, or by google search.  Anyone know if these exist anymore?    

    canine828 2016-02-27 22:52

    I have them in my PGU download (but it's the 0.18 version)

  • beginner 2012-04-18 01:07

    class TestDialog(gui.Dialog):
        def __init__(this):
            title = gui.Label("Some Dialog Box")
            label = gui.Label("The number now is ")
            gui.Dialog.__init__(this, title, label)

    how can i add a global variable inside the label ?? I cannot do something like :

    class TestDialog(gui.Dialog):    def __init__(this):        global s         title = gui.Label("Some Dialog Box")        label = gui.Label("
    The number now is", s)        gui.Dialog.__init__(this, title, label)

    where every time i click a button s increases

    Hghowe 2014-05-09 18:40

    You might try label = gui.Label("The number now is {0}".format(s))

    canine828 2016-02-27 22:51

    Use str(s) in place of s (you can't combine strings and ints, but you can combine strings and strings), or use hghowe's answer.

  • Magnus D 2012-10-28 21:22

    When clicking the close button on the example windows, I do not succeed to close any of them. I am using Python3. Can someone help? I am reffering to the examples that ship with the package itself.

    canine828 2016-02-27 22:48

    Pygame is designed for Python 2.7. Install Python 2.7 (or just use it if you have it), and reinstall PGU with Python 2.7!
    :D

  • rob00 2013-01-11 03:19

    >>>from pgu import gui
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "C:\Python32\lib\site-packages\pgu\gui\__init__.py", line 21, in <module>

    from .container import Container
    File "C:\Python32\lib\site-packges\pgu\gui\container.py", line 57
    except StyleError,e:

    SyntaxError: invalid syntax

    Floriusin 2014-12-26 13:20

    Just go into pgu/gui/container.py and in update() edit "except StyleError,e:" to "except StyleError as e:" and then reinstall

    canine828 2016-02-27 22:47

    Wait a minute?! Is that still a bug in version 0.18?

  • fjkdasilva 2013-07-17 16:42

    It is not clear how one gets access to values returned from PGU apps in a pygame program. Can anyone help?

  • Bir Bikram Dey 2014-01-01 21:39

    I am not sure how to even install this to windows.
    Is it me or pygame is not windows friendly :(

    Leo Tindall 2015-11-09 22:31

    Windows is not windows friendly. Because Windows sucks.

    canine828 2016-02-27 22:45

    I completely agree.

    canine828 2016-02-27 22:45

    Pygame is Windows friendly. I have Windows on my school laptop (my parents won't let me put Linux on it), and it works pretty well. Just install Python, open the command prompt, and type C:\Python27\python.exe C:\path\to\the\pge\setup\python\file\setup.py install

    Or add C:\Python27 and C:\Python27\Scripts to your Path, open a command prompt, CD to the folder with your PGE setup.py file, and type python setup.py install

    :D

    Judicaël 2014-05-07 19:52

    copy paste cmd.exe into the pgu folder, write the command python setup.py install

    canine828 2016-02-27 22:46

    Why paste cmd.exe into the pgu folder? Why not just CD to it?

  • Anony 2014-09-20 22:25

    How to install and use this exactly?

  • JR 2014-10-08 18:19

    Is there a way to make the scrollarea widget transparent?

    Judicaël 2014-10-13 18:26

    I was asking myself the same question as I really need it to be transparent for my MORPG I'm making... So please someone help us out

  • canine828 2016-02-27 22:42

    This is good, but there should be a clean simple Oxygen-ish theme built in. The last thing I want to do is rifle through my filesystem, find out that it's all generated by Qt, and use screenshots to make the gui.

  • Stam Kaly 2016-07-02 14:33

    If you get error:

    Traceback (most recent call last):
    File "./setup.py", line 84, in <module>
    main()
    File "./setup.py", line 33, in main
    os.path.walk('data', visit, installdatafiles)
    AttributeError: 'module' object has no attribute 'walk'

    You can delete ".path" in "os.path.walk('data', visit, installdatafiles)"

  • João S. O. Bueno 2019-04-19 19:05

    There is a new release from April, 2019 - all syntax have been migrated to Python 3, and the project can be installed with `pip install pygame-pgu` - https://pypi.org/project/pygame-pgu/

    ruben rogerio contreras 2020-12-27 15:59

    You , Sir were my Hero today! THANKS a Zillion i tried so many times was frustrating but with your info at first time i installed it neatly thanks btw i´m a newbie