How to tell when a label looses focus?


#1

I’m creating an editable label on a temporary basis, and would like to delete the label if the user hits return, or clicks outside the label, causing it to loose focus.

When the user hits return, my LabelListener gets notified that the text has changed, and I can do deletion there.

If the editable label looses focus, textEditorFocusLost() is called, but that doesn’t trigger a change notification.

Is there a clever way to do this, or am I best off subclassing Label to get that functionality?


#2

well if it’s just for a temporary basis, then yeah i’d go for text editor; the label after all does just that (create a text editor when it’s needed) so just do it that way. i’m presuming you don’t need any of the other functionality provided by the label?


#3

Agghh - why is it that nobody on the web seems capable of spelling “loses” correctly??? I’ve a horrible feeling that you see it spelt wrong so often that even native english speakers are picking up the misspelling… sigh…


#4

Isn’t it losses for what you are reffering? (although for this, isn’t ‘lost’ what should be used?) “Loses” is not a word according to any source I checked inside of 30 seconds. (google:define, webster, etc…)


#5

overmind, you didn’t check very hard! it is indeed loses. i’ve decided to mostly stop picking people up on their spelling and grammar on forums nowadays, as it often ends up in a fight! :slight_smile:


#6

I very rarely pick people up on spelling too, but the “looses” thing has been bugging me lately!


#7

I always spell check everything I send to Jules. He ripped me a new one once for some word I kept misspelling. I haven’t made that mistake since. :slight_smile:
Ben


#8

Hmm, wonder why my dictionary cannot find loses, but refers to lost instead…


#9

[quote=“beno”]I always spell check everything I send to Jules. He ripped me a new one once for some word I kept misspelling. I haven’t made that mistake since. :slight_smile:
Ben[/quote]

:lol:


#10

[quote=“beno”]I always spell check everything I send to Jules. He ripped me a new one once for some word I kept misspelling. I haven’t made that mistake since. :slight_smile:
Ben[/quote]

of course, the problem is that “looses” is in fact a word so spell checking isn’t going to catch it.


#11