Value listener for window position

I have divided data in two windows, I would like to move them together on the screen. Therefore I need to know position of one of the window so that can I move the other one together with it. Can I get the current position of a window?

Hello
It is not possible to listen window position, instead you can pack Ui elements into some container like Expander.

Rhino_2017-12-16_13-36-25

thx. can I have this definition?

Definition: hui_exander.gh (12.5 KB)

2 Likes

Thanks, I think it does not work for me, because I have organized my windows next to each other side by side, and not above each others like how Expander behave… :frowning:

Can you upload a screenshot with your windows?

Here we go.

This definition organizes Ui elements in the stack panels, in addition it has the ability to hide or show individual panels.

Definition: hui_horizontalpack.gh (16.8 KB)

1 Like

wow, looks great. thanks.
I am going to apply to my situation.

There is also a Tabbed View container, but you can only display one tab at a time.
Regards

1 Like

Great thank you. I have asked another problem here but I got no answer for this. Maybe you can help me with this too.
I have several HUMAN UI windows in my definition. I am using a small window with a checkbox list to control which window is visible. It would be nice to be able to restore the last arrangement and status when I open the grasshopper file again.

I can do something about it, I need some time, maybe tomorrow :slight_smile:

You can control whether a window is visible or hidden as well as its position with the launch window toggle and the Window Properties component, respectively. However, there is currently no listener for the position of a window if it’s been moved around.


windows_possave.gh (13.7 KB)

Hello, I have a solution to this problem, this definition saves the position of windows to a file
and when the Grasshopper file is opened, it restores the window state. That was it?
Regards

1 Like

Thanks a lot. It looks like the one however, I could not try it.
It asks for PresantationFramework.dll, which I dont have.

PresentationFramework.dll is part of WPF, it comes with Windows.

These assemblies is located in: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5
Four files are needed:

PresentationFramework.dll
PresentationCore.dll
System.Xaml.dll
WindowsBase.dll

Grasshopper ask for the files when open definition, you must select correct path for files.