Main Window Option¶

By default, when using the Qt backend, magicgui’s window is a plain QWidget, not a QMainWindow subclass. This allows the GUI to be easily integrated into other Qt applications, but it also means that the window lacks a few features such as the top app menu.

To enable that top app menu you should use the main_window flag when decorating your main function:

from magicgui import magicgui

@magicgui(main_window=True)
def add(num1: int, num2: int) -> int:
"""
Adds the given two numbers, returning the result.

The function assumes that the two numbers can be added and does
not perform any prior checks.

Parameters
----------
num1 , num2 : int

Returns
-------
int
Resulting integer

Examples
--------