Sachin Desai
2005-10-19 03:18:57 UTC
I'm trying to understand how to do tile scripting in Tweak. What I'd
like to be able to do is to write
a script that listens on an event and when triggered, perform an
action or a set of actions.
I see the standard events in CEventType and have defined my own class
in a similar manner that
returns user specific events that I'd like to listen for.
In CTileDefinition, I've defined a category and added a type for the
class based on forEach:do:until:
in "test and repeat" as this was the closest match to what I was
looking for.
<category name="MyTest" type="MyTestClass">
<message selector="forEach:do:" name="for each:do:" help="my event
control structure">
<argument name="event" type="CMyEventType" default="myevent"/>
<argument name="block" type="CBlockType"/>
</message>
</category>
The above is modeled on this:
<category name="test and repeat">
...
<message selector="forEach:do:until:" name="for each:do:until:"
help="control structure">
<argument name="event" type="CEventType" default="mouseMove"/>
<argument name="block" type="CBlockType"/>
<argument name="stopEvent" type="CEventType" default="mouseUp"/>
</message>
...
When I open the viewer, I see the category name and I can drag the
tile and select the event. My question
is how do I add content to the block or what can I put there? Am I on
the right track? What I'd really like to
do is to add other tiles that are actions for the tasks I want
performed.
Any guidance/help would be greatly appreciated.
-- Sachin.
like to be able to do is to write
a script that listens on an event and when triggered, perform an
action or a set of actions.
I see the standard events in CEventType and have defined my own class
in a similar manner that
returns user specific events that I'd like to listen for.
In CTileDefinition, I've defined a category and added a type for the
class based on forEach:do:until:
in "test and repeat" as this was the closest match to what I was
looking for.
<category name="MyTest" type="MyTestClass">
<message selector="forEach:do:" name="for each:do:" help="my event
control structure">
<argument name="event" type="CMyEventType" default="myevent"/>
<argument name="block" type="CBlockType"/>
</message>
</category>
The above is modeled on this:
<category name="test and repeat">
...
<message selector="forEach:do:until:" name="for each:do:until:"
help="control structure">
<argument name="event" type="CEventType" default="mouseMove"/>
<argument name="block" type="CBlockType"/>
<argument name="stopEvent" type="CEventType" default="mouseUp"/>
</message>
...
When I open the viewer, I see the category name and I can drag the
tile and select the event. My question
is how do I add content to the block or what can I put there? Am I on
the right track? What I'd really like to
do is to add other tiles that are actions for the tasks I want
performed.
Any guidance/help would be greatly appreciated.
-- Sachin.