[vwnc] VW 7.6 - How do you do dynamic tool tips?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] VW 7.6 - How do you do dynamic tool tips?

Terry Raymond
Hi

I have a view that changes the tool tip based upon the
mouse position in the view. I could do this with the old
FlyByHelpTracker but I am having difficulty finding a clean
way to do it with the new HoverHelp.

Any recommendations?

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?

Dennis smith-4
I provided an object in place of the string.  The object points back to
my application
and can then tell what it should show.  I think I had to provide two methods
    asText
       returns the text I want (Text or String)

and (new this release)

    asTooltipGraphicFor: aView
        | txt |
        txt := self asText.
        txt isNull ifTrue: [^nil].
        ^txt asTooltipGraphicFor: aView
   

Terry Raymond wrote:

> Hi
>
> I have a view that changes the tool tip based upon the
> mouse position in the view. I could do this with the old
> FlyByHelpTracker but I am having difficulty finding a clean
> way to do it with the new HoverHelp.
>
> Any recommendations?
>
> Terry
>  
> ===========================================================
> Terry Raymond
> Crafted Smalltalk
> 80 Lazywood Ln.
> Tiverton, RI  02878
> (401) 624-4517      [hidden email]
> <http://www.craftedsmalltalk.com>
> ===========================================================
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>  

--
Dennis Smith                         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?

Andre Schnoor
In reply to this post by Terry Raymond
Hi Terry,

look for implementors of #helpText and #helpText: Most views support  
this and you can add this to your custom views too. You might need to  
notity the FlyByHelpTracker that it changed, though. IIRC, this can be  
done by sending it an exit and an entry message with your controller  
as the argument. See the protocol at FlyByHelpTracker.

Andre

Am 05.06.2008 um 17:23 schrieb Terry Raymond:

> Hi
>
> I have a view that changes the tool tip based upon the
> mouse position in the view. I could do this with the old
> FlyByHelpTracker but I am having difficulty finding a clean
> way to do it with the new HoverHelp.
>
> Any recommendations?
>
> Terry
>
> ===========================================================
> Terry Raymond
> Crafted Smalltalk
> 80 Lazywood Ln.
> Tiverton, RI  02878
> (401) 624-4517      [hidden email]
> <http://www.craftedsmalltalk.com>
> ===========================================================
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?

Travis Griggs-3
In reply to this post by Dennis smith-4

On Jun 5, 2008, at 9:25 AM, Dennis Smith wrote:

> I provided an object in place of the string.  The object points back  
> to
> my application
> and can then tell what it should show.  I think I had to provide two  
> methods
>    asText
>       returns the text I want (Text or String)
>
> and (new this release)
>
>    asTooltipGraphicFor: aView
>        | txt |
>        txt := self asText.
>        txt isNull ifTrue: [^nil].
>        ^txt asTooltipGraphicFor: aView


Blocks understand this and have the VisualPart cull:'ed into it.

For example:

myView tooltip: [:view | (view globalPointToLocal: (InputState default  
cursorPoint - view topComponent globalOrigin)) printString ]

A tooltip (untested <grin>) that should show the point that the mouse  
is at, in view relative coordinates.

--
Travis Griggs
Objologist
"Every institution finally perishes by an excess of its own first  
principle." - Lord Acton



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?

Terry Raymond
As I read the code, the tool tip graphic is created when the
widget is entered. That is not good enough. My tool tip
contents change depending upon where the mouse in within
the widget.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf
> Of Travis Griggs
> Sent: Thursday, June 05, 2008 1:16 PM
> To: vwnc-list NC
> Subject: Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?
>
>
> On Jun 5, 2008, at 9:25 AM, Dennis Smith wrote:
>
> > I provided an object in place of the string.  The object points back
> > to
> > my application
> > and can then tell what it should show.  I think I had to provide two
> > methods
> >    asText
> >       returns the text I want (Text or String)
> >
> > and (new this release)
> >
> >    asTooltipGraphicFor: aView
> >        | txt |
> >        txt := self asText.
> >        txt isNull ifTrue: [^nil].
> >        ^txt asTooltipGraphicFor: aView
>
>
> Blocks understand this and have the VisualPart cull:'ed into it.
>
> For example:
>
> myView tooltip: [:view | (view globalPointToLocal: (InputState default
> cursorPoint - view topComponent globalOrigin)) printString ]
>
> A tooltip (untested <grin>) that should show the point that the mouse
> is at, in view relative coordinates.
>
> --
> Travis Griggs
> Objologist
> "Every institution finally perishes by an excess of its own first
> principle." - Lord Acton
>
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?

Steven Kelly
In reply to this post by Terry Raymond
Travis wrote:

> On Jun 5, 2008, at 9:25 AM, Dennis Smith wrote:
>
> > I provided an object in place of the string.  The object points back
> > to my application and can then tell what it should show.  I think
> > had to provide two methods
> >    asText
> > and (new this release)
> >    asTooltipGraphicFor: aView
>
> Blocks understand this and have the VisualPart cull:'ed into it.

