MathGroup Archive 2011

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

Search the Archive

GUIKit Buttons

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115528] GUIKit Buttons
  • From: ulla <uzabik at yahoo.de>
  • Date: Thu, 13 Jan 2011 03:29:40 -0500 (EST)

Hi,
My question is about using GUIKit.

I get correct result from Example 1,


Example 1):

Needs["GUIKit`"];
GUIRun[Widget["ImageLabel",
  {
   "data" -> Script[SetDirectory["Q:\\fruits"];
     files = FileNames["apfel*.tif"];
     ims = Import[#] & /@ files;
     ExportString[GraphicsRow[ims], "PNG"]],
   },

  Name -> "imgDisplay"]]


How to change my Example 2,
to have a correct result
when clicking on buttons "apfel" or "birne"



Example 2):

Needs["GUIKit`"];
Klick = GUIRun[
  Widget["Panel",
   {Widget["Button", {"text" -> "apfel", BindEvent["Action", p[]]},
     Name -> "button1"],
    Widget["Button", {"text" -> "birne", BindEvent["Action", p[]]},
     Name -> "button2"],
    Widget["ImageLabel", Name -> "imgShow"],

    p[] := Script[
      SetPropertyValue[{"imgShow", "data"},
       Script[
        SetDirectory["Q:\\fruits"];
        If[PropertyValue["button1"] == "apfel",
         files = FileNames["apfel*.tif"]];
        If[PropertyValue["button2"] == "birne",
         files = FileNames["birne*.tif"]];
        ims = Import[#] & /@ files;
        ExportString[GraphicsRow[ims], "PNG"]]]]

    }]]



Any suggestions would be greatly appreciated!

ulenia


  • Prev by Date: Re: CUDADot[] does not work with rectangular matrices
  • Next by Date: Re: Curl and Div problems
  • Previous by thread: Replacing result with earlier variable definition
  • Next by thread: Caution on BibTex references with Mathematica