Re: button ICON

2019-04-22 Thread Stephen Barncard via use-livecode
.. or is that what is new in V9x?
--
Stephen Barncard - Sebastopol Ca. USA -
mixstream.org


On Mon, Apr 22, 2019 at 11:11 AM Stephen Barncard 
wrote:

> and there can't be a 'name' of a graphic?  That would solve the problems!
> I thought I tried this once and it worked.
> sqb
> --
> Stephen Barncard - Sebastopol Ca. USA -
> mixstream.org
>
>
> On Mon, Apr 22, 2019 at 9:59 AM Bob Sneidar via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> As an added technique, if you have a single folder containing all your
>> images, and your buttons already point to the image file for reference, you
>> can "skin" your applications by simply swapping out the image folder with a
>> different set of images with the same names, then reloading your stack.
>>
>> Bob S
>>
>>
>> > On Apr 22, 2019, at 09:32 , Phil Davis via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> >
>> > Thanks hh - I concur. Your approach seems cleaner.
>> > Phil
>> >
>> >
>> > On 4/22/19 9:20 AM, hh via use-livecode wrote:
>> >> As Phil said, but don't set the text of the (empty) image
>> >> used as icon  of the button but set the filename of the image.
>> >>
>> >> The icon will change accordingly.
>>
>>
>> ___
>> 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


Re: button ICON

2019-04-22 Thread Stephen Barncard via use-livecode
and there can't be a 'name' of a graphic?  That would solve the problems!
I thought I tried this once and it worked.
sqb
--
Stephen Barncard - Sebastopol Ca. USA -
mixstream.org


On Mon, Apr 22, 2019 at 9:59 AM Bob Sneidar via use-livecode <
use-livecode@lists.runrev.com> wrote:

> As an added technique, if you have a single folder containing all your
> images, and your buttons already point to the image file for reference, you
> can "skin" your applications by simply swapping out the image folder with a
> different set of images with the same names, then reloading your stack.
>
> Bob S
>
>
> > On Apr 22, 2019, at 09:32 , Phil Davis via use-livecode <
> use-livecode@lists.runrev.com> wrote:
> >
> > Thanks hh - I concur. Your approach seems cleaner.
> > Phil
> >
> >
> > On 4/22/19 9:20 AM, hh via use-livecode wrote:
> >> As Phil said, but don't set the text of the (empty) image
> >> used as icon  of the button but set the filename of the image.
> >>
> >> The icon will change accordingly.
>
>
> ___
> 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


Re: button ICON

2019-04-22 Thread Bob Sneidar via use-livecode
As an added technique, if you have a single folder containing all your images, 
and your buttons already point to the image file for reference, you can "skin" 
your applications by simply swapping out the image folder with a different set 
of images with the same names, then reloading your stack. 

Bob S


> On Apr 22, 2019, at 09:32 , Phil Davis via use-livecode 
>  wrote:
> 
> Thanks hh - I concur. Your approach seems cleaner.
> Phil
> 
> 
> On 4/22/19 9:20 AM, hh via use-livecode wrote:
>> As Phil said, but don't set the text of the (empty) image
>> used as icon  of the button but set the filename of the image.
>> 
>> The icon will change accordingly.


___
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: button ICON

2019-04-22 Thread Phil Davis via use-livecode

Thanks hh - I concur. Your approach seems cleaner.
Phil


On 4/22/19 9:20 AM, hh via use-livecode wrote:

As Phil said, but don't set the text of the (empty) image
used as icon  of the button but set the filename of the image.

The icon will change accordingly.

___
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




--
Phil Davis


___
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: button ICON

2019-04-22 Thread hh via use-livecode
As Phil said, but don't set the text of the (empty) image
used as icon  of the button but set the filename of the image.

The icon will change accordingly.

___
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: button ICON

2019-04-22 Thread Phil Davis via use-livecode

Hi Klaus,

The only method I can think of is where you set the icon of a button to 
the id of an image object, and then set the text of that image object to 
the binfile url of different image files. That does work, but may not be 
what you're looking for.


Best -
Phil Davis


On 4/20/19 9:36 AM, Klaus major-k via use-livecode wrote:

Hi friends,

I have a vague memory that we can use images as icons in buttons WITHOUT
putting them in an image object first. Am I right or was I dreaming? :-)

Thanks for any hints.


Best

Klaus
--
Klaus Major
http://www.major-k.de
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




--
Phil Davis


___
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: button ICON

2019-04-22 Thread Klaus major-k via use-livecode
Hi Bob,

> Am 22.04.2019 um 18:00 schrieb Bob Sneidar via use-livecode 
> :
> 
> I was responding to Tom Glod's question, "why do u need to use images without 
> loading them into the stack?"

oh, sorry, that was not obvious.

> This technique can be used to make buttons with graphics portable, which is 
> the root of the question. 

Not of my question! :-)

> Bob S

Best

Klaus

--
Klaus Major
http://www.major-k.de
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: button ICON

