Skip to main content
Pygbutton
=========

**A Button UI Element for Pygame**

http://inventwithpython.com/blog/2012/10/30/creating-a-button-ui-module-for-pygame/

Pygbutton is a simple button UI that you can add to your Pygame programs.

You can download a few example programs here: http://inventwithpython.com/pygbutton_src.zip

The code to implement it is fairly basic:

import pygbutton
buttonObj = pygbutton.PygButton((50, 50, 60, 30), 'Button Caption')
while True: # main game loop
for event in pygame.event.get(): # event handling loop
if 'click' in buttonObj.handleEvent(event):
pass # Do stuff in response to button click here.
buttonObj.draw(DISPLAYSURFACE) # where DISPLAYSURFACE was the Surface object returned from pygame.display.set_mode()

The full explanation of the code and how it was written can be found in the aboved linked blog post.

Release files for Pygbutton 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Pygbutton 0.9.0
File Size Uploaded
Pygbutton-0.9.0.zip 12.4 kB Details

Release files / Pygbutton-0.9.0.zip

Download URL Pygbutton-0.9.0.zip
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d8f8570f6f4a23f9312ee89cfd8f9b23a59c169b692122ec408ea8b62cbd7318
BLAKE2b-256 checksum
How to use checksums
a2a7dd46772769c4fd377f450ce2b00d18811e40a0d8987e8fb42072723a5521
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.9.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page