Eto Form Custom Drawable

I am trying to make a custom drawable control with python eto. However, when I call the function “SupportsCreateGraphics” it returns falls, and of course calling the CreateGraphics() function also fails. Is this just because I am using python?

All I am trying to do is create a control that is essentially a clickable button with a custom drawn background (some different colored curves). Maybe I am doing this the hard way? Any help or suggestions are super appreciated.

d39380a09b370895bf9ec004ddb6426f

Hi @dks5254,

Can you provide your non-working source? Also, you might review this sample.

– Dale

Thanks for that link, I have had a chance to look at that, and it is definitely useful.
ETO_DrawTest.py (4.3 KB)
Here is the non-working source. It simply says “specified method not supported” once it gets to line 12.

I also have noticed that it is possible to use a button with a custom bitmap, which might be the simple solution to my problem after all, since I wouldn’t need to use a custom drawable. However, its still useful for the future for me to try to understand how to make a custom drawable control.

Hi @dks5254,

Eto on Rhino for Windows uses WPF. The Drawable.CreateGraphics method is not supported on WPF. This is because WPF uses DirectX, not GDI.

– Dale

@dale Thank you for the reply, I guess that leads me to the question of whether or not I could find any examples on how to do this with python?