Re: Oddity in 'currentCard' function?

2023-10-26 Thread J. Landman Gay via use-livecode

On 10/26/23 2:26 PM, J. Landman Gay via use-livecode wrote:




It can be read if you supply syntax that requests a legal value; i.e.:

   the name of the currentCard of stack X
   the loc of the currentCard of stack X
   the backColor of the currentCard of stack X


Oops. That's wrong. It errors. This:

  put the loc of cd the currentcard of stack X
  etc...

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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: Oddity in 'currentCard' function?

2023-10-26 Thread J. Landman Gay via use-livecode

On 10/26/23 11:17 AM, Mark Wieder via use-livecode wrote:

So basically to stay out of trouble "currentcard" should be thought of as a 
write-only property?


It can be read if you supply syntax that requests a legal value; i.e.:

  the name of the currentCard of stack X
  the loc of the currentCard of stack X
  the backColor of the currentCard of stack X

Cards themselves have no intrinsic value (what would they return?) but their properties do. 
Similarly, what would expect to see if you:


   answer stack X

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
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: some mobilecontrolprops do not work on Android?

2023-10-26 Thread J. Landman Gay via use-livecode
The backgroundColor and alpha settings might be a dictionary error. The opaque setting says it 
is available only for iOS.


I think the appearance of mobile players is set directly by the OS now, so the color and 
transparency may not be available on Android.


On 10/26/23 9:56 AM, Klaus major-k via use-livecode wrote:

Hi friends,

I (now successfully :) create a player for MP3 playback,
however some properties do not seem to work on Android,
although the Dictionary states otherwise!?
--
  mobilecontrolCreate "player", "mplayer"
  mobileControlSet "mplayer", "visible", TRUE
  mobileControlSet "mplayer", "rect", (the rect of grc "player")

## Does nothing:
  mobileControlSet "mplayer", "backgroundcolor", "213,143,116"

  mobileControlSet "mplayer", "showController", TRUE

  mobileControlSet "mplayer", "filename", tURL
  
## Whatever I set here, on Android I always get a black rect with

## the player controls inside of it.
  mobileControlSet "mplayer", "opaque", FALSE

## Whatever value I enter here, nothing will change the apprearance
  mobileControlSet "mplayer", "alpha", 127
--
Before I report this, is this a dictionary bug or what?
Or is it just me again? :-D


Best

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

Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
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: Oddity in 'currentCard' function?

2023-10-26 Thread Mark Wieder via use-livecode

On 10/26/23 01:44, Mark Waddingham via use-livecode wrote:

Basically, its main use was for changing card (i.e. as a settable 
property); rather than finding out what card was current (since that was 
already catered for via interrogating 'this card of this stack').


So basically to stay out of trouble "currentcard" should be thought of 
as a write-only property?


--
 Mark Wieder
 ahsoftw...@gmail.com


___
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


some mobilecontrolprops do not work on Android?

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

I (now successfully :) create a player for MP3 playback,
however some properties do not seem to work on Android,
although the Dictionary states otherwise!?
--
 mobilecontrolCreate "player", "mplayer"
 mobileControlSet "mplayer", "visible", TRUE
 mobileControlSet "mplayer", "rect", (the rect of grc "player")

## Does nothing:
 mobileControlSet "mplayer", "backgroundcolor", "213,143,116"
   
 mobileControlSet "mplayer", "showController", TRUE
 mobileControlSet "mplayer", "filename", tURL
 
## Whatever I set here, on Android I always get a black rect with 
## the player controls inside of it.
 mobileControlSet "mplayer", "opaque", FALSE

## Whatever value I enter here, nothing will change the apprearance
 mobileControlSet "mplayer", "alpha", 127
--
Before I report this, is this a dictionary bug or what?
Or is it just me again? :-D


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: Oddity in 'currentCard' function?

2023-10-26 Thread Paul Dupuis via use-livecode

On 10/26/2023 4:44 AM, Mark Waddingham via use-livecode wrote:
Basically, its [currentCard] main use was for changing card (i.e. as a 
settable property); rather than finding out what card was current 
(since that was already catered for via interrogating 'this card of 
this stack'). 


FYI - this is exactly what we use currentCard for in our application - 
change the card that will be displayed when a user shows/opens a stack 
to match a change in user data when the stack is not actually open yet.


___
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: Oddity in 'currentCard' function?

2023-10-26 Thread Mark Waddingham via use-livecode

On 2023-10-25 13:57, Paul Dupuis via use-livecode wrote:

On 10/25/2023 12:34 AM, Mark Waddingham via use-livecode wrote:


If you want to do stuff with the current card of a stack, then don't 
use the currentCard property - 'this card of stack ...' *is* a chunk 
reference and thus it doesn't care whether the card has a name or not.




Okay, I get that  id  is a legacy return value when 
there is no name.


I'd just like to confirm that:

this card of stack "X"
and
the currentCard of stack "X"

refer to the same card, even if in different ways (actual object 
reference vs short name)?


Yes - 'the currentCard of stack "X"' is equivalent to 'the short name of 
this card of stack X'.


The currentCard property was added a very long time ago to be used by a 
project which never saw the light of day (I'm not sure I remember what 
it was now!)...


There was (apparently!) a need at that time to be able to switch cards 
in a stack *without* the stack coming to front (which is what happens 
when you use the only alternative 'go card ... of stack').


It was added as a property as that was the quickest/fastest way to do 
so, for something which I don't remember being entirely convinced by at 
the time - it wasn't documented for a long time, but then I think 
someone asked about it and it had been there long enough and it doesn't 
do any harm really so it was documented.


Basically, its main use was for changing card (i.e. as a settable 
property); rather than finding out what card was current (since that was 
already catered for via interrogating 'this card of this stack').


With hindsight, if the ability to switch cards without bringing the 
stack to front is indeed useful then it should probably be provided via 
a new command, or an augmentation of the 'go' command (like we have go 
visible / go invisible).


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Build Amazing Things

___
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: Oddity in 'currentCard' function?

2023-10-26 Thread Mark Waddingham via use-livecode

On 2023-10-25 15:41, Craig Newman via use-livecode wrote:

Paul.

The construction "answer this card of stack “X” does not work if you 
are not on stack “X”:


answer the  currentCard of stack  “X”  —works

answer the name of this card of stack “X —works

answer this card of stack “X”—Nope


'this card of this stack' is an object reference - when evaluated in 
contexts which don't expect an object reference, object references 
return the *content* of the object, or an error (if the object has no 
content)... Only buttons and fields have content - in which case 
evaluating them returns the 'text' of the object.


Most things *don't* expect an object reference - places that do are 
where an object needs to be acted on, rather than a value being needed.


For example:

  set the X of 
  put exists()
  put there is an 
  answer 

Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Build Amazing Things

___
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