Re: Me and target of script widgets

2023-10-22 Thread Niggemann, Bernd via use-livecode
Hi David,

Stam Kapetanakis has done a script widget which can be found at

https://github.com/stam66/tristate/blob/main/com.sk.widget.tristate.livecodescript

Script Widgets are new and a bit special. Not as much as LCB but still.
You can use Stam's widget as a template of a working script widget.
I learned a lot from it.

Kind regards
Bernd
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


ANDROID player won't play MP3 from server but locally? 2

2023-10-22 Thread Klaus major-k via use-livecode
Hi friends,

OK, found at least the DELETE problem... 8-)

command delete_player
 mobileControlDo "mplayer", "stop"
  ## mobileControlDelete "player", "mplayer"

 ## has to be:
 mobileControlDelete "mplayer"
end delete_player


Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


ANDROID player won't play MP3 from server but locally?

2023-10-22 Thread Klaus major-k via use-livecode
Hi friends,

I'm having problems to play a MP3 (5 MB) from my server.
And yes, I waited up to a minute before I closed the app.
Works fine when I play it locally.

The device is connected via (not slow) W-Lan to the internet.

LC 9.6.10, macOS 12.7, Android 8.01

I created two buttons for create and delete and put this into the card script
-
command create_player

   ## This creates a black rect and nothing more?!
   ## I don't even see the ANSWER at the end of the script
   put "https://www.major-k.de/blueprint.mp3; into tURL

   ## Works immediately when using Safari browser on my Mac, 
   ## so the file is definitively there and URL correct!

   ## And yes, I added SSL & Encryption neccessary for -> httpS

   ## This works as advertised
   ## put specialfolderpath("resources") & "/blueprint.mp3" into tURL
   mobilecontrolCreate "player", "mplayer"
   mobileControlSet "mplayer", "visible", TRUE

   ## That grc is hidden:
   mobileControlSet "mplayer", "rect", (the rect of grc "player")
   mobileControlSet "mplayer", "backgroundcolor", "213,143,116"
   
   mobileControlSet "mplayer", "showController", TRUE
   mobileControlSet "mplayer", "filename", tURL
   
   if mobileControlGet("mplayer", "duration") = 0 then
  answer "Player is not initialised correctly"
   end if
   mobileControlDo "mplayer", "play"
end create_player

command delete_player
   mobileControlDo "mplayer", "stop"
   mobileControlDelete "player", "mplayer"
end delete_player

Most of the time I have to tap the "delete" button at least 5 times or more 
before the player finally disappears?
However the sound stops immediately at the first tap!?

What am I missing?
Thanks for any hint!


Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Me and target of script widgets

2023-10-22 Thread Alex Tweedly via use-livecode

Brutal answer :-)

Script widgets aren't ready for release yet. They have (effectivtely) no 
documentation, no examples, no lessons.


Unless you have a desparate need to do it now, I'd suggest waiting until 
they are somewhere near ready.


Alex.

On 22/10/2023 10:41, David Bovill via use-livecode wrote:

Having my first go at script widgets. It appears that there is either an
issue (or it is a feature) with script widgets and "me"?

A handler like this:

*on* mouseUp

*## All references are to "inner" controls (ie the target) and not the
group*

*put* the short id of me into shortID

*put* the long id of the target into sName

*put* the long id of me into myID

*## Have to be explicit with messages*

*-- dispatch "menu_AskEdit" to me -- or the target does not work*

*dispatch* "menu_AskEdit" to this card with myID,shortID

*end* mouseUp

When inside a script only widget shows that would normally pass the long id
of the control clicked on within the group (script widget) with myID and
the short ID of the group (script widget) itself in shortID. However both
the target and me refer to the control and not the group / script widget.
It seems there is no easy way to find out a reference to "me" in a
script widget?

I've a lot of scripts that use "me" in behaviors for potential script
widgets - so looking for a short term and long term solution for this?
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Me and target of script widgets

2023-10-22 Thread David Bovill via use-livecode
Having my first go at script widgets. It appears that there is either an
issue (or it is a feature) with script widgets and "me"?

A handler like this:

*on* mouseUp

*## All references are to "inner" controls (ie the target) and not the
group*

*put* the short id of me into shortID

*put* the long id of the target into sName

*put* the long id of me into myID

*## Have to be explicit with messages*

*-- dispatch "menu_AskEdit" to me -- or the target does not work*

*dispatch* "menu_AskEdit" to this card with myID,shortID

*end* mouseUp

When inside a script only widget shows that would normally pass the long id
of the control clicked on within the group (script widget) with myID and
the short ID of the group (script widget) itself in shortID. However both
the target and me refer to the control and not the group / script widget.
It seems there is no easy way to find out a reference to "me" in a
script widget?

I've a lot of scripts that use "me" in behaviors for potential script
widgets - so looking for a short term and long term solution for this?
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode