Inside SWT

Monday, November 06, 2006

The smart bit

After lots of thought, discussion and hard work, I am pleased and proud to finally announce: the SWT smart bit. Somehow, this new and exciting feature got left out of the Eclipse 3.3 M3 "New and Not-worthy". Here it is:

public static int SMART = 0;

Why settle for a dumb version of that old text control when you can spice it up with the smart bit:

new Text (parent, SWT.BORDER | SWT.SMART);

Even better, it works everywhere. Given a choice between two components, wouldn't you always take the smart one?

Swteve

6 Comments:

  • The SWT class most definitely needs to define more constants! I propose to create a constant in SWT for every word found here: http://www.dictionary.com/

    Then you wouldn't even have to think, you'll always know that whatever you want, SWT has thought of it! :)

    By Blogger Villane, at 5:46 PM  

  • And when you're just too lazy to look up the correct style, drive that nail in with a sledge hammer!

    public static final int BOZO = -1;

    button = new Button(parent, SWT.BOZO);

    By Anonymous Anonymous, at 8:04 PM  

  • Mattew, we already have a constant for BOZO:

    SWT.BOZO == SWT.DEFAULT

    By Blogger Steve, at 8:56 AM  

  • But Neil, the smart bit works equally well there too!

    By Blogger Steve, at 12:09 PM  

  • Yeah, well, we already have a constant for SMART too:

    SWT.SMART == SWT.NONE

    The SMART bit may be portable between widget toolkits, but the BOZO bit is portable to all forms of communication. How handy is that??

    By Anonymous Anonymous, at 3:24 PM  

  • Handy!

    By Blogger Steve, at 9:11 AM  

Post a Comment

<< Home