@ccc , sorry for not being clear. It goes into the pyui file. Screenshot, below. Sorry, I left it full screen so it's clear to others also.
Edit: oops, that is creating a dynamic attr in pic. But it's the same place / same idea.
The eval is called on the CustomAtrributes, in the ui.py function _view_from_dict
Sorry a few edits: I rushed this. But the self.sayhello(1,2) evals() to calling a method of that name in our class. You can leave off the self and call a function, but I think from memory you have to return True, otherwise warnings are printed.
This seems very close to what the action method does , when it's defined inside the pyui file.
@Phuket2 I don't have much to add other than what JonB has said... just classing it.
But I really understand what you mean - to have easier ways to accomplish something so simple. Such as:
a = ui.Path.oval(fill_color=red, frame=(0,0,100,100), stroke=1, stroke_color=green, opacity=0.5)
I think that what you're after are similar things that we find in SVG graphic design. For me the ui.Path doesn't seem so different than this... it's just that you have to code in a lot of stuff to get it going. But it seems that there's just certain things in the UI that require this step by step. I also kind of want to try classing just to see.