Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » GUI update
GUI update [message #461790] Fri, 30 September 2005 08:34 Go to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
Hi

I have a thread that is updating my GUI. While this update is going on, I
would like to stop redrawing until the SashForm's weights have been set, to
avoid screen flickering. However, if I click the mouse somewhere on the
screen while screen redraw is turned off, then my application will loose
focus to whatever program is showing behind it. How can I avoid this?

Code:

Display.getCurrent().asyncExec(new Runnable() {
public void run() {
SashForm sashA =
(SashForm)PriceElementEditor.getForm().getParent();
SashForm sashB =
(SashForm)PriceElementWindow.getPriceEntityGrid().getParent( );
int[] weightsA = sashA.getWeights();
int[] weightsB = sashB.getWeights();

//disable screen updating
sashA.getShell().setRedraw(false);

PriceElement pe = (PriceElement)element;

PriceElementEditor.getForm().dispose();
try {
PriceElementEditor.setForm(new
PriceElementForm(sashA, SWT.NONE, pe));
sashA.setWeights(weightsA);
} catch (SQLException e) {
e.printStackTrace();
}

PriceElementWindow.getPriceEntityGrid().dispose();
PriceElementWindow.setPriceEntityGrid(new
PriceEntityGrid(sashB, SWT.VERTICAL, pe));
sashB.setWeights(weightsB);

//enable screen updating again
sashA.getShell().setRedraw(true);
}
});
Re: GUI update [message #461793 is a reply to message #461790] Fri, 30 September 2005 09:07 Go to previous messageGo to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
"Henrik Skovgaard" <hsk_rem0vethis_@reklamedata.dk> wrote in message
news:dhitan$gs3$1@news.eclipse.org...
> How can I avoid this?

Got it figured out (doh!) :-)
Re: GUI update [message #461795 is a reply to message #461793] Fri, 30 September 2005 09:25 Go to previous messageGo to next message
arne anka is currently offline arne ankaFriend
Messages: 133
Registered: July 2009
Senior Member
share your results with us (just for the record -- if somebody has your
problem and only finds your answer, it may be very frustrating)
Re: GUI update [message #461797 is a reply to message #461795] Fri, 30 September 2005 10:40 Go to previous messageGo to next message
Henrik Skovgaard is currently offline Henrik SkovgaardFriend
Messages: 84
Registered: July 2009
Member
"arne anka" <arne.anka@ginguppin.de> wrote in message
news:op.sxwsgz0luyrgnr@komhem...
> share your results with us (just for the record -- if somebody has your
> problem and only finds your answer, it may be very frustrating)

Instead of doing setRedraw(false) and then true on shell-level, I found out
that is was possible on composite-level.

Kender du Arne? http://www.blok4.dk/images/strips/strip_0043.gif
Re: GUI update [message #461806 is a reply to message #461797] Fri, 30 September 2005 13:59 Go to previous message
arne anka is currently offline arne ankaFriend
Messages: 133
Registered: July 2009
Senior Member
> Instead of doing setRedraw(false) and then true on shell-level, I found
> out
> that is was possible on composite-level.

thanks, i'm sure it's a problem i have to solve in a near future ...

> Kender du Arne? http://www.blok4.dk/images/strips/strip_0043.gif

nej, bara honom:
http://www.arneanka.com/
det är int min sida, jag bara tycker att han är kul så jag valde han's
namn som nick ;-)
Previous Topic:ErrorDialog: new line in MultiStatus not recognised
Next Topic:Looking for a generic Transfer implementation for simple D&D
Goto Forum:
  


Current Time: Sat Apr 27 01:18:29 GMT 2024

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

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

Back to the top