Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » popup menu on a draw2d figure on solaris
popup menu on a draw2d figure on solaris [message #438507] Sat, 26 June 2004 23:44 Go to next message
Pete MacLiesh is currently offline Pete MacLieshFriend
Messages: 14
Registered: July 2009
Junior Member
eclipse 2.1.3

I have a plugin with a draw2d figure hosted inside a FigureCanvas and have a
popup menu over certain elements.

I create the menu, attach it to the swt control (gridCanvas in this case)
and handle events:

thePopupMenu = new Menu(c);
gridCanvas.setMenu(thePopupMenu);
thePopupMenu.addMenuListener(new MenuListener() {
public void menuHidden(MenuEvent e) { }
public void menuShown(MenuEvent e) {
prepPopup(e);
}
});

prepPopup then adds MenuItems and selection listeners to the menu.

It works fine on win32 and linux (gtk), but on solaris/motif it comes up
with each menu item blank, and something like 2 pix high - as if it found no
font and so decided to render it with zero point text. Indeed, menu
selections actually work, but only by careful positioning and guesswork.

Every other context menu in eclipse and our plugins works fine (we leave all
the menu fonts and the like well alone), so i don't think we are provoking
this behaviour.

Any suggestions on what to do to get the menus to render properly?

TIA

PMac
Re: popup menu on a draw2d figure on solaris [message #438675 is a reply to message #438507] Tue, 29 June 2004 18:05 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
What version of Solaris are you using? I am guessing you are using GEF
2.1.3 as well.

Do you see anything in the error log? No exceptions being thrown?

Try setting a font from JFaceResources on the FigureCanvas, just to test if
it fixes the problem.

Are you creating the context menu properly? Where are the menu items being
removed? You might want to try the SWT newsgroup to get more info about
this.

Could it be that the menu items you are adding have no text set? If you are
externalizing strings, maybe there's problem with that mechanism.

Can you run the 2.1.3 logic example on Solaris and see if you can reproduce
this problem? If not, you can compare your way of setting the context menu
to GEF's. We have tested the GEF 3.0 logic example on Solaris 9 and it has
been working fine.

Just doing some brain-storming to figure out what could be wrong.
Hopefully, one of these things will help you figure out the problem.


"Pete MacLiesh" <pmac@nospam.tensilica.nospam.com> wrote in message
news:cbl1nv$igl$1@eclipse.org...
> eclipse 2.1.3
>
> I have a plugin with a draw2d figure hosted inside a FigureCanvas and have
a
> popup menu over certain elements.
>
> I create the menu, attach it to the swt control (gridCanvas in this case)
> and handle events:
>
> thePopupMenu = new Menu(c);
> gridCanvas.setMenu(thePopupMenu);
> thePopupMenu.addMenuListener(new MenuListener() {
> public void menuHidden(MenuEvent e) { }
> public void menuShown(MenuEvent e) {
> prepPopup(e);
> }
> });
>
> prepPopup then adds MenuItems and selection listeners to the menu.
>
> It works fine on win32 and linux (gtk), but on solaris/motif it comes up
> with each menu item blank, and something like 2 pix high - as if it found
no
> font and so decided to render it with zero point text. Indeed, menu
> selections actually work, but only by careful positioning and guesswork.
>
> Every other context menu in eclipse and our plugins works fine (we leave
all
> the menu fonts and the like well alone), so i don't think we are provoking
> this behaviour.
>
> Any suggestions on what to do to get the menus to render properly?
>
> TIA
>
> PMac
>
>
Re: popup menu on a draw2d figure on solaris [message #438902 is a reply to message #438675] Fri, 02 July 2004 17:44 Go to previous message
Pete MacLiesh is currently offline Pete MacLieshFriend
Messages: 14
Registered: July 2009
Junior Member
Pratik, thanks for the reply. Notes inlined ...

"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:cbsavk$ukn$1@eclipse.org...
> What version of Solaris are you using? I am guessing you are using GEF
> 2.1.3 as well.


This is with eclipse+gef versions 2.1.1 - 2.1.3. Solaris is 8 (I have tried
a few different machines that have various patch clusters ... albeit not
quite the latest)

> Do you see anything in the error log? No exceptions being thrown?

Nada ... silence

> Try setting a font from JFaceResources on the FigureCanvas, just to test
if
> it fixes the problem.

I will try that; but I wanted to avoid it because selecting fonts
cross-platform is a pain. I was hoping that "defaults" consistent with the
rest of the platform would work (there are many other places we bring up swt
context menus with no problems; this is the only one that fails)

> Are you creating the context menu properly? Where are the menu items
being
> removed? You might want to try the SWT newsgroup to get more info about
> this.

I cross-posted to swt ... but no biters there

> Could it be that the menu items you are adding have no text set? If you
are
> externalizing strings, maybe there's problem with that mechanism.

This works fine on win32 and linux/gtk. No empty strings and no externalized
strings in this particular code.

> Can you run the 2.1.3 logic example on Solaris and see if you can
reproduce
> this problem? If not, you can compare your way of setting the context
menu
> to GEF's. We have tested the GEF 3.0 logic example on Solaris 9 and it
has
> been working fine.
>
> Just doing some brain-storming to figure out what could be wrong.
> Hopefully, one of these things will help you figure out the problem.

Thanks for your insights ... I'll was hoping to avoid forcibly setting
fonts, but I'll try that next

PMac

>
> "Pete MacLiesh" <pmac@nospam.tensilica.nospam.com> wrote in message
> news:cbl1nv$igl$1@eclipse.org...
> > eclipse 2.1.3
> >
> > I have a plugin with a draw2d figure hosted inside a FigureCanvas and
have
> a
> > popup menu over certain elements.
> >
> > I create the menu, attach it to the swt control (gridCanvas in this
case)
> > and handle events:
> >
> > thePopupMenu = new Menu(c);
> > gridCanvas.setMenu(thePopupMenu);
> > thePopupMenu.addMenuListener(new MenuListener() {
> > public void menuHidden(MenuEvent e) { }
> > public void menuShown(MenuEvent e) {
> > prepPopup(e);
> > }
> > });
> >
> > prepPopup then adds MenuItems and selection listeners to the menu.
> >
> > It works fine on win32 and linux (gtk), but on solaris/motif it comes up
> > with each menu item blank, and something like 2 pix high - as if it
found
> no
> > font and so decided to render it with zero point text. Indeed, menu
> > selections actually work, but only by careful positioning and guesswork.
> >
> > Every other context menu in eclipse and our plugins works fine (we leave
> all
> > the menu fonts and the like well alone), so i don't think we are
provoking
> > this behaviour.
> >
> > Any suggestions on what to do to get the menus to render properly?
> >
> > TIA
> >
> > PMac
> >
> >
>
>
Previous Topic:SWT CPL License Question
Next Topic:Linxux/GTK drop fails
Goto Forum:
  


Current Time: Thu Apr 25 06:59:24 GMT 2024

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

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

Back to the top