problems on linux motif with text widgets [message #235747] |
Wed, 28 April 2004 05:35  |
Eclipse User |
|
|
|
Hi all,
I've a problem to write text in a text widget. With win32 and OSX all
works fine, but some strange behaviour under linux(Debian 3.0) .
I've tried libs like swt-2.1.3-linux-motif and swt-3.0M8-linux-motif,
exported the LD_Library path, e.g. :
export
LD_LIBRARY_PATH=/lib:/home/niemeand/SWT_TESTS/lib/swt-2.1.3- linux-motif
and stripped down my program basically to pin down the problem.
The code is packed in a jar ball with following manifest.mf sets:
Manifest-Version: 1.0
Main-Class: project.progs.LoginWindowTest
Class-Path: lib/swt-2.1.3-linux-motif/swt.jar
The JRE is:
java version "1.4.1_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
Java HotSpot(TM) Client VM (build 1.4.1_03-b02, mixed mode)
Testing by using X11 and export the display to another debian box and my
apple.
I assume that I forgot a required property to that code.
Many thanks for any hint.
Cheers,
Andreas
Here the simple code snippet:
import org.eclipse.swt.*;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
/**
* @author niemeand
*
*/
public class LoginWindowTest {
public static void main(String[] args) {
doCreateLoginScreen();
}
public static void doCreateLoginScreen() {
Display vDisplay = new Display();
final Shell vShell = new Shell(vDisplay, SWT.ON_TOP);
vShell.setLayout(new FillLayout(SWT.VERTICAL));
Text vUser = new Text(vShell, SWT.BORDER);
vUser.setSize(180, 20);
Button vButtonCancel = new Button(vShell, SWT.FLAT);
vButtonCancel.setText("cancel");
vButtonCancel.setSize(180, 20);
vButtonCancel.addSelectionListener(new SelectionAdapter () {
public void widgetSelected(SelectionEvent e) {
vShell.close();
}
});
vShell.pack();
vShell.setLocation((vDisplay.getBounds().width -
vShell.getBounds().width) / 2,
(vDisplay.getBounds().height - vShell.getBounds().height) / 2);
vShell.open();
while (! vShell.isDisposed()) {
if (! vDisplay.readAndDispatch()) vDisplay.sleep();
}
vDisplay.dispose();
}
}
|
|
|
Re: problems on linux motif with text widgets [message #235821 is a reply to message #235747] |
Wed, 28 April 2004 08:22   |
Eclipse User |
|
|
|
Andreas,
The problem is the different swt implementations of ON_TOP Shells across the
platforms. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=32240.
The only workaround I can suggest is to not use ON_TOP if possible. Can you
use NO_TRIM instead (ie.- same appearance but without the ON_TOP behaviour)?
This is of course dependent upon your specific use context.
Grant
"Andreas Niemeyer" <andreas.niemeyer@gutzmann.com> wrote in message
news:c6ntgu$iel$1@eclipse.org...
> Hi all,
>
> I've a problem to write text in a text widget. With win32 and OSX all
> works fine, but some strange behaviour under linux(Debian 3.0) .
>
> I've tried libs like swt-2.1.3-linux-motif and swt-3.0M8-linux-motif,
> exported the LD_Library path, e.g. :
>
> export
> LD_LIBRARY_PATH=/lib:/home/niemeand/SWT_TESTS/lib/swt-2.1.3- linux-motif
>
> and stripped down my program basically to pin down the problem.
>
> The code is packed in a jar ball with following manifest.mf sets:
>
> Manifest-Version: 1.0
> Main-Class: project.progs.LoginWindowTest
> Class-Path: lib/swt-2.1.3-linux-motif/swt.jar
>
> The JRE is:
>
> java version "1.4.1_03"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_03-b02)
> Java HotSpot(TM) Client VM (build 1.4.1_03-b02, mixed mode)
>
>
> Testing by using X11 and export the display to another debian box and my
> apple.
>
> I assume that I forgot a required property to that code.
>
> Many thanks for any hint.
>
> Cheers,
> Andreas
>
>
> Here the simple code snippet:
>
> import org.eclipse.swt.*;
> import org.eclipse.swt.events.SelectionAdapter;
> import org.eclipse.swt.events.SelectionEvent;
> import org.eclipse.swt.widgets.*;
> import org.eclipse.swt.layout.*;
>
> /**
> * @author niemeand
> *
> */
>
> public class LoginWindowTest {
>
> public static void main(String[] args) {
>
> doCreateLoginScreen();
> }
>
> public static void doCreateLoginScreen() {
>
> Display vDisplay = new Display();
> final Shell vShell = new Shell(vDisplay, SWT.ON_TOP);
>
> vShell.setLayout(new FillLayout(SWT.VERTICAL));
>
> Text vUser = new Text(vShell, SWT.BORDER);
> vUser.setSize(180, 20);
>
> Button vButtonCancel = new Button(vShell, SWT.FLAT);
> vButtonCancel.setText("cancel");
> vButtonCancel.setSize(180, 20);
>
> vButtonCancel.addSelectionListener(new SelectionAdapter () {
> public void widgetSelected(SelectionEvent e) {
>
> vShell.close();
> }
> });
>
> vShell.pack();
> vShell.setLocation((vDisplay.getBounds().width -
> vShell.getBounds().width) / 2,
> (vDisplay.getBounds().height - vShell.getBounds().height) / 2);
> vShell.open();
>
> while (! vShell.isDisposed()) {
> if (! vDisplay.readAndDispatch()) vDisplay.sleep();
> }
> vDisplay.dispose();
> }
> }
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05498 seconds