iain duncan schrieb:
> On Thu, 2006-16-11 at 18:27 -0500, Karl Guertin wrote:
>> I'd just do CSS. If I had to do something fancier, I'd do text on a
>> pre-generated image background. The image library in Python is PIL.
> 
> Thanks Karl, Anyone know firsthand if PIL is easy to run on a server
> alongside gears? One of those things I'd rather skip if there are lots
> of "known issues". ;)

I don't know, why it should interfere with TG.

A possible approach for image buttons could be a custom widget that generates
an IMG tag with a special URL to one of your controller methods that generates
the image on-the-fly, doing caching, etc.

I.e. the template for the widget would look like:

<button id=${id} name="${name}">
  <img
src="/my_widget_controller?size_x=${x}&size_y=${size_y}&template=${template}&text=${value}">
<button>

and the controller method my_widget_controller(text, size_x, size_y, template)
would return an image with the appropriate content type, possibly retrieved
from a cache (see the Python Cookbook for lots of caching decorators).

This could be slow though, since the browser would probably not cache the
image,  unless you also set the appropriate headers in your response. I would
always go with CSS and background images, if at all possible.

Chris

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to