[twdev] [TW5] pushtop and lists as arrays?

2015-03-07 Thread PE Pat
One more question: Ok, this one might seem rather basic, but how are arrays written into tiddler fields in TW? I've seen a lot of code with the $tw.pushTop(array, newItem), which I gather adds newItem to the beginning of array. But does that command itself change the value stored in array, or

[twdev] Re: [TW5] Action widgets vs. Messages

2015-03-07 Thread PE Pat
Thanks BJ, your explanation that you linked to was very helpful. I am both concerned with ease of coding (on my end) and response time (on the user end). Let me see if I understand this correctly: by invoking an action, a new child is created, so the control gets passed to the new child

[twdev] Re: [TW5] pushtop and lists as arrays?

2015-03-07 Thread PMario
Hi Pat, IMO you are referring to $tw.utils.pushTop() [1]. As you can see in the source the function has a return value. So it's possible to say: var x = $tw.utils.pushTop([my], test) and var x = [my]; $tw.utils.pushTop(x, [test, asdf]) which has the same function. JS references variables by

[twdev] [TW5] Action widgets vs. Messages

2015-03-07 Thread PE Pat
Hi all, As I learn more about TW, I am coming into more contact with its core structure, but I still don't really understand it. What is the difference between action widgets and messages, in terms of how they are handled and how they can be used? My usecase: a unit planner app, which is

[twdev] Re: [TW5] Action widgets vs. Messages

2015-03-07 Thread BJ
HI Pat, when you are writing a widget which response to some event, it is possible to cause other events. Action events (at present) are children - so the control passes in the direction away from the root of the widget tree, conversely messages travel in the other direction, toward the root,

Re: [twdev] Re: [TW5] Action widgets vs. Messages

2015-03-07 Thread Felix Küppers
Hi For something I did recently, I used messages, which are cought and processed by widgets surrounding the UI that implements the functionality. Andreas advice is good. TW allows you to add event properties via widget attributes and then you can access them from within your handler code

Re: [twdev] Re: [TW5] Action widgets vs. Messages

2015-03-07 Thread PE Pat
Thank you Felix and Andreas. You've given me a lot to think about, and work with. On Saturday, March 7, 2015 at 4:02:45 PM UTC-5, Felix Küppers wrote: Hi For something I did recently, I used messages, which are cought and processed by widgets surrounding the UI that implements the

[twdev] Re: [TW5] pushtop and lists as arrays?

2015-03-07 Thread PMario
I forgot. Field names must be lower case only! -m -- 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 tiddlywikidev+unsubscr...@googlegroups.com. To post to this

[twdev] Re: [TW5] pushtop and lists as arrays?

2015-03-07 Thread PMario
On Saturday, March 7, 2015 at 7:37:11 PM UTC+1, PE Pat wrote: And once that push has been executed, how do you use the array in the addTiddler command to rewrite a list field? If you open your browser console (F12) at tiddlywiki.com and type: $tw.wiki.getTiddler(HelloThere) You'll get a

Re: [twdev] Re: [TW5] Action widgets vs. Messages

2015-03-07 Thread Andreas Hahn
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

[twdev] Re: [TW5] pushtop and lists as arrays?

2015-03-07 Thread PE Pat
Thanks Mario, this is very helpful. On Saturday, March 7, 2015 at 3:10:06 PM UTC-5, PMario wrote: On Saturday, March 7, 2015 at 7:37:11 PM UTC+1, PE Pat wrote: And once that push has been executed, how do you use the array in the addTiddler command to rewrite a list field? If you open