On 17 Dec 2012, at 02:20, leowang wrote: > Dear All, > I want to implement the text fading effect, because sometimes the text string > is too long, so I need to cut the string, and make the last character fading, > just like iphone. > > But how to implement this feature in FLTK-1.3, thanks. > > My OS is Linux.
There's no default support for that behaviour in fltk (regardless of host OS) and in the past, where the equivalent functionality has been used, it has tended to be in the form of ellipsis (i.e. the string truncated with ...) rather than fading. You can fairly readily implement your own label drawing scheme though - see the sections "Label Type Functions" and "Adding Your Label Type" in the docs for notes on how to do that. As for how to draw "fading" text... Hmm, I'm not sure what way is best, never really tried... I guess as a first stab I'd try to draw the regular string into a buffer, then compose an alpha on top of that to produce the fade effect, then drop that onto the widget as the label... Or maybe the alpha can be applied as it is composed onto the widget... Anyway, something like that. I'm sure there is a better way though! _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

