Hello,
I’m trying to create a small bar-like window that displays some buttons and small graphs. But I want to make sure this window always follows the way Rhino’s main window moves (resizing, location change, etc).
I’ve tried subscribing to RhinoEtoApp.MainWindow.LocationChanged. But it seems like this event is not triggered when I move my Rhino window… Any ideas? Thank you!
(If following the Rhino main window is not possible, following the main viewport is another idea maybe)
The RhinoMainWindow is a bit of a dummy currently. There are tickets to hook up its events however.
You can subscribe to RhinoView.Modified
event which would tell you if the size changed, but not if the view “moved” along with the Rhino View.
I’m not aware of an API we provide which will notify you if Rhino moves, you could of course poll every second or so to see if the screen coordinate of the Rhino Main Window is different and react to this. You could of course also dive deep into the platform specific APIs if this is crucial for you.
Hi Callum,
Thank you for your response! It is very helpful to know there is progress on RhinoMainWindow handling.
I solved this problem by calling user32.dll. Since my target users are almost all Windows-based. I think this will be a quick solution. Although not perfectly: e.g. I cannot set my WPF window to transparent.
I’m looking forward to any updates on the compatibility of Rhino Interface integration!
@yiliang On Windows, you can parent your native window handle to Rhino using user32.dll
This will make sure your window follows the Rhino MainWindow, but you’d still need to subscribe to RhinoView.Modified if you want it to stay in a fixed relative position.
This shouldn’t affect transparency at all.
@CallumSykes, it would be great to have this exposed directly in Eto including a MacOs counterpart.
I’m very much in favour of this. I had a look in YouTrack and as there was no actual ticket to do this as I said, so I’ve created one.
Hi Mariusz,
Yes I indeed solved this through user32.dll SetParent. But I did experience window disappearance after setting transparency.
If it helps, the XML code controling the window is:
ResizeMode="NoResize"
AllowsTransparency="True"
Background="White"
ShowInTaskbar="False"
WindowStyle="None"
My assumption is my WPF window and its Eto parent are somewhat incompatible. But please correct me if you think differently.
Thanks!