What do you mean by this? Do you mean adding a handler to the built widget's script window?To my surprise, when I attempted to add a "mouseUp handler script" to the Script Widget in the stack, it failed to trigger![]()
Or inside the scriptOnlyStack that builds the widget?
If it's the former, you probably have to send the message to the owner.
If using in a group, it needs to be handled in the parent, but in a script widget, it ends up in the widget script's left pane/list of handlers.
eg - in the scriptOnlyStack:
CODE:
on mouseUp send "mouseUp" to the owner of meend mouseUp
Not tested this specific code, but *should* work... I don't know if the message, being a reserved word, will be an issue, but you can replace it with whatever you want if it is...
Discussion (with some input from @livecodeali) here: viewtopic.php?t=38572
I've had 1 success with script widgets and a couple of troubled results, but it's *a lot* of deceptively hard work... It feels like it shouldn't be, but it is... to the point that I've just gone back to using groups (but having now followed the code pattern needed for SW, these are more robust).
Maybe I'll pick these up again some day, but life is busy and short...
If you are going to create a script widget with Livecode's script editor, using Bernd's code-folding solution is a must... viewtopic.php?f=9&t=38912
Statistics: Posted by stam — Tue May 07, 2024 7:29 pm