Thursday 2 June 2016

Tooltips

  Hi again,

Welcome to the era of tooltips, this post is in regard to the discussion on the developer mailing list.

As per my understanding of the advice given by mentors I produced the following result.

Case 1: When no string is passed:

                                   

                               

During the Creation of uicontrol object tooltipstring is initialized to default "";

                                 

No tooltip is displayed.

Case 2:  Special character is passed, instead of passing all the data I have used a special character "~"

so if "~" is passed like var.tooltipstring="~" then the tooltip will display the value in that cell as the tooltip.


TooltipString is set to the special charater;

David suggested to pass the complete matrix of data that is passed for the table, but it may lead to some futile computation and as java provides direct method of setting the tooltip to the value of cell I just used this to my advantage and avoided the computation. I can change the speacial character to any other character.Please suggest if it suits the need.











The Value of Cell is displayed in the tooltip.

Case 3:  When a matrix is passed

Since the function TooltipText excepts only Strings so anything passed to the TooltipString is considered as string and hence I use deliminator to separate each value,

ut.tooltipstring="[a,b,c,d]"
or
ut.tooltipstring="[a,,c,d]"

in the second case, the value of cell will only be displayed as a tooltip for that particular cell.


David suggested

ut.tooltipstring=["a" "b" "c" "d"]

So I have added the functionality where one can also input data in this fashion.

                              

I hope this post might make the discussion easier.

RJ


No comments:

Post a Comment