FYI: We were using some other kind of object that responded to #value,
and had to implement #asTooltipGraphicFor: there too. It was no problem,
but somehow it didn't feel quite right. I can understand asking a Text
or Image to be a tooltip graphic, but not really a block or similar. I'd
have expected the tooltip source object to be sent #value or #asText or
similar, and the result expected to be something textual or graphical
that can be turned into a tooltip graphic.

Steve

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?

Travis Griggs-3
In reply to this post by Terry Raymond
On Jun 5, 2008, at 10:40 AM, Terry Raymond wrote:

> As I read the code, the tool tip graphic is created when the
> widget is entered. That is not good enough. My tool tip
> contents change depending upon where the mouse in within
> the widget.


The block is invoked each time the tooltip opens. Which by default is  
when the mouse comes to rest after an enter after a certain period of  
time.

E.g.

v := View new.
v tooltip: [InputState default mousePoint printString].
win := ApplicationWindow new.
win component: v.
win open

Slide the mouse into the window and let it stop somewhere. When it  
opens, it will open with the current mouse point, not the mouse point  
that it "entered" at.

I'm supposing that with the old tooltip code, you did more than just  
dynamically alter the content, but also get it to refresh by basically  
getting it to cross it's "arm->open" state again as the mouse moved  
around. Is that correct?

--
Travis Griggs
Objologist
10 2 letter words: "If it is to be, it is up to me"


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?

Terry Raymond
Travis

Yes, in the controller mouseMovedEvent: method I closed and
reopened the fly-by-help window if the help text changed.

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf
> Of Travis Griggs
> Sent: Friday, June 06, 2008 1:31 PM
> To: vwnc-list NC
> Subject: Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?
>
> On Jun 5, 2008, at 10:40 AM, Terry Raymond wrote:
>
> > As I read the code, the tool tip graphic is created when the
> > widget is entered. That is not good enough. My tool tip
> > contents change depending upon where the mouse in within
> > the widget.
>
>
> The block is invoked each time the tooltip opens. Which by default is
> when the mouse comes to rest after an enter after a certain period of
> time.
>
> E.g.
>
> v := View new.
> v tooltip: [InputState default mousePoint printString].
> win := ApplicationWindow new.
> win component: v.
> win open
>
> Slide the mouse into the window and let it stop somewhere. When it
> opens, it will open with the current mouse point, not the mouse point
> that it "entered" at.
>
> I'm supposing that with the old tooltip code, you did more than just
> dynamically alter the content, but also get it to refresh by basically
> getting it to cross it's "arm->open" state again as the mouse moved
> around. Is that correct?
>
> --
> Travis Griggs
> Objologist
> 10 2 letter words: "If it is to be, it is up to me"
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?

Thomas Brodt
I struggled with the old ones and dynamic content, too, I also used
blocks for that. IIRC it also had the disadvantage that helptexts were
computed too early and also unnecessarily on enter, not just before the
open when it was *really* needed.

That is great news to hear. Another point to upgrade to 7.6 :)

Thomas

Terry Raymond schrieb:

> Travis
>
> Yes, in the controller mouseMovedEvent: method I closed and
> reopened the fly-by-help window if the help text changed.
>
> Terry
>  
> ===========================================================
> Terry Raymond
> Crafted Smalltalk
> 80 Lazywood Ln.
> Tiverton, RI  02878
> (401) 624-4517      [hidden email]
> <http://www.craftedsmalltalk.com>
> ===========================================================
>
>  
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]] On Behalf
>> Of Travis Griggs
>> Sent: Friday, June 06, 2008 1:31 PM
>> To: vwnc-list NC
>> Subject: Re: [vwnc] VW 7.6 - How do you do dynamic tool tips?
>>
>> On Jun 5, 2008, at 10:40 AM, Terry Raymond wrote:
>>
>>    
>>> As I read the code, the tool tip graphic is created when the
>>> widget is entered. That is not good enough. My tool tip
>>> contents change depending upon where the mouse in within
>>> the widget.
>>>      
>> The block is invoked each time the tooltip opens. Which by default is
>> when the mouse comes to rest after an enter after a certain period of
>> time.
>>
>> E.g.
>>
>> v := View new.
>> v tooltip: [InputState default mousePoint printString].
>> win := ApplicationWindow new.
>> win component: v.
>> win open
>>
>> Slide the mouse into the window and let it stop somewhere. When it
>> opens, it will open with the current mouse point, not the mouse point
>> that it "entered" at.
>>
>> I'm supposing that with the old tooltip code, you did more than just
>> dynamically alter the content, but also get it to refresh by basically
>> getting it to cross it's "arm->open" state again as the mouse moved
>> around. Is that correct?
>>
>> --
>> Travis Griggs
>> Objologist
>> 10 2 letter words: "If it is to be, it is up to me"
>>
>>
>> _______________________________________________
>> vwnc mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>>    
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
>  



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc