wiki:WidgetPackages
Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Version 2 (modified by bjourne, 13 years ago) (diff)

--

This information mostly comes from KevinDangoor?'s devcast at  http://www.turbogears.org/docs/devcasts.html.

Most widgets use resources to control various aspects of themselves. For example, in Turbogears widget library (the files in source:/trunk/turbogears/widgets) there is a widget named CalendarDatePicker? that display a Javascript calendar. The widget uses the following resource files:

The DataGrid widget uses:

When you build your own widgets it is likely that you will also need to use resource files. You specify which resource files your widget require by using the attributes css, javascript and template in your widget class.

from turbogears.widgets import \
    CSSLink, JSLink, Widget

class ComboBox(Widget):
    css = CSSLink(foobar, "combo.css")
    javascript = [mochikit, JSLink(JSLink(foobar, "combo.js")
    template = "foobar.widgets.templates.combo"