Styling Tooltips

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
davec
Posts: 30
Joined: Tue Dec 12, 2006 9:08 pm
Location: Brecon, Wales, UK
Contact:

Styling Tooltips

Post by davec » Fri Sep 14, 2007 3:40 pm

Does anyone know if it's possible to style the tooltips in Rev? i.e determine the size, type and colour of the font and the tooltip background.

Thanks,
Dave.

Klaus
Posts: 13878
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Fri Sep 14, 2007 5:51 pm

Hi Dave,

no, sorry, the "internal" tooltips can only be used "as is".

But you could fake your own styled tooltip with fields, groups or even extra stacks (opened as palette).


Best

Klaus

davec
Posts: 30
Joined: Tue Dec 12, 2006 9:08 pm
Location: Brecon, Wales, UK
Contact:

Post by davec » Fri Sep 14, 2007 6:29 pm

Hi Klaus

Thanks for the tip :roll: (sorry, no pun intended!).

I'll think on how to implement your ideas. If I understand, you're suggesting to open a floating (palette?) stack at the current mouse position. The stack window has no decoration I guess. That's a nice idea.

Thanks,
Dave.

davec
Posts: 30
Joined: Tue Dec 12, 2006 9:08 pm
Location: Brecon, Wales, UK
Contact:

Post by davec » Fri Sep 14, 2007 7:02 pm

Thought I would chip in again and say that the idea of a stack works really well. Thanks!

I set the style of the stack to float above everything and got rid of the title bar. I guess the code will be something like this;

Code: Select all

on mouseEnter
    if tipsOn then
       set the location of stack "tip" to the mouseLoc
       set the visible of stack "tip" to true
    end if
end mouseEnter

on mouseLeave
    set the visible of stack "tip" to false
end mouseLeave
Maybe add a short delay befor the tip is shown.

Cheers,
Dave.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Sep 14, 2007 7:12 pm

Hi Davec,

You can find a plugin called Pointer Tooltip here: http://economy-x-talk.com/developers.html

This might inspire you to make something similar. Sorry, the scripts of this plugin are not freely accessible at the moment.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

davec
Posts: 30
Joined: Tue Dec 12, 2006 9:08 pm
Location: Brecon, Wales, UK
Contact:

Post by davec » Fri Sep 14, 2007 9:23 pm

Mark, thank you for the link. Unfortunalty, I could not get the plugin to operate under Rev 2.1 (I know! :oops: ) on Windows 2000. I would have liked to see it.

Once I get my mits on an updated Rev (they will buy me an upgrade at work or else!) I'll try using an alpha channel window to make a nice looking balloon tip.

Anyway, thanks again.

Dave.

Post Reply

Return to “Talking LiveCode”