What is Glinter?
Glinter is a GUI toolkit for PyOpenGL and Python. It uses PyOpenGL (more specifically, the GLUT portion) to produce GUI elements such as Buttons and Frames. For those familiar with OpenGL programming, this toolkit is similar in concept to the GLUI toolkit in that it uses GLUT for its windowing calls. But, its programming syntax and stylisms are most like Tkinter. Hence the name, Glinter. The best is, if you have PyOpenGL 2.0 installed, that's all you need to run Glinter.
Where do I get it?The project page is here. From here you can look at the CVS page amongst other things. There are no released packages yet. The system just isn't functional enough. But, it is functional. Basically, the CVS distribution will run and is usable.
Items of interest:
- Frames, Buttons, Labels are working
- Toplevel widgets are problematic... :-/
- Canvas3D (Canvas2D to follow)
- Syntax is a mixture of Tkinter, Pmw, and wxPython
- Pmw: It is most closely similar to the Pmw "MegaWidget" system. In fact, the base code is almost a direct copy of the Pmw MegaArchetype model.
- wxPython: The similarities to wxPython lie in the event processing system. Events are caught by overriding functions (OnButtonDown, OnMotion, etc.). A Bind command (similar to Tkinter's bind command) will follow shortly.
- Tkinter: The system uses a widget-on-demand system like Tkinter (instead of an App-based system like wxPython). It also shares much of the naming conventions of Tkinter.
- Constants.py (original import of OpenGL,GLU, and GLUT libs)
- FunctionWrapper.py (wrapping glut commands to keep correct statefulness)
- DrawPalette.py (OpenGL drawing functionality)
The rest (Button.py, Label.py, etc.) are pretty self explanatory. Glinter.py is nothing more than a railway station for the rest of the code. Take a look at Glinter.py to see the syntax for use. This is, of course, only a preliminary syntax. The geometry system is rather incomplete, but will get better in time.
Items for discussion/development:
- If anyone knows how to capture window destruction calls in GLUT, please let me know. I'll give you a cookie or something. As far as I can find (admittedly only a cursory scan of the basic documentation), there is no way to do so. This (obviously) makes a Toplevel widget (Dialogs, etc.) nearly impossible without stupid looking hacks. You can see what I've done (get the code, or here's a screenshot), and it looks uber-gimpy.
- Anyone who has some killer geometry algorithms to offer will also recieve a cookie. I've started on a very basic Gridder class for this purpose, but if anyone has something similar to Tk's grid/pack/place it would be heartily appreciated (see afformentioned cookie offer).