[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Color of SWT.Border

Hi Tom,

thank you. Best regards, Lars

"Tom Schindl" <tom.schindl@xxxxxxxxxxxxxxx> wrote in message 
news:g2jlmh$gcm$1@xxxxxxxxxxxxxxxxxxxx
> Something like this (this head dump and the names of the classes might not 
> be correct but you should get the point)
> ---------8<---------
> final Text t = new Text(comp,SWT.NONE);
> t.addPaintListener( new PaintListener() {
>    public void paint(PaintEvent evt) {
>        Point s = t.getSize();
>        Color c = evt.gc.getForeground();
>
> evt.gc.setForegroundColor(t.getDisplay().getSystemColor(SWT.COLOR_RED));
>        evt.gc.drawRect(0,0,s.x,s.y);
>        evt.gc.setForeground(c);
>    }
> } );
> ---------8<---------
>
> Tom
>
> Lars Vogel schrieb:
>> Hi Tom,
>>
>> hm, not sure how to do this. Can you point me to an example or further 
>> information?
>>
>> Best regards, Lars
>>
>>
>> "Tom Schindl" <tom.schindl@xxxxxxxxxxxxxxx> wrote in message 
>> news:g2ji42$7ao$2@xxxxxxxxxxxxxxxxxxxx
>>> Remove the border (SWT.NONE) and add a paint listener to draw the border 
>>> your own.
>>>
>>> Tom
>>>
>>> Lars Vogel schrieb:
>>>> Hi,
>>>>
>>>> can I change the color of the border of  a text field during runtime?
>>>> firstName = new Text(parent, SWT.BORDER);
>>>>
>>>> Best regards, Lars
>>>>
>>>>
>>>
>>> -- 
>>> B e s t S o l u t i o n . at
>>> --------------------------------------------------------------------
>>> Tom Schindl                                          JFace-Committer
>>> -------------------------------------------------------------------- 
>>
>>
>
>
> -- 
> B e s t S o l u t i o n . at
> --------------------------------------------------------------------
> Tom Schindl                                          JFace-Committer
> --------------------------------------------------------------------