[Gambas-user] Tooltip help using HTML.

Caveat Gambas at ...1950...
Sat Jan 25 17:32:56 CET 2014


Hi Sam

It looks like you didn't close your second td of each row properly... I 
guess try it first with valid html...

Dim sHTML AS String

      sHTML &= "<html>"
      sHTML &= "<table cellpadding=1>"
      sHTML &= "<tr><td align=right>Note on</td><td align=left>G#/Ab</td></tr>
      sHTML &= "<tr><td align=right>Row</td><td align=left>44</td>
</tr>
      sHTML &= "<tr><td align=right>Velocity</td><td align=left>96</td>
</tr>
      sHTML &= "</table>"
      sHTML &= "</html>"

      gvEvents.Tooltip = sHTML

I would also be in the habit of wrapping the alignment and padding 
params in double-quotes, but perhaps that's getting too picky...and as 
you say, it doesn't seem to make much difference...

   Dim sHTML As String

   sHTML &= "<html>"
   sHTML &= "<table cellpadding=\"1\">"
   sHTML &= "<tr><td align=\"right\">Note on</td><td 
align=\"left\">G#/Ab</td></tr>"
   sHTML &= "<tr><td align=\"right\">Row</td><td 
align=\"left\">44</td></tr>"
   sHTML &= "<tr><td align=\"right\">Velocity</td><td 
align=\"left\">96</td></tr>"
   sHTML &= "</table>"
   sHTML &= "</html>"
...

Another thing to watch for is that your data might cause some odd 
effects if you have non-html-safe characters.

Kind regards,
Caveat

On 25/01/14 04:49, Sam wrote:
> Hi all,
>
>     I'm having a problem with the tooltips.  It works fine with regular
> text but when I use HTML for a multi-line tooltip the results are not
> predictable.  Most of the time an extra blank line shows up at the
> bottom. Seems like it might be wrapping if the last line is shorter (yes
> shorter).
>
>     A code example looks like :
>
> Dim sHTML AS String
>
>       sHTML &= "<html>"
>       sHTML &= "<table cellpadding=1>"
>       sHTML &= "<tr><td align=right>Note on</td><td align=left>G#/Ab</tr>
>       sHTML &= "<tr><td align=right>Row</td><td align=left>44</tr>
>       sHTML &= "<tr><td align=right>Velocity</td><td align=left>96</tr>
>       sHTML &= "</table>"
>       sHTML &= "</html>"
>
>       gvEvents.Tooltip = sHTML
>
>
>     It does not seem to matter if the "<html>" tag is included or not or
> if the attribute values are enclosed
> in single or double quotes.  The table cells can have different colors
> or font sizes and works fine.  Just a
> strange extra line at the bottom (not always).  Any idea?  I've tried
> numerous simple HTML snippets
> that work fine and wonder if it is just the fact of the <table> inside.
>
>     I've been developing a MIDI app using the ALSA API which works well
> but I'm surprised there is
> not a wrapper already out there for Gambas, anyone already written one?
>
>     The opaque structures and macros for hiding the actual implementation
> are a good design for C but not so nice for Gambas. I gave up on the
> timing callback thinking the callback cannot occur properly since they
> are on different threads. I have a separate player and a GUI that
> communicate via pipes, works good.
>
>    Thanks for Gambas!  I come home from a day of Java abstract
> frameworks, inversion of control, more
> and more bloat and just write stuff that is fun and actually works.
>
> Sam
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>





More information about the User mailing list