# Component Scripting Window Default Size

**URL:** <https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548>\
**Category:** Ignition\
**Tags:** vision, ignition81, scripting\
**Created:** [January 12, 2023, 7:51pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548 "2023-01-12T19:51:30Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skylar\_Sabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/skylar_sabo/32/42622_2.png) [@Skylar\_Sabo](https://forum.inductiveautomation.com/u/Skylar_Sabo)\
**Post date:** [January 12, 2023, 7:51pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/1 "2023-01-12T19:51:30Z")

</div>

Hello Ignition Forums,

I was wondering if it's possible to change the default popup size of the component scripting window.

When I do ctrl J to quickly open a scripting window on a component my window seems to always reset back to the default size and is quite annoying to constantly be changing the size of the window to have more room / see what I am doing.

If anyone else has noticed if I move the window to far open to the right or left the left-hand side automatically collapses to be non-readable and is also annoying to open that back up constantly.

Is there any type of solution to this or have I just missed the settings for this?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58c9d5f5caf4b2de1d92d7889ba5f5d4d809efd8.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 12, 2023, 11:13pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/2 "2023-01-12T23:13:52Z")

</div>

You might try closing the designer, deleting the `.layout` file(s) in the `.ignition` directory under your user profile, then relaunching.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 13, 2023, 1:14am UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/3 "2023-01-13T01:14:14Z")

</div>

I've definitely noticed this behavior when using the designer in a windows 10 environment. When opening component scripting, the window has to be resized to make the apply button visible, and often, adjusting the window size to the point where the apply button is visible causes the folder browser to collapse to a point where the event handlers become inaccessible. To make matters worse, the collapsed browser area can't be drug open all the way without adjusting the overall window size even wider.

Here is a video that demonstrates the issue:

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a360f81bdaf19c54142abe78df02b027abdbbd7f.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a360f81bdaf19c54142abe78df02b027abdbbd7f.mp4)

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [January 13, 2023, 5:35am UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/4 "2023-01-13T05:35:42Z")

</div>

This is happening to me on regular basis...

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 13, 2023, 9:05am UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/5 "2023-01-13T09:05:02Z")

</div>

Is this a Windows scaling thing? Ive never had this issue. What are your guys' windows scaling? I always have mine at 100%

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 13, 2023, 10:39am UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/6 "2023-01-13T10:39:59Z")

</div>

I never deviate from 100% either. It causes too many problems, but I've always had that problem on at least six separate windows 10 PCs

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [January 13, 2023, 1:39pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/7 "2023-01-13T13:39:50Z")

</div>

My scaling is also always on 100%...

---

<div class="post-metadata">

