ETO: How To Remove Top Left Icon?

Hi all,

With the current Grasshopper Remote Control Panel situation being what it is, I’m dipping my toe into ETO as a potential framework for making my Grasshopper GUIs. Anywho, first question: How does one remove this top left window icon on Windows:

For instance, using this example code:

I assume one has to set this property somehow (e.g. adding dialog.Icon = None does nothing).

Best,

Anders

Using dialog.WindowStyle = Eto.Forms.WindowStyle.Utility does the trick as a workaround. But it would be nice to keep the default window style (i.e. as the close button becomes the red X style ala the GhPython script editor). I’ll report back if I find a solution.

Here’s a first stab at making an ETO RCP using basic procedural GhPython (i.e. no SDK mode events, no Persistent variables, no bi-directionality etc.), but certainly a simple/native/dependency free approach:


260910_BasicETO_RCP_00.gh (8.1 KB - Rhino 9 Beta)

Maybe @CallumSykes or @curtisw knows?

Hi @AndersDeleuran,

Window.Icon won’t get you there. On Windows an Eto window is a WPF Window, and Eto just forwards the property along — so dialog.Icon = None ends up setting WPF’s Window.Icon to null. WPF reads that as “no icon specified” and falls back to the process icon, which is Rhino’s. There is no managed WPF API that means “no icon at all”, and Eto doesn’t wrap the Win32 way of saying it.

WindowStyle.Utility works because it sets WS_EX_TOOLWINDOW — which is also exactly why the close button shrinks. Those two come as a pair, so there’s no way to keep one and drop the other.

To lose the icon and keep a normal title bar, you have to drop to Win32: turn on WS_EX_DLGMODALFRAME, clear both icons with WM_SETICON, then force a frame recalc. Let me know if you want to see the gory details.

– Dale

Haha, I think I’ll pass for now, but I do appreciate the offer :slight_smile:

Having dabbled a bit more today, I think using WindowStyle.None with MovableByWindowBackground = True is appropriate for the kind if minimal style RCP I was hoping to script (e.g. that would replace the RCP here and go well with the heads-up-display design I’m using there):

Thanks again. Eto seems really fun and useful so far!

Is it possible with this to make up for the shortcomings of RCP, such as include Value List? Or is it still painful because of recalculation and stuff?

Edit: Oh I just realized the example is showing Value List working :sweat_smile:

I thought this would be more complicated, wonder why we don’t have it in RCP :melting_face: