Hi Michela,
WidgetDescription is a class designed to show your widget in Toolbox
Widget Browser.
So, if you are creating a widget called "IncredibleCode", you'll
probably want to show it creating a :
class IncredibleCodeDesc(WidgetDescription):
name = "My Incredible Code widget"
for_widget = IncredibleCode(.... you data here...)
Why should you use WidgetDescription when in TG's source code there
are lot os CoreWD ? - you may ask
The reason is that Widget Browser always show the widget class name.
Now suppose CheckBoxDesc was a direct subclass of WidgetDescription:
how would be shown CheckBox's class name ? It would show it as
turbogears.widgets.forms.Checkbox .
But we don't want this "forms" submodule to appear. All "core" widgets
can be used by your project simply doing a "from turbogears.widgets
import *"
That is the reason we have CoreWD... it overrides the
_get_full_class_name() method and ensures all classes are shown as
"turbogears.widgets.WIDGET_BEEN_DEMOSTRADED" ...
So, unless you are coding a core widget, to be included in Turbogears
main code, forget using CoreWD... You should you WidgetDescription
directly.
Now, understand that you don't need to write a WidgetDescription
unless you want your widget to appear in WidgetBrowser... but usually
it is cool to see you own widget in the browser... :)
I hope I could help you...
Cheers,
Roger
On 7/25/06, .M. <[EMAIL PROTECTED]> wrote:
>
> Still can't work out Widgets and feeling very intelligent.
>
> How does CoreWD relate to the example shown in the documentation?
>
> http://trac.turbogears.org/turbogears/wiki/SimpleWidgetForm
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---