2019-04-22 Thread Bob Sneidar via use-livecode
I was responding to Tom Glod's question, "why do u need to use images without 
loading them into the stack?" This technique can be used to make buttons with 
graphics portable, which is the root of the question. 

Bob S

> On Apr 22, 2019, at 08:30 , Klaus major-k via use-livecode 
>  wrote:
> 
> Hi Bob,
> 
>> Am 22.04.2019 um 17:10 schrieb Bob Sneidar via use-livecode 
>> :
>> I guess this goes way back to a long standing conversation as to the way 
>> buttons with graphics work in the first place. Let's say you have a group 
>> with several buttons. You now want to copy it to another project. Since the 
>> graphics are ALREADY OPEN in the project you copied from the button graphics 
>> *seem* to display fine. Until you quit livecode then open the target project 
>> by itself. No graphics! 
>> ...
>> on newBackground
>> ...
>> end newBackground
> 
> thanks, but that is not I was looking (or asking) for.
> 
>>> On Apr 20, 2019, at 09:36 , Klaus major-k via use-livecode 
>>>  wrote:
>>> Hi friends,
>>> I have a vague memory that we can use images as icons in buttons WITHOUT 
>>> putting them in an image object first. Am I right or was I dreaming? :-)
> 
> I obviously mixed this somehow with IMAGESOURCE where we can actually:
> ...
> set the imagesource of char 1 of fld 1 to "binfile:path/on disk/to 
> your/image.jpg"
> ...
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> http://www.major-k.de
> 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: button ICON

2019-04-22 Thread Klaus major-k via use-livecode
Hi Bob,

> Am 22.04.2019 um 17:10 schrieb Bob Sneidar via use-livecode 
> :
> I guess this goes way back to a long standing conversation as to the way 
> buttons with graphics work in the first place. Let's say you have a group 
> with several buttons. You now want to copy it to another project. Since the 
> graphics are ALREADY OPEN in the project you copied from the button graphics 
> *seem* to display fine. Until you quit livecode then open the target project 
> by itself. No graphics! 
> ...
> on newBackground
>  ...
> end newBackground

thanks, but that is not I was looking (or asking) for.

>> On Apr 20, 2019, at 09:36 , Klaus major-k via use-livecode 
>>  wrote:
>> Hi friends,
>> I have a vague memory that we can use images as icons in buttons WITHOUT 
>> putting them in an image object first. Am I right or was I dreaming? :-)

I obviously mixed this somehow with IMAGESOURCE where we can actually:
...
set the imagesource of char 1 of fld 1 to "binfile:path/on disk/to 
your/image.jpg"
...


Best

Klaus
--
Klaus Major
http://www.major-k.de
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: button ICON

2019-04-22 Thread Bob Sneidar via use-livecode
I guess this goes way back to a long standing conversation as to the way 
buttons with graphics work in the first place. Let's say you have a group with 
several buttons. You now want to copy it to another project. Since the graphics 
are ALREADY OPEN in the project you copied from the button graphics *seem* to 
display fine. Until you quit livecode then open the target project by itself. 
No graphics! 

The fix is to go back to the original project, find all the graphics (probably 
hidden), copy those as well to the target app, edit the icons of the buttons to 
now point at the NEW ID's of the graphics, and hope you don't get it wrong. 

Someone showed me a trick. First group the graphics with the buttons they 
belong to. Then group all your individual button groups together. Finally put 
something like this in your top level group script:

on newBackground
   put the childcontrolNames of me into tGroupList
   
   repeat for each line tGroup in tGroupList
  put the childControlNames of group tGroup into tControlList
  filter tControlList with "btn*"
  
  repeat for each line tButtonName in tControlList
 put char 4 to -1 of tButtonName into tControlName
 put "img" & tControlName into tEnabledImage
 put "img" & tControlName into tDisabledImage
 if there is an image tEnabledImage then \
   set the icon of button tButtonName to the short id of image 
tEnabledImage
 if there is an image tDisabledImage then \
   set the disabledIcon of button tButtonName to the short id of 
image tDisabledImage
  end repeat
   end repeat
   pass newBackground
end newBackground


> On Apr 20, 2019, at 09:36 , Klaus major-k via use-livecode 
>  wrote:
> 
> Hi friends,
> 
> I have a vague memory that we can use images as icons in buttons WITHOUT 
> putting them in an image object first. Am I right or was I dreaming? :-)
> 
> Thanks for any hints.
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> http://www.major-k.de
> 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


___
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: button ICON

2019-04-21 Thread Tom Glod via use-livecode
Klaus, I vaguely remember someone recently pointing out a weird trick with
button icons ..

but i think it had to do with svgs being used as button icons.

but maybe it really was a dream.

why do u need to use images without loading them into the stack?





