Better tooltips

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Better tooltips

Post by bjb007 » Wed Jun 18, 2008 8:58 am

I've read everything I can find on using
a stack to provide info for the user.

So far I have a "window" which pops up
on "mouseEnter" and goes away again.

But I can't figure out how to put information
in it. I get the impression that a graphic is
the only way.

I've had a poke around in the RevOnline
stack "Mr Error" from scottK but no luck.
Can't even figure out where the error message
windows come from.

Would be handy to be able to load text on
demand and would also like a text input area
where the user can make notes which would
be saved for later reference.

Any clues appreciated.
Life is just a bowl of cherries.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Wed Jun 18, 2008 12:45 pm

You can either set the 'text' (or 'htmlText' if you want styled text) property of the field in your tooltip stack by using its 'long' name:

Code: Select all

set the text of field "TooltipText" of stack "TooltipStack" to theText
or you can change the 'defaultStack' before modifying it and reset that after you're done.

Code: Select all

put the defaultStack into theOldDefaultStack
set the defaultStack to "TooltipStack"
set the text of field "TooltipText" to theText
set the defaultStack to theOldDefaultStack
Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Better tooltips

Post by bjb007 » Wed Jun 18, 2008 3:56 pm

Thanks Jan. I'm just about there.

The "Help" stack for some reason doesn't
seem to have the same behaviors as my
others. For example the "set backgroundColor"
doesn't do anything in the "ToolTipText" field
or in another field on the card. Setting these
in the Property Inspector also doesn't work.
But setting it in the Property Inspector for
the text entry field is O.K. I can set the
background color of the stack in the Property
Inspector but want to have a different color
background for the help text.

Can you suggest a neat way to store the text
to be put into the "ToolTipText" field so that
it can be edited outside the programme?

In a variable or array? Or as a text file?
Then I'll be able to edit them all in the same
place.
Life is just a bowl of cherries.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Jun 19, 2008 1:00 pm

You can either store everything in a separate stack, as custom properties or fields,... Or you can go the text file route, even consider an XML structure.
If it should be editable by someone who may not own Revolution, text files are the ovious choice.

As for colors, you'll have to look at the inheritance mechanism that Revolution uses; basically, if you set the backgroundColor of a stack, this is inherited by all objects; but some objects may ignore it, depending on other settings, in favour of the 'native' appearance of the control.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Post Reply