MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: GUIKit tool to select frames

  • To: mathgroup at
  • Subject: [mg73632] Re: GUIKit tool to select frames
  • From: David Bailey <dave at>
  • Date: Fri, 23 Feb 2007 04:41:22 -0500 (EST)
  • References: <erem2v$7q4$>

Guy lamouche wrote:
> Hi, below is a very naive attempt at using the GUIKit to plot a selected 
> frame of an ensemble of frames.
> The variable Global`data in plotDialog[] is a Matrix containing 100 
> frames of 250 x 250 (Real numbers), it is obviously defined outside 
> plotDialog[].
> PlotDialog opens a window, display a frame selected by the slider. This 
> was built by modifying the plotgroupdialog and slider in the GUIKit 
> examples. The code looks horribly formatted below, but it looks a very 
> little bit better when pasted in Mathematica.
> Question: It is very slow with my 100X250X250 matrice when changing the 
> display from one frame to another, can someone effective un GUIKit 
> programming suggest a change that would make it more responsive?
> Thanks in advance.
> Guy Lamouche
> plotDialog=[] := GUIRunModal[Widget["Panel", 
>     WidgetGroup[{Widget["MathPanel", {"preferredSize" -> Widget
> ["Dimension", {"width" -> 150, "height" -> 150}], 
>         "usesFE" -> True}, WidgetLayout -> {"Stretching" -> {Maximize, 
> Maximize}}, Name -> "canvas"], 
>       WidgetGroup[{Widget["TextField", {"text" -> "", "columns" -> 3, 
> "editable" -> False}, Name -> "textField"], 
>         Widget["Slider", {BindEvent["change", Script[SetPropertyValue
> [{"textField", "text"}, 
>              ToString[PropertyValue[{"slider", "value"}], InputForm]]]], 
> BindEvent["change", 
>            Script[updatePlot[]]]}, Name -> "slider"]}, WidgetLayout -> 
> Row], BindEvent["componentResized", 
>        Script[updatePlot[]]], BindEvent["endModal", Script[Show[expr]]], 
>       Script[updatePlot[] := Block[{slid, $DisplayFunction = Identity}, 
>           slid = ToExpression[PropertyValue[{"slider", value}]]; expr = 
> Show[ArrayPlot[data[[slid,All,All]]], 
>              PlotRange -> All]; SetPropertyValue[{"canvas", 
> "mathCommand"}, ToString[expr, InputForm]]; 
>            InvokeMethod[{"canvas", "repaintNow"}]; ]; updatePlot[]]}, 
> WidgetLayout -> Column], 
>     WidgetLayout -> {"Stretching" -> {True, True}}], 
> IncludedScriptContexts -> {$Context}]


If you go to my site you will see a free package called the Super Widget 
Package. Currently, this uses GUIKit to provide a really simple 
interface to create GUI's. I am currently working on another version 
(4.00) that will have the same interface but work directly in J/Link to 
provide better speed and other enhancements.

You could start with a SuperWidgetGraphicsPanel and update this as 
required, but if that is too slow, there may be other possibilities.

If you are interested, my email address can be found at the top of the 
home page - but as part of an image (to try to protect it from spam). 
Send me an email if you are interested, but for non-trivial help you 
will have to buy consultancy.

David Bailey

  • Prev by Date: Re: NonLinearRegression Weights
  • Next by Date: Re: record intermediate steps
  • Previous by thread: GUIKit tool to select frames
  • Next by thread: Limit of Error function Erf