On Sun, Apr 21, 2019 at 4:08 PM Klaus major-k via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Hi Jaques,
>
> > Am 21.04.2019 um 21:44 schrieb J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > I had a dream like that once too, but I don't know of any way you can do
> that in real life.
>
> hehe, got it, thank you! :-)
> >
> > On 4/20/19 11:36 AM, Klaus major-k via use-livecode wrote:
> >> Hi friends,
> >> I have a vague memory that we can use images as icons in buttons WITHOUT
> >> putting them in an image object first. Am I right or was I dreaming? :-)
> >> Thanks for any hints.
>
> Best
>
> Klaus
>
> --
> Klaus Major
> http://www.major-k.de
> 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
>
___
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: button ICON

2019-04-21 Thread Klaus major-k via use-livecode
Hi Jaques,

> Am 21.04.2019 um 21:44 schrieb J. Landman Gay via use-livecode 
> :
> 
> I had a dream like that once too, but I don't know of any way you can do that 
> in real life.

hehe, got it, thank you! :-)
> 
> On 4/20/19 11:36 AM, Klaus major-k via use-livecode wrote:
>> Hi friends,
>> I have a vague memory that we can use images as icons in buttons WITHOUT
>> putting them in an image object first. Am I right or was I dreaming? :-)
>> Thanks for any hints.

Best

Klaus

--
Klaus Major
http://www.major-k.de
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: button ICON

2019-04-21 Thread J. Landman Gay via use-livecode
I had a dream like that once too, but I don't know of any way you can do 
that in real life.


On 4/20/19 11:36 AM, Klaus major-k via use-livecode wrote:

Hi friends,

I have a vague memory that we can use images as icons in buttons WITHOUT
putting them in an image object first. Am I right or was I dreaming? :-)

Thanks for any hints.


Best

Klaus
--
Klaus Major
http://www.major-k.de
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


button ICON

2019-04-20 Thread Klaus major-k via use-livecode
Hi friends,

I have a vague memory that we can use images as icons in buttons WITHOUT 
putting them in an image object first. Am I right or was I dreaming? :-)

Thanks for any hints.


Best

Klaus
--
Klaus Major
http://www.major-k.de
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: Button Icon IDs

2014-10-24 Thread J. Landman Gay
It's a very cool answer too, somehow I missed that in the docs. So we both 
learned something.  

On October 24, 2014 4:56:14 PM CDT, Peter Haworth  wrote:
>Hi Jacque,
>Unfortunately, all I have is the button's icon ID so I don;t know where
>the
>the image is.  But it sounds like Monte has the answer.

-- 
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: Button Icon IDs

2014-10-24 Thread Peter Haworth
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 
Home of lcStackBrowser  and
SQLiteAdmin 

On Fri, Oct 24, 2014 at 1:12 PM, Monte Goulding  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  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 
> > Home of lcStackBrowser  and
> > SQLiteAdmin 
> > ___
> > 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


Re: Button Icon IDs

2014-10-24 Thread Peter Haworth
Hi Jacque,
Unfortunately, all I have is the button's icon ID so I don;t know where the
the image is.  But it sounds like Monte has the answer.

Pete
lcSQL Software 
Home of lcStackBrowser  and
SQLiteAdmin 

On Fri, Oct 24, 2014 at 1:32 PM, J. Landman Gay 
wrote:

> On 10/24/2014, 12:22 PM, Peter Haworth 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?
>>
>
> If it's in the same stack, you should be able to:
>
>   get the long name of control id x
>
> But if it's in another stack then you need to reference the stack it's in:
>
>   get the long name of control id x of stack y
>
> --
> 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
>
___
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: Button Icon IDs

2014-10-24 Thread Peter Haworth
Excellent, thanks Monte.

Pete
lcSQL Software 
Home of lcStackBrowser  and
SQLiteAdmin 

On Fri, Oct 24, 2014 at 1:12 PM, Monte Goulding  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  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 
> > Home of lcStackBrowser  and
> > SQLiteAdmin 
> > ___
> > 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


Re: Button Icon IDs

2014-10-24 Thread Monte Goulding
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  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 
> Home of lcStackBrowser  and
> SQLiteAdmin 
> ___
> 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


Re: Button Icon IDs

2014-10-24 Thread J. Landman Gay

On 10/24/2014, 12:22 PM, Peter Haworth 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?


If it's in the same stack, you should be able to:

  get the long name of control id x

But if it's in another stack then you need to reference the stack it's in:

  get the long name of control id x of stack y

--
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


Button Icon IDs

2014-10-24 Thread Peter Haworth
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 
Home of lcStackBrowser  and
SQLiteAdmin 
___
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: Trouble with button icon images

2011-12-27 Thread J. Landman Gay

On 12/27/11 5:03 PM, Pete wrote:

Hi Jacque,
I tried this out.  The standalone has a substack named "revCopiedIcons".  I
added code to list the controls in that stack and it contained the standard
icons for the answer command (information, error, warning, etc) plus the
one icon I referenced in the Image library.  So it appears the standalone
builder is smart enough to include only the referenced icons.
Pete


That's great to know, thanks for trying it and reporting back. The SB is 
smarter than I thought.


--
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: Trouble with button icon images

