Community discussion forum

System Menu Classes

This is a comment thread discussing System Menu Classes
  • 10 years ago

    This thread is for discussions of System Menu Classes.

  • 5 years ago

    Hi,
    I have a problem with handling system menu item events.
    I have used this wrapper in a standard form.
    I have added one menuitem into a system menu and I have
    a one button in my form. When I click this button a child dialog appears
    and then is closed in standard manner. After that, the event handler for the
    menuitem doesn't work. It is not called anymore.
    But if I click this menuitem before showing a child dialog all works fine.
    I dont know, where is problem ?


    Please help.


  • 2 years ago

    Hi,

    I know this is an old post, but in case anyone else has the same problem...  I believe what is happening is that you are probably declaring the SystemMenu object in a member function and then letting it go out of scope.  The garbage collector comes up behind at an unspecified time later and destroys the object, thereby breaking the link to your callback.

     If you declare the SystemMenu object as a member variable and instantiate it in the form constructor, it should hang around until the form is destroyed.  This should fix your problem.

    Take care.

Post a reply

Enter your message below

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback