[socal-piggies] On Pyroglyph, an introduction to an object graph/constraint-based XML UI language written in python, as presented at the Python Meetup in LA on 2/12/09

James Robey circlecycle at gmail.com
Sun Feb 15 21:23:56 PST 2009


On Pyroglyph, an introduction to an object graph/constraint-based XML  
UI language written in python, as presented at the Python Meetup in LA  
on 2/12/09

When decomposing any (2d) UI a combination of colored (or transparent)  
boxes, images, and text where each of those elements may receive  
events such as mousedown, keydown, focus, and so forth, is all that is  
needed to make widgets of arbitrary complexity. Pyroglyph is a fully  
*self-contained* (as opposed to XUL) language that is formed in XML  
for the numerous advantages that the format provides which are  
uniquely suited to such an endeavor. It boasts the following  
capabilities, either real or planned:

cross-platform and cross-device faithful and exact recreation of  
interfaces
constraint-based for natural and readable delegate/listener patterns
abstract-able and able to be generated from a variety of third party  
code generators
fun and easy to pickup for beginners and expert UI designers alike
python based, of course, so that our favorite language can be used on  
more (and more exciting) projects.

The current copy of code is available from http://code.google.com/p/pyroglyph 
. A new project, called wildfire, boasts the exact form of the  
pyroglyph language while offering a compilation model instead of an  
interpreted one, removing the need for external dependancies. For  
those that attended the last meeting, I hope the introduction has  
prepared you adequately to run and edit some of the examples. For  
those that didn’t, each day I’ll publish to the list a guide to a  
particular component, pattern, or structure that will together form a  
continuing look into why I think that XML has a real and immediate  
advantage over other ways of working with UI toolkits, and hopefully,  
after a few weeks, you will too.

The first installment follows, “How to install pyroglyph and run your  
first demo”

-----

How to install pyroglyph and run your first demo.
2/15/09
James Robey

	Pyroglyph was designed to have as few dependancies as possible. The  
first UI to be abstracted and offered as a prototyping platform is  
OpenGL. In the near future, wxpython will be added and is meant to be  
the first production ready version of the language. Using OpenGL made  
certain design decisions easier, at the expense of how fast and how  
complex applications can be (it currently linearly scales with the  
number of components used in total, while wxPython will scale with the  
number of components being actively used in any given “frame” but not  
components that are statically being displayed). Thus, you will need  
python 2.5 (minimum) and only one other external python library  
installed to use Pyroglyph, “Pyglet” which is a library that lightly  
abstracts access to OpenGL. It was chosen because pyglet itself has no  
other dependancies, at all, unlike other frameworks.

	To get started, visit the homepage of the project,

http://code.google.com/p/pyroglyph.

To cut to the chase, use SVN to retrieve the source by running

“svn checkout http://pyroglyph.googlecode.com/svn/trunk/ pyroglyph”

to check out a copy of the latest (although still alpha strictly  
speaking) copy of the code. Then visit

http://www.pyglet.org/download.html

To download the latest version of pyglet, specifically pyglet 1.1.2.  
Follow their directions to install the package.

	After you have successfully installed pyglet, return to the directory  
containing the copy of Pyroglyph. We are ready to run our first demo.  
Pyroglyph comes with about 20 demonstration programs that individually  
test features, or provide a few more complex examples. Not all  
examples work - almost all do - there is a bug with images and  
dragging in some instances that prevents a few examples from working  
correctly. These bugs are not big and are being addressed actively. In  
the topmost Pyroglyph directory, a python script, “run” is provided to  
load and start a program. If you run it without arguments you will see  
the program “hello.lzx” in the topmost directory. Otherwise you may  
provide the path to the program to run, e.g.

“run apps/minesweeper.lzx”

If you have any problems installing the engine or running the demos  
i’d love to hear about it, especially since this is the first time  
i’ve posted publicly about the project. Just reply to this email. Any  
broader questions about what pyroglyph is or why to use it, i would  
appreciate having a public discourse on.

Tomorrow’s installment will be entitled, “canvas, views, positioning,  
color, and nesting”

Thanks for your interest, and the chance to have met such a vibrant  
and distinguished group of fellow pythonistas!
	
	James Robey




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/socal-piggies/attachments/20090215/3c5021fc/attachment.htm>


More information about the socal-piggies mailing list