# setPaneDimensions

**URL:** <https://techcommunity.softwareag.com/t/setpanedimensions/102304>\
**Category:** Forum\
**Tags:** mobile\
**Created:** [January 11, 2013, 3:23pm UTC](https://techcommunity.softwareag.com/t/setpanedimensions/102304 "2013-01-11T15:23:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Stoffel](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marco_stoffel/32/37223_2.png) [@Marco\_Stoffel](https://techcommunity.softwareag.com/u/Marco_Stoffel)\
**Post date:** [January 11, 2013, 3:23pm UTC](https://techcommunity.softwareag.com/t/setpanedimensions/102304/1 "2013-01-11T15:23:13Z")

</div>

Hi Mobile Community,

I have created a view which uses the “split screen”-Feature. When I hit the back Button in that view I like to get rid of the split screen. For that I have two functions:

```
   [b]public[/b] [b]int[/b] sidepane = 1;

   [b]public[/b] [b]int[/b] mainpane = 0;

```

public void setPaneDimensions()

```
   {

         [b]if[/b] (TABLET_LAYOUT)

         {

                [b]int[/b] sidepane_width = Math.[i]min[/i] (([i]CURRENT_SCREEN_WIDTH[/i] * 40) / 100, [i]CURRENT_SCREEN_PPI[/i] * 2);

                [b]int[/b] height = main_window.getHeight ();

                main_window.setPaneDimensions (sidepane, [b]new[/b] [b]int[/b] [] { 0, 0, sidepane_width, height });

                main_window.setPaneDimensions (mainpane, [b]new[/b] [b]int[/b] [] { sidepane_width, 0, [i]CURRENT_SCREEN_WIDTH[/i] - sidepane_width, height });

         }

   }

  

   [b]public[/b] [b]void[/b] unsetPaneDimensions()

   {

         main_window.setPaneDimensions(mainpane, [b]new[/b] [b]int[/b] [] {0, 0, [i]CURRENT_SCREEN_WIDTH[/i], [i]CURRENT_SCREEN_HEIGHT[/i] });

         main_window.setPaneDimensions(sidepane, [b]new[/b] [b]int[/b] [] {0, 0, 0, 0 });

   }

```

The first function I call to enable the split screen that part is working.

In the second function I try to make the mainpane (index 0) full screen again to use it with the common transitionToView method. But then I get an exception:

xception in thread "Thread-5" java.lang.IllegalArgumentException

```
   at com.softwareag.mobile.runtime.nui.nUIDisplayObject.setWidth( [u] nUIDisplayObject.java:145 [/u])

   at com.softwareag.mobile.runtime.nui.nUIWindowDisplay.setPaneViewDimensions( [u] nUIWindowDisplay.java:319 [/u])

   at com.softwareag.mobile.runtime.nui.nUIWindowDisplay.setPaneDimensions( [u] nUIWindowDisplay.java:291 [/u])

   at com.softwareag.mobile.iprmobile.MyCanvas.unsetPaneDimensions( [u] MyCanvas.java:84 [/u])

   at com.softwareag.mobile.iprmobile.MyCanvas.nUIEventCallback( [u] MyCanvas.java:635 [/u])

   at com.softwareag.mobile.runtime.nui.nUIController.eventListenerCallback( [u] nUIController.java:427 [/u])

   at com.softwareag.mobile.runtime.nui.nUIController.runOnce( [u] nUIController.java:188 [/u])

   at com.softwareag.mobile.runtime.core.CanvasNativeUI.fixedRateUpdate( [u] CanvasNativeUI.java:67 [/u])

   at com.softwareag.mobile.runtime.core.CanvasCore.runOnce( [u] CanvasCore.java:387 [/u])

   at com.softwareag.mobile.runtime.core.CanvasThreading.run( [u] CanvasThreading.java:92 [/u])

   at java.lang.Thread.run( [u] Thread.java:662 [/u])

```

Any idea how to get rid of panes at all? Something like removePanes()?

Thanks and have a nice weekend!

Marco

---

<div class="post-metadata">

**Author:** ![Stefan\_Veit](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@Stefan\_Veit](https://techcommunity.softwareag.com/u/Stefan_Veit)\
**Post date:** [January 11, 2013, 3:28pm UTC](https://techcommunity.softwareag.com/t/setpanedimensions/102304/2 "2013-01-11T15:28:13Z")

</div>

Hi Marco,

I guess you have to set a width for the side pane even if you don’t want to show it.

Please try something like

main\_window.setPaneDimensions(sidepane, new int {0, 0, 1, 1 });

in unsetPaneDimension method.

Regards,

Stefan Veit

---

<div class="post-metadata">

**Author:** ![Marco\_Stoffel](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marco_stoffel/32/37223_2.png) [@Marco\_Stoffel](https://techcommunity.softwareag.com/u/Marco_Stoffel)\
**Post date:** [January 11, 2013, 3:28pm UTC](https://techcommunity.softwareag.com/t/setpanedimensions/102304/3 "2013-01-11T15:28:13Z")

</div>

Thanks Stefan,

I’ve already tried that already successfully, but That would mean that the panes will overlap, right? Will there be still one pixel of that pane visible?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [January 11, 2013, 3:28pm UTC](https://techcommunity.softwareag.com/t/setpanedimensions/102304/4 "2013-01-11T15:28:13Z")

</div>

Hi Marco,

My apoIogies - I just remembered the panes need to have positive non-zero dimensions. You can set the pane off-screen though, so something like new int {-1000, 0, width, height } should work.

Regards,

Nick.

---

<div class="post-metadata">

**Author:** ![Marco\_Stoffel](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/marco_stoffel/32/37223_2.png) [@Marco\_Stoffel](https://techcommunity.softwareag.com/u/Marco_Stoffel)\
**Post date:** [January 14, 2013, 3:18pm UTC](https://techcommunity.softwareag.com/t/setpanedimensions/102304/5 "2013-01-14T15:18:41Z")

</div>

Hi Nick,

I’ve used new int {-1000, 0, 1, 1 } with phoney without any issue. Under iOS I get an Illegal Argument exception using negative values.

I’ve changed back to new int {0, 0, 1, 1 } and I cannot see any overlapping etc. at the display.

Regards

Marco

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:02pm UTC](https://techcommunity.softwareag.com/t/setpanedimensions/102304/6 "2021-04-02T15:02:52Z")

</div>


