pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
TextWidget

TextWidget - 0.11

Mark Mruss (selsine)

Tags:

Description

TextWidget: is a simple way to create "text buttons" for your PyGame applications. The project is LGPL so you can use it in any project that you want. It's pretty simple stuff so it's not meant to be the definitive way to do this, just a simple solution for people that just want to drop a class in and have working "text buttons". You can read about how to use the widget on on my blog: http://www.learningpython.com/2006/12/13/textwidget-a-simple-text-class-for-pygame/

Changes

  • Added the example code
  • Changed the way that the font_filename was handled, now the full path is tested first
  • Added the message types
  • Added the ability to turn the messages off
  • renamed the .py file to be textwidget.py instead of TextWidget.py to conform with PEP 8.
  • Fixed a bug where pygame.locals.USEREVENT was not defined for some people. Switched to used pygame.USEREVNT.

Links

Home Page: http://code.google.com/p/textwidget/
Source: https://textwidget.googlecode.com/svn/trunk/

Screenshot


click to view original size

Releases

TextWidget - 0.11 - Nov 21, 2008
TextWidget - 0.1 - Sep 21, 2008

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

November 19, 2009 7:24am - Marco Baxemyr - nickname: (phelerox)
Just noting that the filename in the 0.11 download @ Google Code is TextWidget.py, not textwidget.py as the Changes state. And the svn trunk requires authentication - not sure if that's the way it's intended.
September 24, 2008 9:59am - Mark Mruss - nickname: (selsine)
Hey Anonymous,

Thanks for the suggestion. I do have a blog post (noted above) that outlines how it works, but I do plan on putting more information in the TextWidget "distribution". (heavy quotes)
September 24, 2008 9:58am - Mark Mruss - nickname: (selsine)
Hi Shiroku,

Thanks for the information, it must be a problem with versions of PyGame. I've fixed the issue. You can grab the latest version (not much of a change) from the SVN server: http://code.google.com/p/textwidget/source/checkout
September 23, 2008 2:53pm - Shiroku - nickname: (shiroku)
I get this error:
fra@kubuntu:~/Desktop$ python TextWidget.py
Traceback (most recent call last):
File "TextWidget.py", line 45, in <module>
TEXT_WIDGET_CLICK = pygame.locals.USEREVENT + 1
AttributeError: 'module' object has no attribute 'locals'
fra@kubuntu:~/Desktop$
September 21, 2008 5:27pm - Anonymous - nickname: (pywiz32)
GREAT idea. My suggestion: also include an easy-to-read example on how to do it without using your class. That way people an learn do do so on their own.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Aug 26, 2014

Aug 22, 2014

Aug 21, 2014


Aug 19, 2014

Aug 18, 2014

Aug 2, 2014


Jul 28, 2014

Jul 22, 2014

Jul 21, 2014

Jul 20, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)