Hi,
you almost got it: The action widget HAS to be present as a child
widget of your more complicated widget at parse time, which means, it
has to be in the wikitext.
Now you could create them on the fly in your widget, but that would be
complicated and since usually there is more than 1 action widget
involved, it doesn't really make sense to create them on the fly,
because you can get the same functionality much easier (i.e. messages etc.).
The good thing about action widgets is that they are composable and
reusable and if you want to invoke combionations of basic operations by
other widgets, action widgets might be for you. However it is hard to
get a proper error handling with action widgets, whereas that would be
easier with message handlers.
For something I did recently, I used messages, which are cought and
processed by widgets surrounding the UI that implements the functionality.
As for your other questions:
1. Yes action widgets use the same space as any other widget and enlarge
the widget tree.
2. Yes it takes time to create action widgets, more time in fact that if
you were to initialize a message handler on startup. Also action widgets
slow down the processing of messages and refresh events, so if you have
a lot of them, you will notice that.
/Andreas
P.S.: (Note that while this sounds like any given widget can only invoke
1 string of actions, it is possible, albeit more complicated to get
multiple strings of actions)
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.