SWT menu button on PPC [message #450109] |
Tue, 08 February 2005 12:51 |
Eclipse User |
|
|
|
Originally posted by: fr.wedekind2-LA.yahoo.com
Hi,
I have an problem on ppc (SWT 3.0.1 for PPC).
I have a shell with a menubar containing an image button:
MenuItem itemCancel = new MenuItem(bar, SWT.PUSH);
InputStream inputStreamCancel =
getClass().getResourceAsStream("cancel.gif");
Image imageCancel = new Image(display, inputStreamCancel);
itemCancel.setImage(imageCancel);
itemCancel.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
shell.dispose();
}
});
In this shell the user can invoke another dialog which has also
a menu with image buttons. If finished this second dialog in the first
shell the itemCancel button has no image but the button still exists. I
testet the program on PC without problems.
Then I discovered if I remove the menu buttons in the new dialog they
will never disappear in the first (allways OK). The problem is:
item.setImage(image); in the second shell
but some pictures causes the same behaviuor in the first dialog (also
such I have never used else?) and other works: I can't see a plausible
relation?!
Thanks, Frank
|
|
|
|
Re: SWT menu button on PPC [message #450308 is a reply to message #450284] |
Thu, 10 February 2005 10:43 |
Eclipse User |
|
|
|
Originally posted by: fr.wedekind2-LA.yahoo.com
This is a multi-part message in MIME format.
--------------010208020909060503010403
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Christophe Cornu wrote:
> Hi Frank,
>
> Sorry I am not sure I understand the problem nor its cause. Can you open a
> bug report (SWT) with a simple snippet that reproduces the problem? Thanks,
>
> Chris
>
>
Hi Chris,
sorry, my description was terrible. I don't know if this is a bug or I
make a mistake.
If I press the icon button (on the right of the help menu) another
dialog will be shown. Then I press cancel on the new dialog and now in
the main shell the edit image is missing but the button still exists.
I have Windows Mobile 2003, Second edition - Version 4.21.1088 (Build
14260.2.0.5) and SWT 3.0.1 for PPC.
Regards, Frank
package test;
import java.io.*;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class MenuImageSnippet {
final Display display;
protected Shell shell, shellDialog;
public MenuImageSnippet() {
display = new Display();
// main shell
shell = new Shell(display, SWT.CLOSE | SWT.RESIZE);
shell.setText("Menu image problem");
shell.setLayout(new FillLayout());
Menu bar = new Menu(shell, SWT.BAR);
shell.setMenuBar(bar);
Menu menu = new Menu(bar);
MenuItem header = new MenuItem(bar, SWT.CASCADE);
header.setText("Help");
header.setMenu(menu);
MenuItem itemHelp = new MenuItem(menu, SWT.MENU);
itemHelp.setText("Content");
new MenuItem(menu, SWT.SEPARATOR);
MenuItem itemAbout = new MenuItem(menu, SWT.MENU);
itemAbout.setText("Info");
MenuItem itemEdit = new MenuItem(bar, SWT.PUSH);
InputStream inputStream = getClass().getResourceAsStream("edit.gif");
Image imageEdit = new Image(display, inputStream);
itemEdit.setImage(imageEdit);
itemEdit.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
// dialog shell
shellDialog = new Shell(shell, SWT.CLOSE | SWT.APPLICATION_MODAL |
SWT.RESIZE);
shellDialog.setText("dialog");
Menu barDialog = new Menu(shellDialog, SWT.BAR);
shellDialog.setMenuBar(barDialog);
MenuItem itemCancel = new MenuItem(barDialog, SWT.PUSH);
itemCancel.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
shellDialog.close();
}
});
InputStream inputStream = getClass().getResourceAsStream("cancel.gif");
Image imageCancel = new Image(display, inputStream);
itemCancel.setImage(imageCancel);
shellDialog.open();
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
public static void main(String[] args) {
new MenuImageSnippet();
}
}
--------------010208020909060503010403
Content-Type: image/gif;
name="edit.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="edit.gif"
R0lGODlhEAAQAOYAAPT2/PX3/PT2++rv+vDz+md9qfn6/G2DrXSKs3OJsoCV u4GWu4qewuHp
9+Tr+IecwI2ixJGlx7PA1rfE2b3J3d7o+N/o9+nv+fP2+/D0+vb4++/0+/X4 /PT3++nw+SJD
Z+zy+fX4+/f5+9vTobu0inxwPntvPntwPoZ2PINzPH9xPXxvPpB+Qpp/N5B5 OYx3OqmQSZZ8
ONy1VsSjT+DIj7KKMK+JMayHMqiFM8OaPduxTtSyaNSyadq9fNWyafDYqOnE fvbmyJN8V5R/
XZWBYJN4UY9pOI5pOI9sPo9tPpBwQ5BwRJJ0So9pOf///wAAAAAAAAAAAAAA AAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAE4ALAAAAAAQABAAAAeegE6Cg4SF hDWIiYiGgjUG
j5A8NYw5kJA9PpODQUQ6IhEMCggaND07NoM/QUMcHa4AAgEdITeDQKpCFBAP CwkHBRg4g0W3
QUUbGckEGQQthEzFTBO9vyAxhUu3I0oeFxcDHi6FMkkkJEgSvgUgL4UzDkZH TR8O9Q4ohTAN
oB8fDf8NUhRiYaFgwQoVCqooZGKFiRIlTpwoscIho4uDAgEAOw==
--------------010208020909060503010403
Content-Type: image/gif;
name="cancel.gif"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="cancel.gif"
R0lGODlhEAAQAOYAAGyogTOCTTaDT0CJWEKLWkaPXlSYalqbcFyccYKzkiR2 Pi58RjOBSzmG
UFicbV2ecWOid4GykKLJri18RC59RS99RjB+RjOBSUuSYEqQXneuhzKARzaE SjuHTz+JUo69
mj6ITz6IUD6HUEaOV0ePWFKWYmuneo++msPdyeLv5VKWYFaaZFaZZF2caqvP s7zYwlSXYVeZ
ZFiZZF6catrq3ebx6FKWXvH38mCgaXyyhHmugYW4jIy8k/D38VmZYWikb2Gg Z2CeZp7Godzq
3Weiam2mcHeueICzgHuxenmud4e4hYGzfeHv4JG+jLPSsLzZub7au5/HmqDH m7vYt8Lcv8be
w7DQq8nQx////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAFkALAAAAAAQABAAAAemgFmCg4SF hoeIWVcPGA0Z
D1eICQ0/RpY/AQmGCRtLVlRVVFJHCpqDVw1JUFisrE9IAZGCB0BRrFNNTlhM SkAQgwU2QlhD
QcZFREQ+BYMBFidYKBQTExQXHCAMwB0aWCkeIiISLg4kzIIQITM3WC8mH1g9 LSoApwowOjSt
NTwyCrKCIiwYgSPHjhw4YgiIYChChRIrWKwoUYHhoSsGBhAYgABgIkSBAAA7
--------------010208020909060503010403--
|
|
|
Powered by
FUDForum. Page generated in 0.02931 seconds