Re: GUIKIT - Export Graphics
- To: mathgroup at smc.vnet.net
- Subject: [mg64006] Re: GUIKIT - Export Graphics
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Fri, 27 Jan 2006 05:13:17 -0500 (EST)
- References: <dr8086$pgj$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Emanuel wrote:
> Hello
>
> I wrote a GUIKit-Widget which produces a graph and display this graph
> in a Widget frame. The graph was stored in the variable <cp>. Then I
> want to save this graph in a file using the save file dialog (script
> below). I can choose a name in the dialog, but the Export-function
> doesn't work. No error was displayed. Has anyone an idea, what is wrong
> with my script?
>
>
> Script[
> exportcs[] := Module[{fng},
> Widget["FileDialog", Name -> "saveFileDialog"];
> returnValue = InvokeMethod[{"saveFileDialog",
> "showSaveDialog"}, Null];
> If[returnValue === PropertyValue[{"saveFileDialog",
> "APPROVE_OPTION"}],
> PropertyValue[{PropertyValue[{"saveFileDialog",
> "selectedFile"}], "path"}], Null];
> fng = ToString[PropertyValue[{"saveFileDialog",
> "selectedFile"}], InputForm];
> Export[fng, cp, "JPEG"];
> ]
> ]
>
Hello,
GUIKit has some VERY strange features. For example, in moves variables
from Global` context (and some others) into newly created contexts. It
would also seem that if you use Script on its own inside a Widget
definition, the I/O to the notebook is disabled while it runs - so you
don't see the error message! I suspect that one or other of these
gotcha's is messing up your code - but you would need to post the whole
widget definition.
I have written a free package called the "Super Widget Package" to
provide easy access to GUIKit - available from my site.
David Bailey
http://www.dbaileyconsultancy.co.uk