MathGroup Archive 2011

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

Search the Archive

How to not show the scrollbars when ContentSize does not fit the content in Manipulate?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123787] How to not show the scrollbars when ContentSize does not fit the content in Manipulate?
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Mon, 19 Dec 2011 07:18:41 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hello,

This is for V 8.04

This is an example of what I'd like to do: Put all the
display in the control area of Manipulate itself:

(I have a reason for wanting to do this)

---------------------------------
Manipulate[

  p = Framed@
    Plot[Sin[x],{x, -y, y},ImageSize->300,
         Background-> White, ImagePadding -> 20];
    {},

  Grid[{
    {Control[{{y, N@Pi/2, "y"}, -Pi, Pi, Appearance -> "Labeled"}]},
    {Dynamic@p}
    }],

  ControlPlacement -> Left,
  Alignment -> Center,
  ImageMargins -> 1,
  FrameMargins -> 1,
  ContentSize -> {0}
  ]
---------------------------------------

The problem is that M adds a scroll bar automatically to
the top right side.

The help says

"If ContentSize specifies a content area that does not
completely fit the contents, then unless specified otherwise
with AppearanceElements, functions like Manipulate display a
resize area, as well as scrollbars when necessary."

In the above, notice it says: "unless specified otherwise with
AppearanceElements", but I was not able to find out what this means.
What does 'otherwise' is supposed to mean?

The closest I got is by adding

          AppearanceElements -> ""

to the above. So the new version now becomes

----------------------------
Manipulate[
  p = Framed@
    Plot[Sin[x], {x, -y, y}, ImageSize -> 300, Background -> White,
     ImagePadding -> 20];
  {},
  Grid[{
    {Control[{{y, N@Pi/2, "y"}, -Pi, Pi, Appearance -> "Labeled"}]},
    {Dynamic@p}
    }],

  ControlPlacement -> Left,
  Alignment -> Center,
  ImageMargins -> 1,
  FrameMargins -> 1,
  ContentSize -> {0},
  AppearanceElements -> "" (*added this *)
  ]
-----------------------------------------

But notice that the size is not quite correct to the
right still, it should be more tight, and I also lost
the '+' that used to be there. I have to keep that.

So, I think what I need is just to find what the element
name for '+' is, so I can use the correct
AppearanceElements -> "correctNameHere" and I am hoping
that this will do the right thing. (I tried "Close" but that
did not do it, I lost the '+' as well)

I just could not find what that '+' element name is.

Any one knows?

Here are the places to find more information on this:

http://reference.wolfram.com/mathematica/ref/Manipulator.html

http://reference.wolfram.com/mathematica/ref/ContentSize.html

So, the question is: How to completely remove the scroll bar
effect shown above, but at the same time keep the '+' in
the top right corner.

thank you for any hints

--Nasser




  • Prev by Date: Re: legend in a combined plot
  • Next by Date: Re: How to not show the scrollbars when ContentSize does not fit the content in Manipulate?
  • Previous by thread: RunThrough[] does not work on Windows (bug)
  • Next by thread: Re: How to not show the scrollbars when ContentSize does not fit the content in Manipulate?