Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to refresh a Combo ?
How to refresh a Combo ? [message #467043] Mon, 23 January 2006 17:53 Go to next message
Dov Moryusef is currently offline Dov MoryusefFriend
Messages: 25
Registered: July 2009
Junior Member
Hi to all,

I've a dialog which contains a Combo and a simple Button "new".
When I click on the "new" button, an input dialog opens. When the user
enter a value and click OK, I would like to refresh the combo with this
new value.
I tried combo.update(), combo.layout() and combo.redraw(). Nothing works!

Have you got any ideas ?

Thanks a lot for your help.

Dov
Re: How to refresh a Combo ? [message #467060 is a reply to message #467043] Mon, 23 January 2006 19:51 Go to previous messageGo to next message
Gail Jakubowski is currently offline Gail JakubowskiFriend
Messages: 36
Registered: July 2009
Member
Something like:
MyDialog dlg = new MyDialog(myShell);
int rc = dlg.open();
String newname = "";
if (rc == Window.OK) {
newname = dlg.getText();
if (newname.trim().length() == 0)
// User selected OK with empty field. Ignore.
return;
myCombo.add(newname);
myCombo.computeSize(SWT.DEFAULT,SWT.DEFAULT,true);
myCombo.layout();
myComboContainer.layout();
}


"Dov MORYUSEF" <moryusef@hotmail.com> wrote in message
news:dr357b$vn8$1@utils.eclipse.org...
> Hi to all,
>
> I've a dialog which contains a Combo and a simple Button "new".
> When I click on the "new" button, an input dialog opens. When the user
> enter a value and click OK, I would like to refresh the combo with this
> new value.
> I tried combo.update(), combo.layout() and combo.redraw(). Nothing works!
>
> Have you got any ideas ?
>
> Thanks a lot for your help.
>
> Dov
Re: How to refresh a Combo ? [message #467072 is a reply to message #467060] Tue, 24 January 2006 08:23 Go to previous message
Dov Moryusef is currently offline Dov MoryusefFriend
Messages: 25
Registered: July 2009
Junior Member
Thanks a lot Gail, it works fine !

Best regards

Dov
Gail Jakubowski a écrit :
> Something like:
> MyDialog dlg = new MyDialog(myShell);
> int rc = dlg.open();
> String newname = "";
> if (rc == Window.OK) {
> newname = dlg.getText();
> if (newname.trim().length() == 0)
> // User selected OK with empty field. Ignore.
> return;
> myCombo.add(newname);
> myCombo.computeSize(SWT.DEFAULT,SWT.DEFAULT,true);
> myCombo.layout();
> myComboContainer.layout();
> }
>
>
> "Dov MORYUSEF" <moryusef@hotmail.com> wrote in message
> news:dr357b$vn8$1@utils.eclipse.org...
>
>>Hi to all,
>>
>>I've a dialog which contains a Combo and a simple Button "new".
>>When I click on the "new" button, an input dialog opens. When the user
>>enter a value and click OK, I would like to refresh the combo with this
>>new value.
>>I tried combo.update(), combo.layout() and combo.redraw(). Nothing works!
>>
>>Have you got any ideas ?
>>
>>Thanks a lot for your help.
>>
>>Dov
>
>
>
Previous Topic:SWT redraw all visible rows on an insert
Next Topic:Expandable and Colapseable Group
Goto Forum:
  


Current Time: Wed Apr 24 18:33:25 GMT 2024

Powered by FUDForum. Page generated in 0.02735 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top