Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » howto create context menu in Motif Eclipse?
howto create context menu in Motif Eclipse? [message #452731] Wed, 23 March 2005 23:35 Go to next message
Martin is currently offline MartinFriend
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 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
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
>
Re: howto create context menu in Motif Eclipse? [message #452863 is a reply to message #452766] Fri, 25 March 2005 18:19 Go to previous message
Martin is currently offline MartinFriend
Messages: 35
Registered: July 2009
Member
Thanks for answer. I really works. When I want to activate context menu
for Combo box, I have to right click on the arrow button, not in text
area. Strange, but it works.
Previous Topic:Layouts
Next Topic:calling setFocus from a listener for activate event
Goto Forum:
  


Current Time: Thu Oct 17 16:03:23 GMT 2019

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

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

Back to the top