www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - gtkD MenuItem addOnActivate

reply Steve Teale <steve.teale britseyeview.com> writes:
Can anyone who knows about gtkD tell me what is the intention of the MenuItem
argument to the delegate passed as the first argument to this method.

I was hoping that this was to allow the transfer of some userdata to the
handler, but I don't see any such provision for adding userdata in the
MenuItem class.

I have Googled on this topic at some length, but not found any clue. Of
course, I could be asking the wrong questions.

Thanks
Steve
Jul 24 2011
parent Mike Wey <mike-wey example.com> writes:
On 07/24/2011 06:32 PM, Steve Teale wrote:
 Can anyone who knows about gtkD tell me what is the intention of the MenuItem
 argument to the delegate passed as the first argument to this method.

 I was hoping that this was to allow the transfer of some userdata to the
 handler, but I don't see any such provision for adding userdata in the
 MenuItem class.

 I have Googled on this topic at some length, but not found any clue. Of
 course, I could be asking the wrong questions.

 Thanks
 Steve
The MenuItem in the delegate is the MenuItem that has received the signal. To add some userdata you can do one of two things: 1. Use setData and getData to set and retrieve the data these only accept pointers though. 2. â‚¢eating a derived class that includes the userdata should also work. -- Mike Wey
Jul 24 2011