Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

GUIKit and VisibleRect

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52549] GUIKit and VisibleRect
  • From: pdickof at scf.sk.ca (Peter Dickof)
  • Date: Wed, 1 Dec 2004 05:58:51 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

The following draws a little plot and shows the associated visible
rectangle:

ref = GUIRun[
      Widget["Frame",
        {Widget["ImageLabel",
            {"data" -> Script[ExportString[ 
                    Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}, 
                      DisplayFunction -> Identity],
                     "GIF",  
                    ImageSize -> 300,
                    ConversionOptions -> {"Transparency" ->
GrayLevel[1]}]]
              }, Name -> "myImageLabel"]}, Name -> "myFrame"]];
(ref@PropertyValue[{"myImageLabel", "VisibleRect"}])@toString[]
(ref@PropertyValue[{"myImageLabel", "Bounds"}])@toString[]

The following resizes the frame and puts a bigger image into it. The
visible rectangle is not updated. It is also not writable.

ref @ Script[
    newData = ExportString[
         Plot3D[Sin[2x y], {x, 0, Pi}, {y, 0, Pi}, 
          DisplayFunction -> Identity],
        "GIF",  
        ImageSize -> 500,
        ConversionOptions -> {"Transparency" -> GrayLevel[1]}];
    SetPropertyValue[{"myImageLabel", "data"}, newData];
    SetPropertyValue[{"myFrame", "Size"}, Widget["Dimension",
        {"width" -> 600, "height" -> 500}]];
    ]
(ref@PropertyValue[{"myImageLabel", "VisibleRect"}])@toString[]
(ref@PropertyValue[{"myImageLabel", "Bounds"}])@toString[]

A mouse resize will fix this. How do I do that with a program?

Thanks for your help.

Peter Dickof


  • Prev by Date: Re: How to solve nonlinear equations?
  • Next by Date: ReplacePart position
  • Previous by thread: Re: Re: Re: Re: How to solve nonlinear equations?
  • Next by thread: Re: GUIKit and VisibleRect