Get a GUI into your game the easy way

About

GooeyPy is the result of my need for a flexible and easy to use gui for pygame. Yes, I realize there are already guis for pygame out there. But with each one there is something I don't like. GooeyPy simply has everything the way I like it. So I'm not going to say it's the best one out there, because everyone has their own opinions. Here are some things that are different about GooeyPy:

Styling:

I didn't like the way styling worked with other guis. Maybe I'm just spoiled by CSS in web development, but wouldn't it be nice if you could have CSS like styling for a gui? Oh woops, now you can! With GooeyPy, all widgets are stylable with CSS like attributes. Also, at any time during the application run time you can change the styling dynamically (and it will update itself)! All information related to displaying widgets are stored in the styling (that includes positioning; relative or absolute)

System Message: ERROR/3 (<string>, line 22)

Unknown directive type "sourcecode".

.. sourcecode:: python

    l = gui.Label("Text", x=395, y=30, font_size=25, color=(0,255,0))

Any additional arguments passed when creating a widget are taken as styling options.

Integration:
With all the guis I've tried, you have to figure out how to integrate the gui into an already made game. Sometimes that's impossible. And if it is possible, until you figure out how the gui works, it's very hard to do. GooeyPy doesn't steal your pygame events and doesn't interfear with your bliting (well, actually it can. Setting up the surfaces can be a little hairy, but there is some nice documentation to explain it all).
Dependencies:
First of all, this isn't what you think. I'm not meaning other libs that GooeyPy depends on, but the dependencies within GooeyPy. Ok, that doesn't make a whole lot of sense... let me put it another way. You have a widget and all of the sudden you want to change the value. so you do widget.value = "hi". And it works! GooeyPy automatically knows when something changes that effects another part of itself. In this case, the value effects how the widget displays, so it will redraw itself. It works that way with everything! You never have to worry about redrawing a widget when it's dirty (and nither do I within GooeyPy, so that means a whole lot less bugs). All the dependencies are also cached.
Linking:

Another cool thing I have is you can link values from one widget to another. So if the value of widget A changes, so does the value it's linked to in widget B.

System Message: ERROR/3 (<string>, line 37)

Unknown directive type "sourcecode".

.. sourcecode:: pycon

    >>> l1 = gui.Label("Text")
    >>> linked_l = gui.Label(l1.link("value"))
    >>> linked_label.value
    Text
    >>> l1.vale = "Something else"
    >>> linked_label.value
    Something else

Be carefull not to do l1.value as that will put the actual string value!

You can also link with functions!

System Message: ERROR/3 (<string>, line 51)

Unknown directive type "sourcecode".

.. sourcecode:: pycon

    >>> x = 1
    >>> y = 2
    >>> l = gui.Label(lambda:x+y)
    >>> l.value
    3
    >>> x = 6
    >>> l.value
    8

Actually you'll need to do app.run() before it will recalculate the values since x and y aren't cellulose cells, but you'll be doing that every frame anyways. :)

Effects:
I like the ability to have cool effects applied to my widgets. Now I have them.

Who is GooeyPy for?

GooeyPy is designed for smaller SDL games that need a light GUI implemented easily and fast. It can be used, but isn't really designed for, larger games that need large complex GUIs.

Download

If you have easy_install installed on your computer, you can simply run:

$ sudo easy_install GooeyPy

Otherwise you can download it at the python cheese shop

Learn

Probably the best way to learn how to use GooeyPy is to download it, run the examples, and then look at their sources (which are well documented). example1.py will give you a good overview of GooeyPy's functionality and example2.py will show you just how easy it is to include GooeyPy in your already made game (or a new one ;). Then there is example3.py that shows a cool way of handling main menu like scenarios.

Then if you ever have a problem with a certain widget or other part of GooeyPy, you can refrence the docs to help figure out what's wrong.

Feedback

If you like GooeyPy and want to see it improve, please email me at web _at_ joey101 net and tell me what you like about it and how you think it could be made better!

Getting help

If all else fails and you are stuck, maybe it's a bug or you just can't figure something out, email me and I'll see if I can help. Eventually I'll get a FAQ up and maybe a mailing list.