Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is the button widget in pyglet ?

Tags:

python

pyglet

i'm checking out pyglet, but, funny enough, i can't find how to do a simple button!

so

  • what is the standard way to create a standard button?

  • is there a standard way to create a Message-Box? open/save dialogs?

  • or am i missing the point of pyglet? isn't it yet-another gui toolkit for creating (also) forms, windows, buttons, texts, standard widgets, etc. ?

i'm using Python 2.x on a windows PC if that matters.

like image 323
Berry Tsakala Avatar asked Nov 07 '25 00:11

Berry Tsakala


1 Answers

I didn't use Pyglet yet, but is not a GUI library, it doesn't have to have widgets like buttons, or containers etc. It's a multimedia library like Pygame, it draws stuff on screen, plays sounds, and has some helper functions.

If you want to draw a button on screen, you should first draw a rectangle, print some text in it, and then listen mouse clicks to know if it's clicked on this rectangle.

See PyQT, PyGTK, WxPython for some examples of GUI libraries.

like image 69
sinan Avatar answered Nov 08 '25 18:11

sinan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!