Eto Form Custom Drawable

(Dks5254) #1

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.


(Dale Fugier) #2

Hi @dks5254,

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

– Dale

(Dks5254) #3

Thanks for that link, I have had a chance to look at that, and it is definitely useful. (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.

(Dale Fugier) #4

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

(Dks5254) #5

@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?