Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to show TabItem/CTabItem context menu
How to show TabItem/CTabItem context menu [message #446460] Thu, 25 November 2004 11:49 Go to next message
Eclipse UserFriend
Originally posted by: mlriess.gmx.de

Hi,

MenuDetect Events aren't raised when right clicking on TabItems or
CTabItems. Is this a bug or a feature?

Regards,

Mike
Re: How to show TabItem/CTabItem context menu [message #446467 is a reply to message #446460] Thu, 25 November 2004 13:52 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
What platform are you using? I tried the following on Windows XP and it
works for me:

public static void main (String [] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
CTabFolder folder = new CTabFolder(shell, SWT.BORDER);
for (int i = 0; i < 6; i++) {
CTabItem item = new CTabItem(folder, SWT.CLOSE);
item.setText("Item " + i);
Text text = new Text(folder, SWT.NONE);
item.setControl(text);
}
folder.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event e) {
System.out.println("Menu Detect");
}
});
TabFolder folder2 = new TabFolder(shell, SWT.BORDER);
for (int i = 0; i < 6; i++) {
TabItem item = new TabItem(folder2, SWT.NONE);
item.setText("Item " + i);
Text text = new Text(folder2, SWT.NONE);
item.setControl(text);
}
folder2.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event e) {
System.out.println("Menu Detect");
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}

"Michael Riess" <mlriess@gmx.de> wrote in message
news:co4guj$tcj$1@www.eclipse.org...
> Hi,
>
> MenuDetect Events aren't raised when right clicking on TabItems or
> CTabItems. Is this a bug or a feature?
>
> Regards,
>
> Mike
>
Previous Topic:how to remove a Combo from a Group
Next Topic:Adding tooltips to Resource Navigator
Goto Forum:
  


Current Time: Mon Oct 26 11:14:12 GMT 2020

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

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

Back to the top