MathGroup Archive 2011

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123789] Re: 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:19:23 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

On 12/18/2011 10:35 PM, Nasser M. Abbasi wrote:
> 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
>


fyi, an update:

Someone was kind enough to reply to my question on another
Mathematica forum,  which is to use

     AppearanceElements -> "ManipulateMenu"

And this did the trick. But there remain a tiny white line at
the top right edge. Not sure what to do with that. This is
on windows 7, using V 8.04. Here is the final code:

-----------------------
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}}],
  AppearanceElements -> "ManipulateMenu", ControlPlacement -> Left,
  Alignment -> Center, ImageMargins -> 1, FrameMargins -> 1,
  ContentSize -> {0}]
-------------------------

And the above does what I wanted.

--Nasser



  • Prev by Date: Re: How to not show the scrollbars when ContentSize does not fit the content in Manipulate?
  • Next by Date: Re: Transparent ContourPlot
  • Previous by thread: Re: How to not show the scrollbars when ContentSize does not fit the content in Manipulate?
  • Next by thread: import issue