[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-swt-dev] swt.browser trouble
|
Hi Filip,
(note that SWT usage questions like
this should be asked on the eclipse.platform.swt newsgroup/swt forum, not
on this mailing list)
Based on your description I don't see
any reason that this would not work. You mention that the UI freezes
until you do something to create a system event, which sounds like the
wiggly mouse problem. Are you doing anything in a background thread?
Does adding a Display.wake() call here make this symptom go away?
Are you able to reduce your case to
a complete/runnable snippet that shows the problem (it does not have to
match what you're doing in your app)? I have a sample below which
I tried on 32-bit Ubuntu 9.10 and it didn't have a problem like what you
describe, though it did spew some "(SWT:11474): Gdk-WARNING **: XID
collision, trouble ahead" warnings. Do you see these when running
your app?
Please post follow-ups to the swt forum
( http://www.eclipse.org/forums/index.php?t=thread&frm_id=100 ), thanks!
public static void main(String[] args)
{
final Display display
= new Display();
final Shell shell = new
Shell(display);
shell.setLayout(new FillLayout());
// pretend the following
links were parsed out from the google.com page
final String[] links =
{
"http://www.google.com/intl/en/ads/",
"http://www.google.com/services/",
"http://www.google.com/intl/en/about.html",
"http://www.google.com/intl/en/privacy.html"
};
final Browser browser
= new Browser(shell, SWT.NONE);
browser.setUrl("google.com");
browser.addProgressListener(new
ProgressAdapter() {
public void
completed(ProgressEvent event) {
if (++linkIndex > 3) return; // done
String link = links[linkIndex];
System.out.println("changing to " + link);
browser.setUrl(link);
}
});
shell.setBounds(10,10,300,300);
shell.open();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
Grant
Filip Pekarek <filip.pekarek@xxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx
02/27/10 06:54 PM
Please respond to
"Eclipse Platform SWT component developers list."
<platform-swt-dev@xxxxxxxxxxx> |
|
To
| platform-swt-dev@xxxxxxxxxxx
|
cc
|
|
Subject
| [platform-swt-dev] swt.browser trouble |
|
Hello,
I have swt.browser with xulrunner (swt-3.6M5-gtk-linux-x86_64,
xulrunner-sdk-1.9.1.3-linux-x86_64 - my own build). I render the page and
get all links from the page as String[]. Now I want to render all pages
the links refer to. So I made my own ProgressListener which takes link
one by one and calls browser.setUrl() in its completed method. The trouble
is that the rendering freezes. The ProgressListener is not noticed again
until I move with the cursor or invoke any other system event. What am
I doing wrong? I am not sure if its swt-xulrunner or OS problem?
I am using Ubuntu 9.10 x86_64.
Most important part of my code is attached.
Thanks a lot for any help.
Filip
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
Attachment:
Test.java
Description: Binary data