2011-12-27 Thread Pete
Hi Jacque,
I tried this out.  The standalone has a substack named "revCopiedIcons".  I
added code to list the controls in that stack and it contained the standard
icons for the answer command (information, error, warning, etc) plus the
one icon I referenced in the Image library.  So it appears the standalone
builder is smart enough to include only the referenced icons.
Pete

On Mon, Dec 26, 2011 at 1:00 PM, J. Landman Gay wrote:

> On 12/26/11 11:35 AM, Pete wrote:
>
>> HI Jacque,
>> Just one more follow up to this.  When the standalone is built, does it
>> include all the images in the library or just the ones that are referenced
>> in the application?  The library I created has around 700 icons in it and
>> I
>> only use perhaps a dozen or so in any one application.
>>
>
> I'm not sure how that would work, I always place the images so that the
> library isn't used at all. I suppose the easiest thing would be for the
> standalone builder to just include the whole library as a substack of your
> mainstack. Copying them individually would change the IDs of the images.
>
> You could find out by building a small standalone with a button that uses
> a referenced icon, and whose script answers the names of the substacks. I'm
> a little curious myself what you'll find.
>
>
> --
> 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
>
>


-- 
Pete
Molly's Revenge 
___
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: Trouble with button icon images

2011-12-26 Thread J. Landman Gay

On 12/26/11 11:35 AM, Pete wrote:

HI Jacque,
Just one more follow up to this.  When the standalone is built, does it
include all the images in the library or just the ones that are referenced
in the application?  The library I created has around 700 icons in it and I
only use perhaps a dozen or so in any one application.


I'm not sure how that would work, I always place the images so that the 
library isn't used at all. I suppose the easiest thing would be for the 
standalone builder to just include the whole library as a substack of 
your mainstack. Copying them individually would change the IDs of the 
images.


You could find out by building a small standalone with a button that 
uses a referenced icon, and whose script answers the names of the 
substacks. I'm a little curious myself what you'll find.


--
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: Trouble with button icon images

2011-12-26 Thread Pete
HI Jacque,
Just one more follow up to this.  When the standalone is built, does it
include all the images in the library or just the ones that are referenced
in the application?  The library I created has around 700 icons in it and I
only use perhaps a dozen or so in any one application.
Thank,

On Sat, Dec 24, 2011 at 10:02 AM, J. Landman Gay
wrote:

> On 12/24/11 11:56 AM, Pete wrote:
>
>> Thanks Jacque.  When I use the library, I use the Place Reference button
>> to
>> put a button on whatever card I'm working on, preconfigured to refer to
>> the
>> image as its icon.  Are you saying that those images won't show up when I
>> build a standalone?
>>
>
> No, they'll show up fine if they are placed. If you use them as icons, be
> sure to use the placed image's ID. It's just a convenient way to keep
> images somewhere besides on disk, but the behavior after placement is
> identical.
>
>
> --
> 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
>
>


-- 
Pete
Molly's Revenge 
___
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: Trouble with button icon images

2011-12-24 Thread Pete
Great, thanks.

On Sat, Dec 24, 2011 at 10:02 AM, J. Landman Gay
wrote:

> On 12/24/11 11:56 AM, Pete wrote:
>
>> Thanks Jacque.  When I use the library, I use the Place Reference button
>> to
>> put a button on whatever card I'm working on, preconfigured to refer to
>> the
>> image as its icon.  Are you saying that those images won't show up when I
>> build a standalone?
>>
>
> No, they'll show up fine if they are placed. If you use them as icons, be
> sure to use the placed image's ID. It's just a convenient way to keep
> images somewhere besides on disk, but the behavior after placement is
> identical.
>
>
> --
> 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
>
>


-- 
Pete
Molly's Revenge 
___
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: Trouble with button icon images

2011-12-24 Thread J. Landman Gay

On 12/24/11 11:56 AM, Pete wrote:

Thanks Jacque.  When I use the library, I use the Place Reference button to
put a button on whatever card I'm working on, preconfigured to refer to the
image as its icon.  Are you saying that those images won't show up when I
build a standalone?


No, they'll show up fine if they are placed. If you use them as icons, 
be sure to use the placed image's ID. It's just a convenient way to keep 
images somewhere besides on disk, but the behavior after placement is 
identical.


--
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: Trouble with button icon images

2011-12-24 Thread Pete
Thanks Jacque.  When I use the library, I use the Place Reference button to
put a button on whatever card I'm working on, preconfigured to refer to the
image as its icon.  Are you saying that those images won't show up when I
build a standalone?
Thanks,
Pete

On Sat, Dec 24, 2011 at 9:22 AM, J. Landman Gay wrote:

