Message Boards Message Boards

1
|
4288 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Creating an interface that doesn't extend beyond notebook window size

Posted 12 years ago
Hi guys,

How do I create an interface layout using Panel / Pane / Grid / whatever that never extends beyond the visible notebook window on the screen?

I can better explain with pictures.  I've created a Panel with a Grid and sized my notebook window so that the entire panel is visible:

Now, I resize my notebook window and made it considerably wider.  The bottom part of the panel is no longer visible:


I'd like create the interface to expand horizontally and vertically as the notebook window is resized (horizontally and vertically), but to stop resizing vertically if it means it will get cropped.

Here's the closest I've gotten, but there are instances where the interface doesn't behave "the right way" to the bottom of the notebook window:
 Panel@
  Grid[{
    {
     Column[{
       Pane[Plot[Sin[x], {x, 1, 2 Pi}],
        ImageSize -> {Full, {Automatic,
           Dynamic@CurrentValue[EvaluationNotebook[],
               WindowSize][[2]] - 150}}
        ]
      }]
    }}
  ]


Thanks,

Igor
POSTED BY: Igor A
2 Replies
Posted 12 years ago
Not quite as the code you've shown creates all this whitespace below the plot image. I realize my question wasn't quite well posed.  I think that either:


ImageSize -> {Full, {1, Dynamic@CurrentValue[EvaluationNotebook[], WindowSize][[2]] - 150}}
or
ImageSize -> {Full, {Automatic,  Dynamic@CurrentValue[EvaluationNotebook[], WindowSize][[2]] - 150}}

does what I'm trying to do.
POSTED BY: Igor A
And this is not what you want? :
Panel@Grid[{{Column[{Pane[
Plot[Sin[x], {x, 1, 2 Pi},
PlotLabel ->
Dynamic[CurrentValue[EvaluationNotebook[],
WindowSize][[2]] - 150]],
ImageSize -> {Full,
Dynamic[CurrentValue[EvaluationNotebook[],
WindowSize][[2]] - 150]}]}]}}]
POSTED BY: Rolf Mertig
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract