On 23 Jan, Lars Clausen wrote:
> It is, very close. I have made a registry, though it is based on the
> ObjectType rather than Object, and allow the actual Object to give a
> callback which can modify the menu (to, say, set toggles to correspond to
> the settings of the object). I guess that's all in get_object_menu().
Ok, I've thought some more about this. I think i understand what you
mean now.
You've got a separate registry that maps ObjectType pointers to a
callback which is called when the menu is pulled down. It can then
modify the menu, both callbacks and active-state.
I basically like it, except i think having a separate registry is bad.
I'd rather have an new operation in ObjectOps. This saves a lot of code
(you don't need to maintain the registry) and it makes sure the
interface between objects (which are the stuff that's in a diagram) and
the app is well documented and visible. It's memory-saving too, there is
only one ObjectOps structure per ObjectType, and I've already reserved
10 pointer values in it.
/ Alex