the owner of img id (the icon of btn "myBtn")

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

the owner of img id (the icon of btn "myBtn")

Post by jmburnod » Sat Aug 16, 2014 1:33 pm

I'm not clear with the owner of a control.
I want to get the owner of each icon of all btns of a stack (for cleaning a stack)

I get two different results with the owner of img id (the icon of btn "myBtn")
1. If the cd which contains the image has been not opened, the owner of img id (the icon of btn "myBtn") return the name of the current stack.
2. If the cd which contains the image has been opened, the owner of img id (the icon of btn "myBtn") return the name of the card which contains the image

Is there someone to confirm this understanding ?
Best
Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: the owner of img id (the icon of btn "myBtn")

Post by dunbarx » Sat Aug 16, 2014 7:33 pm

Hmmm.

I make and save a new stack with two cards. On the second card I place a field. Quit LC. Opening that stack again, in msg:

Code: Select all

answer the owner of fld 1 of card 2
I get the card as the owner. Is this similar to your setup?

Craig Newman

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: the owner of img id (the icon of btn "myBtn")

Post by jmburnod » Sat Aug 16, 2014 9:02 pm

Hi Craig,
Yes. I have the same result for:

Code: Select all

answer the owner of fld 1 of card 2
but the result change with

Code: Select all

answer the owner of fld id 1007 
Result 1: If cd 2 has been not opened = the name of the stack
Result 2: If cd 2 has been opened = the id of the cd where the field is

Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: the owner of img id (the icon of btn "myBtn")

Post by dunbarx » Sun Aug 17, 2014 1:41 am

Jean-Marc.

I get the same answer, the card, whether I ask for the ID of that field or its number. This is in a new session, with the test stack opening LC from the finder.

The query comes from the message box or from a button on card 1. OSX 10.6, LC 6.2.2.

Craig

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: the owner of img id (the icon of btn "myBtn")

Post by jmburnod » Wed Aug 20, 2014 4:21 pm

Hi Craig,
I get the same answer, the card, whether I ask for the ID of that field or its number
Yes if you give the name of the cd, but not if you use the control short id only

I want get a list of the used images like icon by btns with two cleaning goals (I dream sometimes about a sweet couple Conchita-Nestor who are working for me)

1. Verify if images used like icon exists
2. Delete images not used like icons

The owner of an id control (without the name of cd) return:
1. The name of the stack if the card where is the control was not opened
2. The card id where is the control if this card was opened

Is it the same for you ?

Jean-Marc
https://alternatic.ch

Post Reply