Thank you. I am going to try this.bn wrote: ↑Mon Mar 25, 2024 11:13 amHi Pugalug,
You could name your images like "horse1", "horse2" etc. and thenI have imported as control some image files and saved them to a separate card in my stack. I want to use these images as button icons. I am making a spinner game and the id of the images keeps changing
Code: Select all
set the icon of button "myHorseButton" to the short id of image "horse1" of card "myImages"
Kind regardsCode: Select all
set the icon of button "myHorseButton" to the short id of image "horse2" of card "myImages"
Bernd
Rename an Icon?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Rename an Icon?
Re: Rename an Icon?
Yes, I think this is what is going on. The only thing is I did not cut or paste the image at all. The icon IDs are changing anyway. I DID copy and paste the buttons the different icons would end up on. Could that be the reason the icon IDs are changing? Thank you!dunbarx wrote: ↑Mon Mar 25, 2024 2:47 pmI imported an image onto a card and recorded the ID that LC assigned to it: 1003
I then cut the image and immediately pasted it. The ID of that image was 1006.
This all makes sense to me. The IDE creates ID's as controls are created, without any thought to maintaining their original assignments. It obviously keeps track of previous assignments, and cares nothing about the fact that it is the very same control put back in the very same location. But is that sort of thing the issue is here?
Craig
Re: Rename an Icon?
Hi.
The ID of one control will not change whatever you do to any other. I believe we are all pretty sure about that. Ironically, what LC touts as an unchangeable and invulnerable property (the ID) seems not to be in your setup. There has to be something else going on. This issue has never come up before.
So you have two paths. First, stay with your current work and try to figure out why the ID's are (seem to be) unstable.
Second, and I recommend this, change all your control references to name references. They are far more descriptive, do not change at all on their own, and as others have pointed out, can be named with the idea of keeping similar or related controls "together" in "groups". I do this all the time, with some naming schemes running into hundreds.
It hopefully will not take long to completely switch over. Just search for every case sensitive instance of "ID" in all your scripts so you do not miss any.
It may or may not then be of any interest for you to ferret out what is going on with those pesky ID's.
Craig
The ID of one control will not change whatever you do to any other. I believe we are all pretty sure about that. Ironically, what LC touts as an unchangeable and invulnerable property (the ID) seems not to be in your setup. There has to be something else going on. This issue has never come up before.
So you have two paths. First, stay with your current work and try to figure out why the ID's are (seem to be) unstable.
Second, and I recommend this, change all your control references to name references. They are far more descriptive, do not change at all on their own, and as others have pointed out, can be named with the idea of keeping similar or related controls "together" in "groups". I do this all the time, with some naming schemes running into hundreds.
It hopefully will not take long to completely switch over. Just search for every case sensitive instance of "ID" in all your scripts so you do not miss any.
It may or may not then be of any interest for you to ferret out what is going on with those pesky ID's.
Craig
Re: Rename an Icon?
Have you noted the succession of changed ID's? In other words, if you copy and paste (or clone) a control the new ID will follow closely if not perfectly the ID of the lastmost created control. Do yours do that?
You can use the "newImage" message to find out. That is sent each time a new image is created, pasted, whatever. I am assuming that these rogue images with "new" ID's will come along with that message .
Craig
Craig
You can use the "newImage" message to find out. That is sent each time a new image is created, pasted, whatever. I am assuming that these rogue images with "new" ID's will come along with that message .
Craig
Craig
Re: Rename an Icon?
And you can set an alarm to go off whenever a "newImage" message is sent. Just trap it in the stack script:
Make sure your sound is turned up loud.
Craig
Code: Select all
on newImage
beep until the optionkey is down
end newimage
Craig
Re: Rename an Icon?
Not sure that makes sense...
If you are referencing the ID, this can ONLY change if the image is copy/pasted or duplicated. Otherwise the ID is largely immutable. However I'm not sure that's what you're talking about, since you mention icon names (not icon IDs)
you could share a tiny stack exemplifying your issue, sometimes it becomes clearer then...
Re: Rename an Icon?
Stam.
(s)he ??
Certainly compact, but these days does not cover all bases...
Craig
(s)he ??
Certainly compact, but these days does not cover all bases...
Craig
Re: Rename an Icon?
Pugalug
What Stam said. Please be careful. Mixing "name" and " ID" makes it difficult to determine what is really going on...
How did you find out that referencing an image (or an icon?) caused a problem? Was it that the wrong control appeared, different from what you expected?
Craig
What Stam said. Please be careful. Mixing "name" and " ID" makes it difficult to determine what is really going on...
How did you find out that referencing an image (or an icon?) caused a problem? Was it that the wrong control appeared, different from what you expected?
Craig
Re: Rename an Icon?
Stam.
Are you from the South? I was once. Anyway, I know you are not, so I will inform you that what you just mentioned would be spelled, and pronounced, "sheeit".
Craig
Are you from the South? I was once. Anyway, I know you are not, so I will inform you that what you just mentioned would be spelled, and pronounced, "sheeit".
Craig
Re: Rename an Icon?
Yes Craig.
That’s why I mentioned it may cause offence and I don’t use this.
(S)he is but the smallest compromise in trying to address someone whose gender is not evident by their chosen username. And yes, I do like my code compact
Iif that’s not good enough, they should put their desired pronouns in their signature and I would respect that.
But I am not gonna list every possible pronoun
And definitely not using (s)he-it
That’s why I mentioned it may cause offence and I don’t use this.
(S)he is but the smallest compromise in trying to address someone whose gender is not evident by their chosen username. And yes, I do like my code compact
Iif that’s not good enough, they should put their desired pronouns in their signature and I would respect that.
But I am not gonna list every possible pronoun
And definitely not using (s)he-it
-
- Livecode Opensource Backer
- Posts: 9746
- Joined: Fri Feb 19, 2010 10:17 am
Re: Rename an Icon?
Why not just use 'They' and 'them' and then whatever anyone's gender is, was, is imagined to be, and so on, should not matter at all?
Re: Rename an Icon?
I only use plural form for members of the Royal familyrichmond62 wrote: ↑Tue Mar 26, 2024 9:07 amWhy not just use 'They' and 'them' and then whatever anyone's gender is, was, is imagined to be, and so on, should not matter at all?
On a more serious note: One is not many.
He or she or it or dolphin is not “they”. If people are easily offended because preferred to be called dolphin they should make it clear. It’s up to them, not me, to inform.
I’m not going to guess and unless I know better I will use the pronouns for biological sex, not some unknown self-assigned gender. Hence instead of “He or she” I’ll write (s)he. Unless I’m informed otherwise, in which case, no problem.
If that offends, it may be a sign of needing to get out more.
-
- Livecode Opensource Backer
- Posts: 9746
- Joined: Fri Feb 19, 2010 10:17 am
Re: Rename an Icon?
As English is one of my 2 native languages, and as I make my 'bread and cheese' by teaching English as a Foreign language, I have learnt that Grammatical Purism can only go so far: after all, the creepy people who write Prescriptive Grammar books need to get out more.
And if you ain't sure about that . . .
Certainly a "quick spin round the internet" will show you that the use of 'they' and 'them' as a singular has been in common parlance (i.e. English-as-she-is-used rather than what some stuffed-shirt has handed down from on high as how-it-should-be-used), as well as, interestingly enough "themself" (which does make my toes curl up).
I am sure that the use of 'them' and 'they' as singular forms came into use when people worked out that when you meet a bearded lady in the supermarket and want to tell your, err, "significant other" about that event lady you don't really want to spend 15 minutes fishing for some appropriate personal pronoun.
When I signed up to Facebook I was given a choice of 57 genders to choose from: and my reaction was "Who has been so clever to fool the Facebook people into employing them to cook up all than nonsense?"
And if you ain't sure about that . . .
Certainly a "quick spin round the internet" will show you that the use of 'they' and 'them' as a singular has been in common parlance (i.e. English-as-she-is-used rather than what some stuffed-shirt has handed down from on high as how-it-should-be-used), as well as, interestingly enough "themself" (which does make my toes curl up).
I am sure that the use of 'them' and 'they' as singular forms came into use when people worked out that when you meet a bearded lady in the supermarket and want to tell your, err, "significant other" about that event lady you don't really want to spend 15 minutes fishing for some appropriate personal pronoun.
When I signed up to Facebook I was given a choice of 57 genders to choose from: and my reaction was "Who has been so clever to fool the Facebook people into employing them to cook up all than nonsense?"
Re: Rename an Icon?
Perhaps both you and others need to have critical think about what you're posting here.
This is as you know a programming forum, not the grammar/syntax/political correctness policing headquarters.
The fact that you and Craig expend so much energy about my use of 3 letters says more about you than you obviously realise.
I have never used an ignore list before, so I guess you should feel honoured, because frankly I've had enough now.
This is as you know a programming forum, not the grammar/syntax/political correctness policing headquarters.
The fact that you and Craig expend so much energy about my use of 3 letters says more about you than you obviously realise.
I have never used an ignore list before, so I guess you should feel honoured, because frankly I've had enough now.