[lazarus] Enable/CheckMenuItem

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Nov 22 13:26:32 EST 2003


On Sat, 22 Nov 2003 19:24:36 +0100  Marc Weustink <marc at dommelstein.net>
wrote:

> At 19:18 22-11-2003, Mattias Gaertner wrote:
> >On Sat, 22 Nov 2003 18:56:35 +0100  Micha Nelissen
> ><M.Nelissen at student.tue.nl> wrote:
> >
> > > Nooo...please, that's an ugly hack imho. TMenuItem's have a MenuIndex
> > > right? So why don't we pass that around? Remove the ugly Command, and
> > > use an index for positioning. Then it's easy in gtk and win32.
> >
> >"Easy" in the sense of "not very smart"  ;)
> >
> >in gtk:
> >
> >- Get LCL component of Parent Menu Handle
> >- Get i-th child menu item and its handle
> >- enable menu item
> 
> You don't have to go throug the LCL here. You can access the children of 
> the menu directly

Directly?
The above statements are O(1), while the gtk way needs O(n).

(Yes, I know, this is irrelevant. The gtk needs this time internally
anyway.)


Mattias






More information about the Lazarus mailing list