**Author:** ![Skylar\_Sabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/skylar_sabo/32/42622_2.png) [@Skylar\_Sabo](https://forum.inductiveautomation.com/u/Skylar_Sabo)\
**Post date:** [January 13, 2023, 1:47pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/8 "2023-01-13T13:47:00Z")

</div>

Hi @nminchin

My windows scaling is at 100%

---

<div class="post-metadata">

**Author:** ![Skylar\_Sabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/skylar_sabo/32/42622_2.png) [@Skylar\_Sabo](https://forum.inductiveautomation.com/u/Skylar_Sabo)\
**Post date:** [January 13, 2023, 1:47pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/9 "2023-01-13T13:47:59Z")

</div>

This demonstrates exactly what I am talking about, I am going to attempt what @paul-griffith suggested but this is a good video show casing what I am explaining.

---

<div class="post-metadata">

**Author:** ![Skylar\_Sabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/skylar_sabo/32/42622_2.png) [@Skylar\_Sabo](https://forum.inductiveautomation.com/u/Skylar_Sabo)\
**Post date:** [January 13, 2023, 1:54pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/10 "2023-01-13T13:54:48Z")

</div>

Good morning @paul-griffith,

I removed all the. layout files from my user profiles .ignition directory and the problem persists. Exactly how @justinedwards.jle depicted in the video he showcases.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/89410f43988bfdda6ee39d3993fa748538a0e00d.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 13, 2023, 4:30pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/11 "2023-01-13T16:30:13Z")

</div>

Interesting. No other windows have similar behavior, just component scripting in Vision?  
You said Windows 10 and 100% scaling - do you have multiple monitors, or just one? What's your exact screen resolution? We can try to replicate in house.

---

<div class="post-metadata">

**Author:** ![Skylar\_Sabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/skylar_sabo/32/42622_2.png) [@Skylar\_Sabo](https://forum.inductiveautomation.com/u/Skylar_Sabo)\
**Post date:** [January 13, 2023, 4:37pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/12 "2023-01-13T16:37:47Z")

</div>

Yes Windows 10 and 100% scaling, I have 2 monitors as well, screen resolution is 1920x1080 for both. I have not tested every window with any sort of methodology but assume there's others that do this.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 13, 2023, 5:05pm UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/13 "2023-01-13T17:05:46Z")

</div>

It happens for us in single monitor and multimonitor systems. I have a vm system as well that also exhibits this behavior. I've gotten so used to it that the resizing act has become reflexive. I hardly notice the problem anymore, but it's always there.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 9, 2024, 4:07am UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/14 "2024-06-09T04:07:26Z")

</div>

I was annoyed by this problem again today, so I decided to poke at it a little bit. The cause of the problem is the minimum size parameter of the right `jPanel` in the main `JSplitPane` of the component script editor. The minimum width is more than 1100 pixels, and since the `JPanel` can't shrink below that, it pushes the buttons out of view, and at a certain point as the window is being widened, it pushes the `SynthSplitPaneDivider` between the left and right JPanels all the way to the left and traps it there.  
 ![Presentation](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/7842ce304b66bc1194667d547994a8f282ed9ec5.gif)

Until IA corrects it, this can be fixed from the script console using this script:

```python
from java.awt import Window, Dimension
for window in Window.getWindows():
	if window. __class__. __name__ == 'ComponentScriptEditor':
		def fixSplitPane(window):
			for component in window.components:
				if component. __class__. __name__ == 'JSplitPane':
					component.rightComponent.minimumSize = Dimension(0,0)
				else:
					fixSplitPane(component)
		fixSplitPane(window)

```

The script just finds the JSplitPanes and sets their right JPanel's minimum size to zero.

**Result:**  
 ![Presentation1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/0/d08a73deae52985fcb642a975cc62042c21e8ec1.gif)

**UPDATE:**

> [@Skylar\_Sabo](#):
>
> possible to change the default popup size of the component scripting window

I developed this script a little further, so it meets the requirement of the OP's original question:

```python
# RUN ONLY ONCE DURING A DESIGNER SESSION
# ...prior to opening any script editors
from java.awt import Toolkit, AWTEvent, Dimension
from java.awt.event import AWTEventListener

class WindowMonitor(AWTEventListener):
	def eventDispatched(self, event):
		if event. __class__. __name__ == 'WindowEvent' and event.ID == event.WINDOW_OPENED: 
			window = event.window
			if window. __class__. __name__ == 'ComponentScriptEditor': 
				# Fix the split pane divider and button off screen bug
				# ...by setting the right JPanel's minimum size to 0
				splitPane = self.getSplitPane(window)
				splitPane.rightComponent.minimumSize = Dimension(0,0)
				
				# Specify a desired default window size and apply it
				windowSize = Dimension(1000, 600)
				window.preferredSize = windowSize
				window.size = windowSize
	
	# Recursively findes the highest level split pane within a given window
	def getSplitPane(self, window):
		for component in window.components:
			if component. __class__. __name__ == 'JSplitPane': 
				return component
			elif self.getSplitPane(component):
				return self.getSplitPane(component) 
			
# added logic to prevent multiple of the same listener from being inadvertently added
toolkit = Toolkit.getDefaultToolkit()
for proxy in toolkit.AWTEventListeners:
	if proxy.listener. __class__. __name__ == 'WindowMonitor':
		toolkit.removeAWTEventListener(proxy.listener)
toolkit.addAWTEventListener(WindowMonitor(), AWTEvent.WINDOW_EVENT_MASK)

```

Run this script at the beginning of a designer session, and for the duration of that session, the split plane right panel issue will be automatically fixed any time a component scripting editor is opened, and the size of the scripting window will be automatically set to whatever dimension is specified.

**Edit:** Added logic that eliminates the possibility of inadvertently adding more than one of the same listener.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [June 13, 2024, 6:06am UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/15 "2024-06-13T06:06:58Z")

</div>

That's some serious 'hacking'... 🧐

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [June 13, 2024, 6:49am UTC](https://forum.inductiveautomation.com/t/component-scripting-window-default-size/68548/16 "2024-06-13T06:49:45Z")

</div>

If anybody is interested, I've also developed a way to apply this script automatically when the designer is opened, so there is no need to ever run the script from the script console.

To do this, simply package the code into a library script, and call it from a Vision client tag using the value changed event. For the client tag, I'm using the data type `DateTime` with the expression `now(0)`. Since the polling rate is set to zero, the expression changes the value only once when the designer is first opened triggering the value changed event to apply the changes at that time.

**Example:**

```python
#def valueChanged(tag, [...], missedEvents):
	# If this is the first event after initial subscription and if the event is in the designer environment,
	# ...patch the designer bug
	if initialChange and system.tag.readBlocking(['[System]Client/System/SystemFlags'])[0].value < 4:
		libraryScripts.setEditorPreferences()

```

Additionally, I'm now minimizing the property pane at the bottom of the editor, and I'm setting the default tab to the script editor tab instead of the navigation tab.

> **Here is an updated version of the library script**
>
> ```python
> from java.awt import Toolkit, AWTEvent, Dimension
> from java.awt.event import AWTEventListener
> def setEditorPreferences(width = 1000, height = 600):
> '''
> • This function only works for the duration of the session it was called from [designer scope]
> • Fixes bug that pushes the ok, apply, and cancel buttons off the comppnent editor window in the designer
> • Sets the default size of the window to 1000 x 600, or the dimensions can be passed in when the function is called
> '''
> # RUN ONLY ONCE DURING A DESIGNER SESSION
> # ...prior to opening any script editors
> class WindowMonitor(AWTEventListener):
> def eventDispatched(self, event):
> if event. __class__. __name__ == 'WindowEvent' and event.ID == event.WINDOW_OPENED: 
> window = event.window
> if window. __class__. __name__ == 'ComponentScriptEditor': 
> # Fix the split pane divider and button off screen bug
> # ...by setting the right JPanel's minimum size to 0
> splitPane = self.getSplitPane(window)
> splitPane.rightComponent.minimumSize = Dimension(0,0)
> 					
> # Change the default tab from navigation to the script editor
> self.getTabbedPane(splitPane.rightComponent).selectedIndex = 4
> 					
> # Minimize the documentation pane at the bottom of the editor
> self.minimizeDocPane(window)
> 					
> # Specify a desired default window size and apply it
> windowSize = Dimension(width, height)
> window.preferredSize = windowSize
> window.size = windowSize
> 	    
> # Recursively finds the highest level split pane within a given window
> def getSplitPane(self, window):
> for component in window.components:
> if component. __class__. __name__ == 'JSplitPane': 
> return component
> else:
> splitPane = self.getSplitPane(component)
> if splitPane:
> return self.getSplitPane(component) 
> 		
> # Locates the minimize button for the documentation pane, and fires its click logic
> def minimizeDocPane(self, window):
> for component in window.components:
> 			
> # There are three SynthSplitPaneDivider in a component editor,
> # ...but the documentation pane's is the only one is horizontal [wider that it is tall]
> if component. __class__. __name__ == 'SynthSplitPaneDivider' and component.width > component.height:
> rightButton = component.components[1] # The SynthSplitPaneDivider only contains two sub components: a left and right button
> rightButton.doClick()
> break
> else:
> self.minimizeDocPane(component)
> 		
> # Finds the tabbed pane and returns it
> def getTabbedPane(self, jpanel):
> for component in jpanel.components:
> if component. __class__. __name__ == 'JTabbedPane':
> return component
> else:
> tabbedPane = self.getTabbedPane(component)
> if tabbedPane:
> return tabbedPane
> 
> # added logic to prevent multiple of the same listener from being inadvertently added
> toolkit = Toolkit.getDefaultToolkit()
> for proxy in toolkit.AWTEventListeners:
> if proxy.listener. __class__. __name__ == 'WindowMonitor':
> toolkit.removeAWTEventListener(proxy.listener)
> toolkit.addAWTEventListener(WindowMonitor(), AWTEvent.WINDOW_EVENT_MASK)
> 
> ```

This has become a fun rabbit hole to explore because it opens the possibility of saving other user preferences that are currently not remembered by the designer such as column widths on the tag browser _[which I've also already created a script for]_. By adding parameters to the library scripts, these changes can be made user specific, and I can imagine using things like `event.ID == event.WINDOW_CLOSED` to save last used properties for the next use.
