Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT with CrEme on WindowsCE
SWT with CrEme on WindowsCE [message #457244] Wed, 22 June 2005 16:45
Eclipse UserFriend
Originally posted by: zita123.dodgeit.com

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/poc ket-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
Previous Topic:Error code running SWT examples
Next Topic:Why is this so hard - or am I just a little slow
Goto Forum:
  


Current Time: Fri Apr 26 15:53:00 GMT 2024

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

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

Back to the top