Re: Using BarChart in a Widget
- To: mathgroup at smc.vnet.net
- Subject: [mg56479] Re: Using BarChart in a Widget
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Tue, 26 Apr 2005 21:52:34 -0400 (EDT)
- References: <d4kl1t$edj$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
If you replace the symbol BarChart with:
ToExpression["Graphics`Graphics`BarChart"]
you can make the widget work!
The GUIKit is supposed to move all the Global symbols inside scripts
into a private context. BarChart is in the context Graphics`Graphics` -
so why it is moving it I don't know, but I checked and that is what is
happening.
It is precisely because of problems like that that I wrote my (free)
Super Widget Package (available from www.dbaileyconsultancy.co.uk). This
package uses GUIKit, but presents a much simpler interface to the user,
who need know nothing about Java, J/Link, or even GUIKit. You can also
mix SuperWidgets with the ordinary kind. Using my package, your widget
would be created using:
SuperWidgetGraphicsPanel[Null, BarChart[{0, 1, 2},
DisplayFunction -> Identity]] // SuperGUIRun
Note that you don't need to embed an extra Needs inside Super Widgets.
Furthermore, by adding one option to SuperWidgetGraphicsPanel you could
get mouse-click feedback in Mathematica graphics coordinates.
Contact me if you would like to discuss this further.
David Bailey
dbaileyconsultancy.co.uk