custom jmol menu

23 views
Skip to first unread message

Jason Grout

unread,
Jul 5, 2011, 5:19:59 AM7/5/11
to sage-n...@googlegroups.com, Jonathan Gutow

I'm trying to get jmol to work with the single cell server. Jmol itself
seems to work fine, but I can't seem to get Sage's custom menu running.

If you go here: http://sagenb.org:5467/ and type in

var('y')
plot3d(sin(x)*cos(y),(x,-3,3),(y,-4,4))

and evaluate, jmol should pop up with the plot. Right-clicking on the
jmol should bring up the custom menu, but nothing happens.

In the initialization javascript, I have:
------------------------------------
jmolInitialize('/static/jmol');
// TODO: setting the menu doesn't appear to work
// See http://wiki.jmol.org/index.php/Custom_Menus
jmolSetCallback("menuFile","/static/jmol/appletweb/SageMenu.mnu");
------------------------------------


You can download the SageMenu.mnu file, as indicated, from
http://sagenb.org:5467/static/jmol/appletweb/SageMenu.mnu, so jmol
should be able to find the file. Does anyone have any idea why the menu
file isn't showing up? Jonathan, you're the expert here on this. I
can't even get to the error console because I don't know how to do it
without menu.

When I comment out the jmolSetCallback line above, the regular jmol menu
comes up on a right-click.

Thanks,

Jason

Jason Grout

unread,
Jul 5, 2011, 12:39:35 PM7/5/11
to sage-n...@googlegroups.com, Jonathan Gutow


Alex Kramer just pointed out to me that the right-click custom menu
*did* work for him on linux. So we started experimenting, and it seems
that the right-click menu works for me (OSX 10.6.8, Firefox 5 or Chrome,
java version [1]) maybe about half of the time. It seems like it works
more when I'm right-clicking off of the surface or bounding box (but
still in the applet).

So I'm chalking this up to the ancient jmol we still have in Sage; so
disregard the message above. I'll look into upgrading the jmol to
Jonathan's most recent work and see if that fixes the problem.

Thanks,

Jason

[1] java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)

Jason Grout

unread,
Jul 5, 2011, 1:31:08 PM7/5/11
to sage-n...@googlegroups.com, Jonathan Gutow
On 7/5/11 11:39 AM, Jason Grout wrote:

>
> Alex Kramer just pointed out to me that the right-click custom menu
> *did* work for him on linux. So we started experimenting, and it seems
> that the right-click menu works for me (OSX 10.6.8, Firefox 5 or Chrome,
> java version [1]) maybe about half of the time. It seems like it works
> more when I'm right-clicking off of the surface or bounding box (but
> still in the applet).
>
> So I'm chalking this up to the ancient jmol we still have in Sage; so
> disregard the message above. I'll look into upgrading the jmol to
> Jonathan's most recent work and see if that fixes the problem.
>

I did some more testing and it's not the old version of Jmol. Again,
here is my system:

OSX 10.6.8
Firefix 5
Chrome 12.0.742.112


java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)


I have the same behavior in the single-cell server's Jmol, sagenb.org's
Jmol (currently the old version), and also Jonathan's test server at
http://141.233.196.149:8888

The behavior seems to be that right-clicking (i.e., control-clicking on
the mac touchpad or right-clicking with a mouse) only shows the menu
when either the right side or the bottom of the menu extends past the
java frame. In the attached picture, that region is shaded in blue.
When I right-click in the blue region, the menu comes up. When I
right-click in the non-blue region, no menu appears.

I tried checking this behavior on the Jmol website, but since the normal
menu is taller than the size of the applet, the menu always appears; I
don't know if it exhibits the same bug and I just don't see it because
of the size of the default menu, or if I don't see the bug because it
isn't running a custom menu.

Jonathan: feel free to forward this report to the jmol list if you think
it is a Jmol issue, rather than an issue with our or your work
integrating Jmol into Sage.

