Truncated MathPanel Output
- To: mathgroup at smc.vnet.net
- Subject: [mg92223] Truncated MathPanel Output
- From: Raffy <raffy at mac.com>
- Date: Tue, 23 Sep 2008 07:34:06 -0400 (EDT)
(Sorry if this is a duplicate, I got disconnected on form submission).
I'm having difficultly presenting large graphics (ie. a table of data,
with presented width > 600 px) in a GUIKit MathPanel object, when the
function to present such data is called from a GUIKit action (ie.
inside a Script[] wrapper). The resulting graphics are truncated at
some arbitrary width, and/or are just a complete mess.
Here is some code to reproduce the problem:
(*our function which will create a window with a button, which when
pressed, will call passed function from the gui's thread*)
gui[f_] :=
GUIRun[Widget[
"Button", {"Text" -> "Go!", BindEvent["Action", Script[f[]]]}],
IncludedScriptContexts -> {"Global`"}]
(*our presentation function, which creates a new window to display
data*)
present[q_] :=
GUIRun[Widget[
"MathPanel", {"MathCommand" -> ToString[q, InputForm],
"PreferredSize" ->
Widget["Dimension", {"Width" -> 1000, "Height" -> 400}]}]];
(*create some data*)
m = RandomReal[{0, 1}, {20, 20}];
(*our data presented in some fancy way*)
rep = Grid[m, Frame -> All];
Now to see the problem, compare the output of the following:
1. rep
2. present[rep]
3. gui[present[rep]&] (you'll need to click the button in this case)