howto create context menu in Motif Eclipse? [message #452731] |
Wed, 23 March 2005 23:35 |
Martin Messages: 35 Registered: July 2009 |
Member |
|
|
Hi. I've tried using my plug-in in Motif version of Eclipse and it seems,
that Motif can't create popup menus. I've tried to create simple Text()
field which has default popup menu with items like Copy, Paste, Cut, etc,
but when I'm trying to invoke it with right-mouse button, nothing happens.
Same with Combo() which is most vital for my project.
CODE:
Combo entry = new Combo(parent, SWT.DROP_DOWN);
Menu popup = new Menu(entry.getShell(), SWT.POP_UP);
MenuItem test = new MenuItem(popup, SWT.PUSH);
test.setText("test item");
entry.setMenu(popup);
// creates combo box with popup menu (activated by rmb click) containing
item 'test item'
// this works ok in Windows | Linux/GTK
Any idea how to make popup menu working in Linux/Motif Eclipse?
Thanks!
PS: Please excuse my lame english.
--
Martin
|
|
|
Re: howto create context menu in Motif Eclipse? [message #452766 is a reply to message #452731] |
Thu, 24 March 2005 15:29 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi Martin,
You're probably using the wrong trigger to show the context menu when
testing. Context menus on motif are shown by right-mouse-button-down and
then HOLDING it down; once you right-mouse-button-up then the context menu
will go away.
I've verified that
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet40.java?rev=HEAD&a mp;content-type=text/vnd.viewcvs-markup
works for me in motif, and I also tried replacing its two Composites with a
Combo and Text, which also worked. If you cannot get this snippet to work
for you then please follow up.
Grant
"Martin" <my.plugin.baby@gmail.com> wrote in message
news:8f9f8f137c5464351cf134fc8bc7258a$1@www.eclipse.org...
> Hi. I've tried using my plug-in in Motif version of Eclipse and it seems,
> that Motif can't create popup menus. I've tried to create simple Text()
> field which has default popup menu with items like Copy, Paste, Cut, etc,
> but when I'm trying to invoke it with right-mouse button, nothing happens.
> Same with Combo() which is most vital for my project.
>
> CODE:
> Combo entry = new Combo(parent, SWT.DROP_DOWN);
> Menu popup = new Menu(entry.getShell(), SWT.POP_UP);
> MenuItem test = new MenuItem(popup, SWT.PUSH);
> test.setText("test item");
> entry.setMenu(popup);
> // creates combo box with popup menu (activated by rmb click) containing
> item 'test item'
> // this works ok in Windows | Linux/GTK
>
>
>
> Any idea how to make popup menu working in Linux/Motif Eclipse?
> Thanks!
>
> PS: Please excuse my lame english.
> --
> Martin
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04398 seconds