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 1 (modified by bjourne, 9 years ago) (diff)

to be continued

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

Most widgets use resources to control various aspects of themselves. For example, the CalendarDatePicker? widget uses the CSS "calendar/calendar-system.css" and the Javascripts "calendar/calendar.js", "calendar/calendar-lang-%s.js" and "calendar/calendar-setup.js." The DataGrid widget uses the CSS "grid.css" and the template "datagrid.kid." 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"