Page 1 of 2

specifying an iconType

Posted: Tue Feb 22, 2011 4:11 am
by herbwords
I've done it but forgot how. I want my icon to be displayed in my ask and answer comments. How do I do this?

Thanks

herb

Re: specifying an iconType

Posted: Tue Feb 22, 2011 6:45 am
by Janschenkel
Take a look at the doc entries for gRevAppIcon and gRevSmallAppIcon.

HTH,

Jan Schenkel.

Re: specifying an iconType

Posted: Tue Feb 22, 2011 9:56 pm
by herbwords
Hi again,

I've tried both of these in the stack script and they don't work.

on startup
global gRevSmallAppIcon
put image id "1327" into gRevSmallAppIcon
end startup

on preOpenStack
global gRevSmallAppIcon
put image id "1327" into gRevSmallAppIcon
end preOpenStack

What's weird is the old icon keeps coming up and I can't find in any of the scripts of the stack a call that tells it to?
Any ideas?

Thanks

Re: specifying an iconType

Posted: Tue Feb 22, 2011 10:18 pm
by Janschenkel
Don't put the image itself into the global variable - just the ID of the image:

Code: Select all

on startup
   InitAppIcon
end startup

on preOpenStack
   InitAppIcon
end preOpenStack

command InitAppIcon
   global gRevSmallAppIcon
   put 1327 into gRevSmallAppIcon
end InitAppIcon
HTH,

Jan Schenkel.

Re: specifying an iconType

Posted: Wed Feb 23, 2011 8:29 pm
by herbwords
I put the whole script you gave me in the stack script. I did a build and the old icon appeared in the dialog boxes. I opened the stack again and deleted the old Icon and rebuilt. Now no icon appears in the dialog boxes! I don't get it? The id is correct and it all looks right.

Suggestions?

Thanks

Re: specifying an iconType

Posted: Thu Feb 24, 2011 1:35 pm
by Janschenkel
You could try giving the image an ID > 20000 and see if that helps.
Certain image IDs may be conflicting. Also note that the icon will only be used for 'plain' answer and ask dialogs.

Jan Schenkel.

Re: specifying an iconType

Posted: Sat Feb 26, 2011 11:08 pm
by herbwords
Hi again,

I changed it to 20001 and it was blank (showed no image) on the answer dialog boxes and ask dialog boxes. The image is 32x32 and like I said the original image use to display with no problem. Strange?

Any other ideas?

Thanks

Re: specifying an iconType

Posted: Sat Feb 26, 2011 11:26 pm
by herbwords
Hi,

I made this little stack (it's attached to this e-mail) and put and icon in, it asks what day it is when opened. Your script is in the stack script and it does the same thing no icon when it asks the question?

Re: specifying an iconType

Posted: Sun Feb 27, 2011 3:24 pm
by Janschenkel
Ah, I see you're using a regular ask command, without specifying an icon type. In that case, you should use the global gRevAppIcon instead of gRevSmallAppIcon. So update your stack script to something like this:

Code: Select all

on startup
   InitAppIcon
end startup

on preOpenStack
   InitAppIcon
end preOpenStack

command InitAppIcon
   global gRevAppIcon, gRevSmallAppIcon
   put 400001 into gRevAppIcon  -- the id of the 64x64 icon image
   put 400002 into gRevSmallAppIcon  -- the id of the 32x32 icon image
end InitAppIcon/code]

And then your large icon should appear:
[code]ask "What is today?"
  answer it && "is a lovely day."
According to the docs, the small icon should be used to 'badge' the regular specified icon (information/question/warning/error):

Code: Select all

answer information "This is some text"
However, this doesn't work in LiveCode 4.5.3, and some snooping revealed this code was actually taken out in version 4.0.0.
I have a filed a bug report and asked to reinstate the badging behavior.

HTH,

Jan Schenkel.

Re: specifying an iconType

Posted: Mon Feb 28, 2011 5:33 am
by herbwords
Thanks, but it sounds like I'm screwed, I have 4.0. Why in the world would they take it out? How could we ever make a professional looking program without it?

Patrick

Re: specifying an iconType

Posted: Mon Feb 28, 2011 7:10 am
by Janschenkel
Well, given that nobody noticed for over a year, it looks like no one was using the feature - or that their end-users didn't notice. And if you feel adventurous, you can fix it yourself in your version 4.0. MAKE SURE TO SAVE A BACKUP COPY BEFORE TINKERING WIH THE IDE.
  • Quit the IDE completely, and re-open it without loading any of your own stacks.
  • Open the message box,
  • Type the following

    Code: Select all

    edit the script of card 1 of stack "Answer dialog"
    And hit return to open the relevant script.
  • There you'll see a commented line of code:

    Code: Select all

    # OK-2009-10-08 : Removed for consistency with Windows / Linux
  • Uncomment the next six lines to the next

    Code: Select all

    end if
Repeat the recipe for the stack "Ask dialog", and quit the IDE - you should be prompted with questions to save changes to the "Answer dialog" and "Ask dialog" stacks - save them both, and from now on, it should work fine both in the IDE and in standalone applications. MAKE SURE TO SAVE A BACKUP COPY BEFORE TINKERING WIH THE IDE.

HTH,

Jan Schenkel.

Re: specifying an iconType

Posted: Tue Mar 01, 2011 4:49 am
by herbwords
Jan thanks for all your help. I have a question about this comment:

# OK-2009-10-08 : Removed for consistency with Windows / Linux

If I do this as you advise is there going to be an issue in my Windows build? And, why was this feature removed?

Thanks,

Patrick

Re: specifying an iconType

Posted: Tue Mar 01, 2011 2:33 pm
by Janschenkel
You're not going to run into any issues on Windows, as those statements can only be reached if the 'tMacOSX' variable is 'true'.
I got a reply from RunRev HQ about the bug report, and they've promised to revert it back to the pre 4.0.0 behaviour.
Perhaps someone misinterpreted a requirement that it should behave the same whether you're on MacOSX, Windows or Linux.
After all, it is a Mac-specific feature, though some hgave asked to also support it on other platforms because it looks good :)
Oh, before I forget - make sure to use a transparent image for gRevSmallAppIcon as your 'badge' icon will overlap the generic icon.

Cheers,

Jan Schenkel.

Re: specifying an iconType

Posted: Sat Feb 16, 2013 5:39 pm
by nishok
Hi there
Anyone know if this behaviour has actually been re-instated? I'm running LC 5.5.0 and I can't make it work. I've tried using both the standalone app settings and using code to set the gRevAppIcon and gRevSmallAppIcon globals directly in my on openStack. The images I'm using are jpgs sized as recommended (64x64 and 32x32). I do get a light grey square at the left hand side of the answer dialogues, and the globals do contain the values I expect. The grey square and the expected variable values are there whether I've used the standalone settings or set them myself. If I remove all attempts to create these app icons that grey square is not there. So something's happening even though its not what I want.

Is anyone out there making these things work?

Thanks, Nishok

Re: specifying an iconType

Posted: Sat Feb 16, 2013 5:49 pm
by Klaus
Hi nishok,

hm, I use this all the time in my standalones and never had any problems!?
I just set these globals and all is well.


Best

Klaus