Skip to main content



      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 18:35 Go to next message
Eclipse UserFriend
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 10:29 Go to previous messageGo to next message
Eclipse UserFriend
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 13:19 Go to previous message
Eclipse UserFriend
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 Jul 03 10:52:19 EDT 2025

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

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

Back to the top