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

**URL:** <https://community.wolfram.com/t/creating-an-interface-that-doesnt-extend-beyond-notebook-window-size/137>\
**Category:** Questions\
**Tags:** mathematica, interface-construction, ui-ux-and-ide\
**Created:** [January 22, 2013, 3:34pm UTC](https://community.wolfram.com/t/creating-an-interface-that-doesnt-extend-beyond-notebook-window-size/137 "2013-01-22T15:34:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![igora](https://avatars.discourse-cdn.com/v4/letter/i/ccd318/32.png) [@igora](https://community.wolfram.com/u/igora)\
**Post date:** [January 22, 2013, 3:34pm UTC](https://community.wolfram.com/t/creating-an-interface-that-doesnt-extend-beyond-notebook-window-size/137/1 "2013-01-22T15:34:00Z")

</div>

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:

```auto
Panel@
 Grid[{
   {
    Column[{
      Pane[Plot[Sin[x], {x, 1, 2 Pi}],
       ImageSize -> {Full, {Automatic, 
          Dynamic@CurrentValue[EvaluationNotebook[], 
              WindowSize][[2]] - 150}}
       ]
      }]
    }}
  ]

```

Thanks,

Igor

---

<div class="post-metadata">

**Author:** ![rolfm](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/rolfm/32/35274_2.png) [@rolfm](https://community.wolfram.com/u/rolfm)\
**Post date:** [January 23, 2013, 12:57am UTC](https://community.wolfram.com/t/creating-an-interface-that-doesnt-extend-beyond-notebook-window-size/137/2 "2013-01-23T00:57:44Z")

</div>

And this is not what you want? :

```auto
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]}]}]}}]

```

---

<div class="post-metadata">

**Author:** ![igora](https://avatars.discourse-cdn.com/v4/letter/i/ccd318/32.png) [@igora](https://community.wolfram.com/u/igora)\
**Post date:** [January 25, 2013, 2:52pm UTC](https://community.wolfram.com/t/creating-an-interface-that-doesnt-extend-beyond-notebook-window-size/137/3 "2013-01-25T14:52:11Z")

</div>

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:

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

```

or

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

```

does what I’m trying to do.
