On Wednesday, July 28, 2010 16:58:00 JOKER Ltd. wrote:
> Hi people
> 
> I just discovered this (wonderful) group .
> It's some time that I use TG2, but since now haven't no need of the
> the powerfull Tosca Widgets, adnd so I haven't looked for as need.
> 
> Now I recognize that they can simplify my job of several orders of
> magnitude. But the sample on the TG2 docs are reaaly simple, poor and
> oreinted to the paradigm: take data from orm and display'em on a
> screen Insert/Update form.
> 
> My problem is that I need to define a generic template (same as those
> that I've seemed on the ToscaWidgets site itself) with a correlated
> controller.
> 
> I try to make clearly with a sample. On the TG2 site's doc I can foun
> 
> from tw.api import WidgetsList
> from tw.forms import TableForm, CalendarDatePicker, SingleSelectField,
> TextField, TextArea
> 
> class MovieForm(TableForm):
> 
>    class fields(WidgetsList):
>        title = TextField()
>     ...
> 
> Now, if i want use a widget ImageButton
> 
> >>> from tw import forms
> >>> help(forms.fields.ImageButton)
> 
> Help on class ImageButton in module tw.forms.fields:
> 
> class ImageButton(Button)
> 
>  |  Method resolution order:
>  |      ImageButton
>  |      Button
>  |      InputField
> 
>        ...
> 
> how should I declare in the MovieForm class above?

class MovieForm(...):

    ...

   submit = ImageButton(src="/my/image.png", alt="press me!")

Diez


-- 
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