• MorphOS Developer
    jacadcaps
    Posts: 3018 from 2003/3/5
    From: Canada
    Your example doesn't work because you've added -(void)setMenuAction: into the Area subclass, while it gets triggered on the Window. Note that the cvsviewer example overloads MUIWindow and that's where it gets the menu action. One way out of this is to do something like:

    Code:


    MyArea *ma;
    ...
    MUIGroup *g = [MUIGroup groupWithObjects:ma = [MyArea myArea], nil];
    ...
    [w notify:@selector(menuAction) performSelector:@selector(setMenuAction:) withRawTriggerValueTarget:ma];


    Adding this notify after the closeRequest notify will bridge the two objects and make it work. The 'rawtriggervalue' sends the vanilla value that was triggered in a mui notification (not to be used for objects!) as the 1st argument of the target selector.
  • »20.12.20 - 15:34
    Profile Visit Website