Skip to content

MenuBar in a SubForm #88

@cursork

Description

@cursork

MenuBar is listed as having both Form and SubForm as parents in the documentation. It works inside a SubForm when EWC is run in Browser mode, but not in Desktop mode. It does work in Browser mode for EWC, and both of these render very similarly:

  EWC.Init'Browser'

  'F'eWC'Form'
  'F.MB'eWC'MenuBar'
  'F.MB.X'eWC'Menu' 'xyz'
  'F.MB.X.Y'eWC'MenuItem' 'yyy'

  'F'eWC'Form'
  'F.SF'eWC'SubForm'
  'F.SF.MB'eWC'MenuBar'
  'F.SF.MB.X'eWC'Menu' 'xyz'
  'F.SF.MB.X.Y'eWC'MenuItem' 'yyy'

Trying with EWC.Init'Desktop' and a subform, the expression 'F.SF.MB'eWC'MenuBar' from above fails:

  ⍎VALUE ERROR: Undefined name: HR
  ∆WC[103] F.SF.HR
                ∧

Note that the first example above works in ⎕WC when the menu is on the form, but silently fails without error when the menu is on the subform:

  'F'⎕WC'Form'
  'F.SF'⎕WC'SubForm'
  'F.SF.MB'⎕WC'MenuBar'
  'F.SF.MB.X'⎕WC'Menu' 'A menu'
  'F.SF.MB.X.A'⎕WC'MenuItem' 'aaa'

The ⎕WC docs say that both Form and SubForm may be parents to MenuBar, but given that we do not currently have example applications using this and that it seems a basic example doesn't succeed in ⎕WC, I think we should improve the error case for adding a menubar to a subform.

Non-urgent, as I haven't seen this used in any potential production code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions