Re: Dynamic Menus


Subject: Re: Dynamic Menus
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Sat Sep 15 2001 - 10:34:24 CDT


On Sat, 15 Sep 2001, Joaquin Cuenca Abela wrote:

> Martin wrote:
> >
> > Sorry Joaquin, I don't quite understand you. Jeff explicitly allowed for
> new
> > methods to be added to the EV_EditMethodContainer using:
> >
> > UT_Bool EV_EditMethodContainer::addEditMethod(EV_EditMethod * pem)
> > {
> > UT_ASSERT(pem);
> >
> > int error = m_vecDynamicEditMethods.addItem(pem);
> > return (error == 0);
> > }
> >
> > These can be created on the fly within AbiWord. Why not use this?
>
> That is a way to add a new EV_EditMethod to the container.
>
> The problem is not adding a new EV_EditMethod to the container, but building
> EV_EditMethods that do what we want to do (ie, call a function with the
> signature
>
> void scriptPlayFunction(const char*)
>
> Of course, without knowing at compilation time what's the const char* that
> we should pass).
>
> Show me a way to call one such function from a menu bar in the current
> framework, and you will do my day :-)
>
> (btw, one way to do that will be to expand a bit EV_Menu_Action, to take &
> store an additional string, and to pass this string in the field m_pData of
> EV_EditMethodCallData, but it seems a bit hackier to me to add a new field
> to EV_Menu_Action only due to this particular need. Comments?)
>

I don't think this is a hack. I think it is a legitimate and reasonable
expansion of the code to add this additional member variable.

By all means do it:-)

Cheers

Martin



This archive was generated by hypermail 2b25 : Sat Sep 15 2001 - 10:34:41 CDT