I had been playing around with other ways to do this until I got this solution and came across what may be a bug.
After setting the icon of the button, I set the height and width of the button to its formattedHeight and formattedWidth. Sometimes that worked correctly and sometimes it didn't. I haven;t quite figured out what causes it to fail, but it seems like if the height of the image is more than the height of the button, the button height and width are set correctly, otherwise they aren't. Pete lcSQL Software <http://www.lcsql.com> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html> On Fri, Oct 24, 2014 at 1:12 PM, Monte Goulding <mo...@sweattechnologies.com > wrote: > Use the resolve command. I implemented this to do exactly what you want: > get the long id of the image that is used on an icon on a given button. You > have to specify the button because that's what the icon is resolved > relative to. It uses the same code the engine does to find the icon btw. > > Cheers > > Monte > > -- > M E R Goulding > Software development services > > mergExt - There's an external for that! > > > On 25 Oct 2014, at 4:22 am, Peter Haworth <p...@lcsql.com> wrote: > > > > When setting the icon of a button, there is a hierarchy of locations that > > LC uses to find the image. However, if I subsequently try to reference > the > > image id in a script, LC won't find it unless I fully qualify where it is > > (unless it's on the current card of course). > > > > I want to set the height and width of the button to the height and width > of > > its icon image. Is there any way to find the location of the icon image > > from its ID? > > > > Pete > > lcSQL Software <http://www.lcsql.com> > > Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and > > SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html> > > _______________________________________________ > > 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 > _______________________________________________ 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