[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] SWT with CrEme on WindowsCE


I am trying out SWT on WindowsCE with the CrEme 3.26 JVM for WindowsCE. (downloaded swt-3.1M7-win32-wce_ppc-arm-j2se.zip)

The device is a DataLogic JET PDA/barcode-scanner running WindowsCE.NET 4.2.

I've got some basic stuff working, i.e. some text fields, button, layout etc.

But I'm hitting 2 problems:
1. when I try to create a simple menu with a menu item, the application crashes on the PDA.
I've started from the sample in http://www.eclipse.org/articles/Article-small-cup-of-swt/pocket-PC.html
That one starts fine, but shows no menu.
Apparently WindowsCE behaves differently from PocketPC.


Then I added a MenuItem,
...
	public void initUI() {
		...
		display = new Display();
		shell = new Shell(display, SWT.SHELL_TRIM | SWT.MENU);
		shell.setText("HelloSWT");
		shell.setSize(200, 200);
		shell.setLayout(new GridLayout(2,true));
		Menu menu = new Menu(shell, SWT.BAR);
		shell.setMenuBar(menu);

		// all's fine till here, but...
		// when I add these lines, it fails
		Menu fileMenu = new Menu(menu);
		MenuItem fileMenuItem = new MenuItem(menu,SWT.CASCADE);
		fileMenuItem.setText("File");
		fileMenuItem.setMenu(fileMenu);
		...
	}
...

Now, the app crashes upon start-up, the exception trace gives
org.eclipse.swt.SWTError: Item not added
	at org.eclipse.swt.SWT.error()
	at org.eclipse.swt.SWT.error()
	at org.eclipse.swt.SWT.error()
	at org.eclipse.swt.widgets.Widget.error()
	at org.eclipse.swt.widgets.Menu.createItem()
	at org.eclipse.swt.widgets.MenuItem.<init>()
	at HelloSWT.initUI()
	at HelloSWT.start()
	at HelloSWT.main()

2. the SWT.SHELL_TRIM style promises to show the standard shell decorations for the OS. On WindowsCE, apps often offer an "Ok" button and an exit button shown as a red button with a white X.
For the SWT app, the SHELL_TRIM only shows the "Ok" button, and that one exits the application...


2nd issue is not that important, but would be nice if someone knows how to specify the 2 std buttons.

1st issue might be a blocking issue for choosing SWT for our app dvp.
Anyone has a clue?

Regards

Erwin