> On 12/24/11 10:45 AM, Pete wrote:
>
>> Hi Mark,
>> Changing the ID fixes the problem, thanks.  What might be the cause of
>> this?
>>
>
> ID conflicts. Each stack can have its own ID numbering, so another control
> somewhere may have had the same ID. If the image with the conflicting ID is
> large or has transparent areas, it may have looked like the icon was empty.
>
> Besides using a substack, you can also place all your icon images in a
> group on the mainstack and then unplace the group from all cards. They'll
> be accessible from anywhere, you won't need an extra stack, and no card
> will display them. ID conflicts can still occur, so each image will need a
> unique ID.
>
>
>
>> On a related topic, I'm wondering what are the advantages/disadvantages of
>> using the Image Library versus putting the application's images in a
>> substack.  I used to import my images into the Image Library and refer to
>> them directly in there but changed to using a substack because I got the
>> impression from some list posts that it might not be a good idea to use
>> the
>> Image Library (can't remember why).
>>
>
> The image library is a convenient storage area for commonly used content,
> but it won't automatically move your images to your stack. That means if
> you distribute the stack or a standalone, the images will be missing. Use
> the library's "place" button to move the images into your working stack
> where they can be found.
>
> It's no different than importing images from disk, but for things you use
> often the library is more convenient. I have a couple of image libaries I
> use all the time.
>
> --
> 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
>
>


-- 
Pete
Molly's Revenge 
___
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: Trouble with button icon images

2011-12-24 Thread J. Landman Gay

On 12/24/11 10:45 AM, Pete wrote:

Hi Mark,
Changing the ID fixes the problem, thanks.  What might be the cause of this?


ID conflicts. Each stack can have its own ID numbering, so another 
control somewhere may have had the same ID. If the image with the 
conflicting ID is large or has transparent areas, it may have looked 
like the icon was empty.


Besides using a substack, you can also place all your icon images in a 
group on the mainstack and then unplace the group from all cards. 
They'll be accessible from anywhere, you won't need an extra stack, and 
no card will display them. ID conflicts can still occur, so each image 
will need a unique ID.




On a related topic, I'm wondering what are the advantages/disadvantages of
using the Image Library versus putting the application's images in a
substack.  I used to import my images into the Image Library and refer to
them directly in there but changed to using a substack because I got the
impression from some list posts that it might not be a good idea to use the
Image Library (can't remember why).


The image library is a convenient storage area for commonly used 
content, but it won't automatically move your images to your stack. That 
means if you distribute the stack or a standalone, the images will be 
missing. Use the library's "place" button to move the images into your 
working stack where they can be found.


It's no different than importing images from disk, but for things you 
use often the library is more convenient. I have a couple of image 
libaries I use all the time.


--
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: Trouble with button icon images

2011-12-24 Thread Pete
Hi Mark,
Changing the ID fixes the problem, thanks.  What might be the cause of this?

On a related topic, I'm wondering what are the advantages/disadvantages of
using the Image Library versus putting the application's images in a
substack.  I used to import my images into the Image Library and refer to
them directly in there but changed to using a substack because I got the
impression from some list posts that it might not be a good idea to use the
Image Library (can't remember why).

Thanks

On Sat, Dec 24, 2011 at 6:12 AM, Mark Schonewille <
m.schonewi...@economy-x-talk.com> wrote:

> Hi Pete,
>
> What happens if you change the id of the image?
>
> --
> Kind regards,
>
> Mark Schonewille
> Economy-x-Talk
> Http://economy-x-talk.com
>
> Share the clipboard of your computer over a local network with Clipboard
> Link http://clipboardlink.economy-x-talk.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: Trouble with button icon images

2011-12-24 Thread Mark Schonewille
Hi Pete,

What happens if you change the id of the image?

--
Kind regards,

Mark Schonewille
Economy-x-Talk
Http://economy-x-talk.com

Share the clipboard of your computer over a local network with Clipboard Link 
http://clipboardlink.economy-x-talk.com


Op 23 dec. 2011 om 20:30 heeft Pete  het volgende 
geschreven:

> I have a card in a substack of my mainstack that contains images for
> buttons I use in other substacks.  All seems to work fine so far but I have
> a problem with one button whose image does not show up.  The same image is
> used as the  icon for buttons on other cards and shows up just fine.  If I
> copy a button that uses the image from another card to this card, the image
> disappears from the button.  Other buttons on the same card that refer to
> different images work just fine.
> 
> Any ideas?
> 
> -- 
> Pete
> Molly's Revenge 

___
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: Trouble with button icon images

2011-12-23 Thread Bob Sneidar
The only way I have gotten this to work reliably is to make sure that the 
images needed for buttons in a particular stack are IN that stack, not the 
mainstack, not a substack, but the stack that actually needs them. 

I suppose you could put them all in the mainStack, so long as the mainStack was 
not closed when the substack was running. Just hide the mainStack, don't close 
it. 

Bob


On Dec 23, 2011, at 11:30 AM, Pete wrote:

> I have a card in a substack of my mainstack that contains images for
> buttons I use in other substacks.  All seems to work fine so far but I have
> a problem with one button whose image does not show up.  The same image is
> used as the  icon for buttons on other cards and shows up just fine.  If I
> copy a button that uses the image from another card to this card, the image
> disappears from the button.  Other buttons on the same card that refer to
> different images work just fine.
> 
> Any ideas?
> 
> -- 
> Pete
> Molly's Revenge 
> ___
> 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


Trouble with button icon images

2011-12-23 Thread Pete
I have a card in a substack of my mainstack that contains images for
buttons I use in other substacks.  All seems to work fine so far but I have
a problem with one button whose image does not show up.  The same image is
used as the  icon for buttons on other cards and shows up just fine.  If I
copy a button that uses the image from another card to this card, the image
disappears from the button.  Other buttons on the same card that refer to
different images work just fine.

Any ideas?

-- 
Pete
Molly's Revenge 
___
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Keith Clarke
I tried 'import' first purely because I wanted to bring the snapshot of the 
unopened card into the 'home' card rather than export to file, etc.

There are some notes in the dictionary about setting the absolute rectangle 
coordinates depending on the target object - it didn't work until I defined the 
0.0.1024,768 parameters. I can't claim to have understood - I just fiddled 
around with all the options - process of elimination.

The good news is that my hack seems to have survived the test deployment out to 
a revlet. An online product demonstration presentation with (so far one) live 
thumbnail updates on the home page - not too shabby!

I'm getting to like this LiveCode thing and almost enjoying coding - it's all 
rather worrying! ;-)
Best,
Keith..

On 1 Apr 2011, at 19:42, J. Landman Gay wrote:

> 
> I see Keith is using it too, so I guess it does work. I couldn't get it to do 
> that. I'm not sure what was different about my stack, but trying to get a 
> snapshot of the non-current card did nothing.
> 
> I see Keith is using "import snapshot" and specifying a card. That isn't in 
> the docs and I always got an error when I tried to specify an object with 
> "import", I could only specify one with "export".


___
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread J. Landman Gay

On 4/1/11 1:42 PM, J. Landman Gay wrote:

On 4/1/11 1:05 PM, Richard Gaskin wrote:

Jacque wrote:

While you can take snapshots of objects that aren't open, you can't take
them of cards that aren't open. Cards are not objects. I was unable to
get a snapshot of another card unless I went there first.


I didn't know I couldn't do that so I tried it a long time ago and it
seemed to work so I've been using it since. :)


I see Keith is using it too, so I guess it does work. I couldn't get it
to do that. I'm not sure what was different about my stack, but trying
to get a snapshot of the non-current card did nothing.

I see Keith is using "import snapshot" and specifying a card. That isn't
in the docs and I always got an error when I tried to specify an object
with "import", I could only specify one with "export".



Okay, I made a new stack and getting a snapshot of a remote card works, 
even with "import". I tend to use the same test stack repeatedly for all 
kinds of junk until it gets too messy, and then I start a new one. Next 
time I'll make a new one right off.


Bob, don't keep what I wrote. Some of it is wrong.

--
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Richard Gaskin

Jacque -

I see Keith is using "import snapshot" and specifying a card. That isn't
in the docs and I always got an error when I tried to specify an object
with "import", I could only specify one with "export".


Ah, that may be it. I almost never use "import", using "export" instead.

If one supports a feature the other doesn't, is it a bug?

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

___
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread J. Landman Gay

On 4/1/11 1:05 PM, Richard Gaskin wrote:

Jacque wrote:

While you can take snapshots of objects that aren't open, you can't take
them of cards that aren't open. Cards are not objects. I was unable to
get a snapshot of another card unless I went there first.


I didn't know I couldn't do that so I tried it a long time ago and it
seemed to work so I've been using it since. :)


I see Keith is using it too, so I guess it does work. I couldn't get it 
to do that. I'm not sure what was different about my stack, but trying 
to get a snapshot of the non-current card did nothing.


I see Keith is using "import snapshot" and specifying a card. That isn't 
in the docs and I always got an error when I tried to specify an object 
with "import", I could only specify one with "export".


--
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Bob Sneidar
I wonder if this is because export snapshot puts the stack in memory, along 
with the first card in the stack? Try it with the second card. 

Bob


On Apr 1, 2011, at 11:05 AM, Richard Gaskin wrote:

> Jacque wrote:
>> While you can take snapshots of objects that aren't open, you can't take
>> them of cards that aren't open. Cards are not objects. I was unable to
>> get a snapshot of another card unless I went there first.
> 
> I didn't know I couldn't do that so I tried it a long time ago and it seemed 
> to work so I've been using it since. :)
> 
> In fact, after reading your post I wondered if it was dependent on having 
> rendered the card during the current session, so I wrote this to test it on a 
> stack I haven't opened in weeks:
> 
> on mouseUp
>  answer file "Select a stack file:"
>  if it is empty then exit to top
>  put it into tStackfile
>  export snapshot from cd 1 of stack tStackFile to \
>file (specialfolderPath("desktop")&"/myimage.png") as png
> end mouseUp
> 
> Worked a treat.
> 
> --
> Richard Gaskin
> Fourth World
> LiveCode training and consulting: http://www.fourthworld.com
> Webzine for LiveCode developers: http://www.LiveCodeJournal.com
> LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
> 
> ___
> 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


Re: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Richard Gaskin

Jacque wrote:

While you can take snapshots of objects that aren't open, you can't take
them of cards that aren't open. Cards are not objects. I was unable to
get a snapshot of another card unless I went there first.


I didn't know I couldn't do that so I tried it a long time ago and it 
seemed to work so I've been using it since. :)


In fact, after reading your post I wondered if it was dependent on 
having rendered the card during the current session, so I wrote this to 
test it on a stack I haven't opened in weeks:


on mouseUp
  answer file "Select a stack file:"
  if it is empty then exit to top
  put it into tStackfile
  export snapshot from cd 1 of stack tStackFile to \
file (specialfolderPath("desktop")&"/myimage.png") as png
end mouseUp

Worked a treat.

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

___
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Bob Sneidar
Welcome to the New World sir!

Bob


On Apr 1, 2011, at 10:30 AM, Keith Clarke wrote:

> In my case, PowerPoint was my 'IDE for non-functioning wish-list-ware' for a 
> couple of decades . 
> Best,
> Keith..


___
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Keith Clarke
Hi Jaque,
Thanks for responding. This is what I ended up with for updating a single 
button. I'm quite pleased with the result, because, as there are 'moving parts' 
on the visited cards, when I return to the home screen it is updated with 
thumbnails reflecting the current 'just left' view of the visited cards, rather 
than the default from when the presentation was first opened. 

on openCard
   --Delete the old thumbnail and set button to 'Updating'
   delete image "Snapshot-Example"
   set the showName of button "btn Example" to true
   set the label of button "btn Example" to "Updating Image"
   
   --get the new card snapshot and make it identifiable
   import snapshot from rectangle 0,0,1024,768 of card "Example"
   set the name of the last image to "Snapshot-Example"
   
   --scales the snapshot to thumbnail size
   set the height of the last image to 150
   set the width of the last image to 200
   
   --Make it the button's icon image and hide the updating message
   set the icon of button "btn Example" to the ID of the last image
   set the showName of button "btn Example" to false
   set the label of button "btn Example" to "Example"
   
   --Hide the imported snapshot
   set the layer of the last image to 1
end openCard

Once I have wrapped it in a loop for all the navigation buttons on the 'home' 
screen, I will publish a how-to document. This will be one of a few switching 
guides I have in mind for LiveCode newbies like me who were PowerPoint 'power 
user'. In my case, PowerPoint was my 'IDE for non-functioning wish-list-ware' 
for a couple of decades . 
Best,
Keith..


___
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Bob Sneidar
That's worth saving in my Livecode Keepers! Someday I am going to make a stack 
of this stuff!

Bob


On Apr 1, 2011, at 10:09 AM, J. Landman Gay wrote:

> On 4/1/11 11:14 AM, J. Landman Gay wrote:
>> 
>> Since you are taking snapshots of other cards and the "preopen" is for
>> the control, I'm not sure you need to wait for the control to load. I
>> think the issue is the ID of the icon.
>> 
> 
> I just tried the handler you posted and there's more wrong than just the icon 
> ID.
> 
> on preOpenControl
>   import snapshot from the rect of card "Example"
>   set the icon of me to it
> end preOpenControl
> 
> It might be a typo, but the first line will error without the "rect" keyword: 
>  import snapshot from rect (the rect of cd "example"). Also, snapshots use 
> the 0,0 point of the monitor (not the stack) for coordinates when dealing 
> with cards, so the rect of a card will result in the snapshot containing the 
> top left portion of whatever's on the monitor at that position. You'll need 
> to translate the coordinates from global to local coords. You can either do 
> that using the globalloc function or you can just use the rect of the stack 
> instead of the rect of the card. The second method won't always work if you 
> have a menubar on a Mac (which makes the stack shorter than the card.)
> 
> After either an import or an export, the "it" variable is not given a value, 
> so it becomes the string literal "it". You can't set an icon to a string 
> literal, you need an ID number.
> 
> While you can take snapshots of objects that aren't open, you can't take them 
> of cards that aren't open. Cards are not objects. I was unable to get a 
> snapshot of another card unless I went there first. This did work:
> 
> on test
>  get the rect of this cd
>  put globalloc(item 1 to 2 of it) into tRect
>  put globalLoc(item 3 to 4 of it) into item 3 to 4 of tRect
>  go cd 2
>  import snapshot from rect tRect
>  go back
>  set the icon of me to the short id of last img of cd 2
> end test
> 
> The "export snapshot" offers more options. You can export a snapshot to a 
> variable and then put that variable into an image object. However, I was 
> still unable to get a snapshot without going to the card. This works:
> 
> on test2
>  lock screen
>  go cd 2
>  export snapshot from cd 2 to tVar as JPEG
>  go back
>  unlock screen
>  create img "iconImg"
>  set the text of img "iconImg" to tVar
>  set the icon of me to the short id of img "iconImg"
> end test2
> 
> -- 
> 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


___
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread J. Landman Gay

On 4/1/11 11:14 AM, J. Landman Gay wrote:


Since you are taking snapshots of other cards and the "preopen" is for
the control, I'm not sure you need to wait for the control to load. I
think the issue is the ID of the icon.



I just tried the handler you posted and there's more wrong than just the 
icon ID.


on preOpenControl
   import snapshot from the rect of card "Example"
   set the icon of me to it
end preOpenControl

It might be a typo, but the first line will error without the "rect" 
keyword:  import snapshot from rect (the rect of cd "example"). Also, 
snapshots use the 0,0 point of the monitor (not the stack) for 
coordinates when dealing with cards, so the rect of a card will result 
in the snapshot containing the top left portion of whatever's on the 
monitor at that position. You'll need to translate the coordinates from 
global to local coords. You can either do that using the globalloc 
function or you can just use the rect of the stack instead of the rect 
of the card. The second method won't always work if you have a menubar 
on a Mac (which makes the stack shorter than the card.)


After either an import or an export, the "it" variable is not given a 
value, so it becomes the string literal "it". You can't set an icon to a 
string literal, you need an ID number.


While you can take snapshots of objects that aren't open, you can't take 
them of cards that aren't open. Cards are not objects. I was unable to 
get a snapshot of another card unless I went there first. This did work:


on test
  get the rect of this cd
  put globalloc(item 1 to 2 of it) into tRect
  put globalLoc(item 3 to 4 of it) into item 3 to 4 of tRect
  go cd 2
  import snapshot from rect tRect
  go back
  set the icon of me to the short id of last img of cd 2
end test

The "export snapshot" offers more options. You can export a snapshot to 
a variable and then put that variable into an image object. However, I 
was still unable to get a snapshot without going to the card. This works:


on test2
  lock screen
  go cd 2
  export snapshot from cd 2 to tVar as JPEG
  go back
  unlock screen
  create img "iconImg"
  set the text of img "iconImg" to tVar
  set the icon of me to the short id of img "iconImg"
end test2

--
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread J. Landman Gay

On 4/1/11 6:31 AM, Keith Clarke wrote:

Thanks Mark - that's clear. I'll move my script onto the card, use
'openCard' as its base and provide something to distract the viewer
whilst the thumbnails update! Best, Keith..


It still won't work unless you use the ID of the snapshot image rather 
than what's inside the "it" variable.


Since you are taking snapshots of other cards and the "preopen" is for 
the control, I'm not sure you need to wait for the control to load. I 
think the issue is the ID of the icon.


--
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Keith Clarke
Thanks Mark - that's clear. I'll move my script onto the card, use 'openCard' 
as its base and provide something to distract the viewer whilst the thumbnails 
update!
Best,
Keith..

On 1 Apr 2011, at 11:49, Mark Schonewille wrote:

> Keith,
> 
> On preOpen... the control or card isn't open yet and you can't get a 
> screenshot of it yet. A stacks or card needs to load completely before you 
> can do such things. A very clear example is e.g. the impossibility to get the 
> dimensions of a player if the movie of that player is being loaded duing a 
> preOpenStack handler and the stack is invisible.
> 
> You might want to load a "please wait" picture first and load your custom 
> image on openCard.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553

___
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: Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Mark Schonewille
Keith,

On preOpen... the control or card isn't open yet and you can't get a screenshot 
of it yet. A stacks or card needs to load completely before you can do such 
things. A very clear example is e.g. the impossibility to get the dimensions of 
a player if the movie of that player is being loaded duing a preOpenStack 
handler and the stack is invisible.

You might want to load a "please wait" picture first and load your custom image 
on openCard.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 1 apr 2011, at 12:31, Keith Clarke wrote:

> Hi folks,
> I'm working on a presentation stack, which has a home card with a set of 
> buttons with thumbnail images (as the icon) that navigate to other cards in 
> the stack. The other cards are evolving, so I'm trying to create an 
> auto-update script to renew the navigation button thumbnail icon images when 
> the home page is re-opened. I'm guessing that the script should end-up in a 
> pre-open card script and iterate through a list of buttons, but I'm trying to 
> get one button to work first.
> 
> Can anyone advise on what am I doing incorrectly with this script?
> 
> on preOpenControl
>   import snapshot from the rect of card "Example"
>   set the icon of me to it
> end preOpenControl  
> 
> Best,
> Keith..



___
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


Creating an auto-updating button icon thumbnail image from card snapshot

2011-04-01 Thread Keith Clarke
Hi folks,
I'm working on a presentation stack, which has a home card with a set of 
buttons with thumbnail images (as the icon) that navigate to other cards in the 
stack. The other cards are evolving, so I'm trying to create an auto-update 
script to renew the navigation button thumbnail icon images when the home page 
is re-opened. I'm guessing that the script should end-up in a pre-open card 
script and iterate through a list of buttons, but I'm trying to get one button 
to work first.

Can anyone advise on what am I doing incorrectly with this script?

on preOpenControl
   import snapshot from the rect of card "Example"
   set the icon of me to it
end preOpenControl  

Best,
Keith..
___
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