specifying an iconType

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

herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

specifying an iconType

Post 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
Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: specifying an iconType

Post by Janschenkel »

Take a look at the doc entries for gRevAppIcon and gRevSmallAppIcon.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: specifying an iconType

Post 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
Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: specifying an iconType

Post 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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: specifying an iconType

Post 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
Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: specifying an iconType

Post 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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: specifying an iconType

Post 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
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: specifying an iconType

Post 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?
Attachments
dot test.zip
(6.18 KiB) Downloaded 334 times
Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: specifying an iconType

Post 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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: specifying an iconType

Post 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
Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: specifying an iconType

Post 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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

Re: specifying an iconType

Post 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
Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: specifying an iconType

Post 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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
nishok
Posts: 3
Joined: Mon Apr 02, 2012 5:24 pm

Re: specifying an iconType

Post 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
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: specifying an iconType

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