Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] SWT 101

>>>> Don't want that.  I just want the label to get replaced.  Perhaps
adding
>>>> GridLayouts will work.  In Swing, I don't have to do this.  Here's the
same
>>>> program in Swing, which works exactly how I expect it to.  It's also 20
>>>> lines shorter.

I guess you do something like, getting the old text and look if it's shorter
than the new text (it's probably not sufficient to count the number of
characters, since font widths could be proportional); and if it is, you
re-calculate the width of the label, and send a pack() to its container. The
other way around is probably less desirable, but it would be consistent to
do it too.

It is rather easy to add, but I'm personally not really behind the idea, so
I won't propose such thing as a patch. I prefer the way it is now. I
wouldn't appreciate finding too much of this kind of tricky logic in a
sourcebase my applications depend on. Such logic has potentially millions of
ways to fire back at you. If Swing implements a thing like that all over the
place(I would have to look at the non-disclosed source to know, so I won't),
you will probably find a good number of subtle bugs related to it.



Back to the top