Nice technique.  seems a very lightweight way to get option selection
into a class.  On the surface it sounds like the onclick should work.
what do you see in the debugger when you set a breakpoint in the
onclick?

 

Is it possible that somehow the onclick proc is being cleared?

 

Jeremy

 

From: advanced_delphi@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Alberto Narduzzi
Sent: Tuesday, November 18, 2008 5:02 AM
To: advanced_delphi@yahoogroups.com
Subject: [advanced_delphi] Event handler doesn't get called

 

Yo,

I have a weird problem...

I create dinamically a popupmenu, then dinamically add to it some 
menuitems, to each of which I assign an OnAdvancedCustomDrawItem and an 
OnClick event handler (all the items have the same...)

To be able to do so _without_any_form_ I have created a dummy class (of 
TObject) which contains the OnClick and OnAdvancedCustomDrawItem 
handlers for the TMenuItems above.

Well, the OnAdvancedCustomDrawItem procedure gets called, as I see the 
menu items displaying what I want them to, while the OnClick doesn't 
(there I set a return value according to the menuitem I clicked and this

never changes)

All the above I do inside a function; the menu and the dummy class are 
local to it, and I create, use and destroy them from within it.

Any clue?

Cheers, A.

 

Reply via email to