Rename an Icon?

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Rename an Icon?

Post by richmond62 » Tue Mar 26, 2024 11:07 am

Perhaps both you and others
Quite possibly. 8)

But it "weren't" me that started making 'funny OT noises' anent s/he.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Rename an Icon?

Post by richmond62 » Tue Mar 26, 2024 11:19 am

Now: at the risk of spoiling some people's fun, an on-topic comment:

and a very boring one at that . . . lots of words going down; so I thought I'd do something "babyish" instead:

1. Set up a stack and imported an image into it, and found that the ID assigned to that image was 1003:
-
Screenshot 2024-03-26 at 12.14.07.png
-
2. Imported a second image, and found that the ID assigned to that image was 1004:
-
Screenshot 2024-03-26 at 12.17.03.png
-
All incredibly pedestrian, as expected, and "babyish".

Now let's see if I can muck 'things' up.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Rename an Icon?

Post by richmond62 » Tue Mar 26, 2024 11:21 am

Set up a button big enough to accommodate my first image (ID 1003) as an icon:
-
Screenshot 2024-03-26 at 12.20.17.png
-
And that seems all as it should be (ID is still 1003):
-
Screenshot 2024-03-26 at 12.22.19.png
-

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Rename an Icon?

Post by richmond62 » Tue Mar 26, 2024 11:27 am

I made a second CARD in my stack, with a new BUTTON, and assigned the same image as in the button on the first card to it:
-
Screenshot 2024-03-26 at 12.26.08.png
Screenshot 2024-03-26 at 12.26.08.png (94.07 KiB) Viewed 457 times
-
No obvious problems there (image ID still 1003).

So, I thought I would try this in a button:

Code: Select all

on mouseUp
   set the icon of btn "Another Button" to image ID 1004
end mouseUp
And the button went BLANK!

So I tried this:

Code: Select all

on mouseUp
   set the icon of btn "Another Button" to image ID 1004 of card ID 1005
end mouseUp
and the button "threw a bluey".

This:

Code: Select all

on mouseUp
   set the icon of btn "Another Button" to the ID of image "figureY.jpg" of card ID 1005
end mouseUp
was also NBG.

This:

Code: Select all

on mouseUp
   set the icon of btn "Another Button" to image "figureY.jpg" of card "cFIRST"
end mouseUp
while NOT throwing up a warning, did NOT assign an icon.

This DID:

Code: Select all

on mouseUp
   set the icon of btn "Another Button" to the short ID of image "figureY.jpg" of card "cFIRST"
end mouseUp
Which, quite frankly, strikes me as a very clunky way to do things.

WHAT is the difference between a short ID and an ID?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Rename an Icon?

Post by richmond62 » Tue Mar 26, 2024 11:45 am

Cripes: sorry I asked:
-
ID stuff.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Rename an Icon?

Post by richmond62 » Tue Mar 26, 2024 11:53 am

What IS obvious is that once an image is imported into a stack its ID is immutable.

So, the only way an image could appear to have changed its ID is if it is not the original image at all but a copy of it.

For instance, if I set up a single card stack with a single image:
-
Screenshot 2024-03-26 at 12.48.24.png
Screenshot 2024-03-26 at 12.48.24.png (47.04 KiB) Viewed 450 times
-
and then CLONE that card:
-
Screenshot 2024-03-26 at 12.50.10.png
Screenshot 2024-03-26 at 12.50.10.png (91.49 KiB) Viewed 450 times
-
We find that the 'same' image on the new card has been assigned a NEW ID:
-
Screenshot 2024-03-26 at 12.51.35.png
Screenshot 2024-03-26 at 12.51.35.png (75.95 KiB) Viewed 450 times
-
And, of course, the reason the image has been assigned a new ID is because it is NOT the same image as the one on the first card.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9389
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Rename an Icon?

Post by richmond62 » Tue Mar 26, 2024 11:54 am

Now: anyone wanting to get back to "gender studies"? 8)

pugalug
Posts: 15
Joined: Mon Jan 29, 2024 9:19 pm

Re: Rename an Icon?

Post by pugalug » Wed Mar 27, 2024 3:06 am

stam wrote:
Mon Mar 25, 2024 9:13 pm
dunbarx wrote:
Mon Mar 25, 2024 8:57 pm
Stam.

(s)he ??

Certainly compact, but these days does not cover all bases...

Craig
adding "it" to the end of (s)he is likely to cause offence ;)
Definitely! I am a SHE :D I'm glad you guys are having fun helping me. You did help! I really appreciate it! Thank you to all of yous. :wink:

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”