Thanks,

Jason

jmol-custom-menu.png

Jonathan

unread,
Jul 5, 2011, 3:41:34 PM7/5/11
to sage-notebook
Jason,

Thanks for the sleuthing. This narrows it down quite a bit. This
appears to be a MacOS JVM issue. I have put out the following call to
have Jmol users look at this. We may or may not come up with
something. If people here could also try the test page and send in
comments/observations that would help.

Jonathan

-------request that went out to the Jmol community-------
Dear Jmol Users:

I'm trying to track down an odd issue I and some others are seeing on
web pages that use a custom pop-up menu within Jmol. What I would
really like is for people to try this web page with different OS/
Browser combinations and report to me if they see the issue. What
we're seeing is that the pop-up only works if you right-click in the
bottom or right third of the Jmol applet. So far we've verified it
with the following:

OSX 10.6.8
Firefix 5
Chrome 12.0.742.112
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)

and the 32 bit mode as well.

Please try this web page:
http://www.uwosh.edu/faculty_staff/gutow/right-click_test/right-click_test.html

I've also verified that the problem does not occur with FF or Chrome
under Ubuntu Linux. I mostly need Windows testers now. I'm
suspicious of the MacOS JVM. If you've got a different VM installed
on a MacOS system, I'd really appreciate you giving this a try and
reporting back.

Thanks,
Jonathan

----------------------------------
On Jul 5, 12:31 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
> On 7/5/11 11:39 AM, Jason Grout wrote:
>
>
>
> > Alex Kramer just pointed out to me that the right-click custom menu
> > *did* work for him on linux. So we started experimenting, and it seems
> > that the right-click menu works for me (OSX 10.6.8, Firefox 5 or Chrome,
> > java version [1]) maybe about half of the time. It seems like it works
> > more when I'm right-clicking off of the surface or bounding box (but
> > still in the applet).
>
> > So I'm chalking this up to the ancient jmol we still have in Sage; so
> > disregard the message above. I'll look into upgrading the jmol to
> > Jonathan's most recent work and see if that fixes the problem.
>
> I did some more testing and it's not the old version of Jmol.  Again,
> here is my system:
>
> OSX 10.6.8
> Firefix 5
> Chrome 12.0.742.112
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
> Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
>
> I have the same behavior in the single-cell server's Jmol, sagenb.org's
> Jmol (currently the old version), and also Jonathan's test server athttp://141.233.196.149:8888
>
> The behavior seems to be that right-clicking (i.e., control-clicking on
> the mac touchpad or right-clicking with a mouse) only shows the menu
> when either the right side or the bottom of the menu extends past the
> java frame.  In the attached picture, that region is shaded in blue.
> When I right-click in the blue region, the menu comes up.  When I
> right-click in the non-blue region, no menu appears.
>
> I tried checking this behavior on the Jmol website, but since the normal
> menu is taller than the size of the applet, the menu always appears; I
> don't know if it exhibits the same bug and I just don't see it because
> of the size of the default menu, or if I don't see the bug because it
> isn't running a custom menu.
>
> Jonathan: feel free to forward this report to the jmol list if you think
> it is a Jmol issue, rather than an issue with our or your work
> integrating Jmol into Sage.
>
> Thanks,
>
> Jason
>
>  jmol-custom-menu.png
> 42KViewDownload

Jason Grout

unread,
Jul 5, 2011, 3:50:34 PM7/5/11
to sage-n...@googlegroups.com
On 7/5/11 2:41 PM, Jonathan wrote:
> Thanks for the sleuthing. This narrows it down quite a bit. This
> appears to be a MacOS JVM issue. I have put out the following call to
> have Jmol users look at this. We may or may not come up with
> something. If people here could also try the test page and send in
> comments/observations that would help.
>

Great. I'll reply on the JMOL list...

Thanks,

Jason

Reply all
Reply to author
Forward
0 new messages