Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Label Flashing
Label Flashing [message #444645] Mon, 18 October 2004 22:38 Go to next message
Atanas is currently offline AtanasFriend
Messages: 8
Registered: July 2009
Junior Member
I created a label that contains a string. The string represents a map. I
have a "Next" button and everytime I press it the objects on the map
should move. So when I press "Next" I change my string ( str =
modify_string(str) ) and and then call label.setText(str) to update my
label. However, the screen flashes everytime I update my label. Is there a
way I can avoid the flashing? Maybe I should not use a label for what I
want to accomplish?
Re: Label Flashing [message #444651 is a reply to message #444645] Tue, 19 October 2004 12:49 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
This must be specific to your context, since this of course should not
happen, and I've verified with a trivial snippet that it does not happen in
the base case. Please log a bug report with Platform - SWT and provide a
snippet that shows the problem happening.

Thanks,
Grant

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/faq.html#whatisasnippet

"Atanas" <ata_vla@yahoo.com> wrote in message
news:cl1glv$68p$1@eclipse.org...
> I created a label that contains a string. The string represents a map. I
> have a "Next" button and everytime I press it the objects on the map
> should move. So when I press "Next" I change my string ( str =
> modify_string(str) ) and and then call label.setText(str) to update my
> label. However, the screen flashes everytime I update my label. Is there a
> way I can avoid the flashing? Maybe I should not use a label for what I
> want to accomplish?
>
Re: Label Flashing [message #444660 is a reply to message #444651] Tue, 19 October 2004 20:43 Go to previous messageGo to next message
Atanas is currently offline AtanasFriend
Messages: 8
Registered: July 2009
Junior Member
Thank you for the answer. Can you send me your trivial snippet so I can
test it on my machine?
Re: Label Flashing [message #444675 is a reply to message #444660] Wed, 20 October 2004 12:45 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
public class Main {
static int index = 0;
public static void main(String[] args) {
final String[] strings = {"first label contents","contents of second
label"};
Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10, 10, 200, 200);
final Label label = new Label(shell, SWT.NONE);
label.setBounds(10,10,180,150);
label.setText(strings[index++ % 2]);
label.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
label.setText(strings[index++ % 2]);
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}

Grant

"Atanas" <ata_vla@yahoo.com> wrote in message
news:cl3u8q$lm0$1@eclipse.org...
> Thank you for the answer. Can you send me your trivial snippet so I can
> test it on my machine?
>
Previous Topic:Focus problem on Mac
Next Topic:where can i find the detail explanations of some concept,such as inset,bound
Goto Forum:
  


Current Time: Sat Apr 20 05:54:45 GMT 2024

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

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

Back to the top