Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b19e898
wip
tlambert03 Oct 9, 2023
a2244de
update ipywidgets implementation
tlambert03 Oct 9, 2023
bad9c5e
fix hints
tlambert03 Oct 9, 2023
5f75b46
add test
tlambert03 Oct 9, 2023
804da76
feat: support button icons
tlambert03 Oct 9, 2023
c991ce0
adding iconbtn
tlambert03 Oct 10, 2023
b3a29ec
match color to palette in qt
tlambert03 Oct 10, 2023
d48b10d
update ipywidgets
tlambert03 Oct 10, 2023
a665276
bump superqt
tlambert03 Oct 10, 2023
2c1a201
add pytest-pretty
tlambert03 Oct 10, 2023
5d1b227
test: add tests
tlambert03 Oct 10, 2023
1b907d1
fix icon
tlambert03 Oct 10, 2023
6933b32
extract logic, fix 3.8
tlambert03 Oct 10, 2023
721a0b9
Merge branch 'icons' into toolbars
tlambert03 Oct 10, 2023
d27c283
update color
tlambert03 Oct 10, 2023
62daa67
change with palette
tlambert03 Oct 10, 2023
1e89504
Merge branch 'main' into toolbars
tlambert03 Oct 11, 2023
7f39313
unions
tlambert03 Oct 11, 2023
ff3b001
wip
tlambert03 Oct 18, 2023
9385303
Merge remote-tracking branch 'origin/toolbars' into main-window
tlambert03 Oct 18, 2023
8242141
wpi
tlambert03 Oct 19, 2023
db0e68f
adding menus
tlambert03 Oct 20, 2023
c48e9d0
Merge branch 'main' into main-window
tlambert03 Oct 20, 2023
db81067
style(pre-commit.ci): auto fixes [...]
pre-commit-ci[bot] Oct 20, 2023
b100bda
extend menu
tlambert03 Oct 20, 2023
3b9f785
Merge branch 'main-window' of https://github.com/tlambert03/magicgui …
tlambert03 Oct 20, 2023
025323d
menu stuff
tlambert03 Oct 20, 2023
b2584d9
style(pre-commit.ci): auto fixes [...]
pre-commit-ci[bot] Oct 20, 2023
5704bee
update menus
tlambert03 Oct 20, 2023
fd0a329
Merge branch 'main-window' of https://github.com/tlambert03/magicgui …
tlambert03 Oct 20, 2023
277e76e
Merge branch 'main' into main-window
tlambert03 Oct 20, 2023
f984046
fix main window sizing
tlambert03 Oct 22, 2023
e88d3c0
fix test
tlambert03 Oct 22, 2023
c8d4c5b
style(pre-commit.ci): auto fixes [...]
pre-commit-ci[bot] Oct 22, 2023
5654b56
Merge branch 'main' into main-window
tlambert03 Oct 22, 2023
7dd4da8
Merge branch 'main-window' of https://github.com/tlambert03/magicgui …
tlambert03 Oct 22, 2023
917196a
fix py38
tlambert03 Oct 22, 2023
706004f
starting on ipywidgets
tlambert03 Oct 22, 2023
dc008d6
update example
tlambert03 Oct 22, 2023
e1a68e4
add central
tlambert03 Oct 24, 2023
300c79a
Merge branch 'main' into main-window
tlambert03 Oct 24, 2023
511a174
Merge branch 'main-window' of https://github.com/tlambert03/magicgui …
tlambert03 Oct 24, 2023
778c0ea
style(pre-commit.ci): auto fixes [...]
pre-commit-ci[bot] Oct 24, 2023
f980a90
Merge branch 'main' into main-window
larsoner Aug 24, 2026
5cfe28f
fix: Container/Dialog orientation reported as 'vertical' regardless o…
larsoner Aug 24, 2026
2e543c9
feat: working ipynb MainWindow, StatusBar, and Dropdown-based menus
larsoner Aug 24, 2026
f68feb3
test: cover MainWindow dock/toolbar/status-bar/menu APIs on both back…
larsoner Aug 24, 2026
d06db48
docs: move main-window demo from repo root into the examples gallery
larsoner Aug 24, 2026
44c2db8
style: ruff fixes
larsoner Aug 24, 2026
557d3e6
revert: leave the default backend as 'qt' (no jupyter auto-detection)
larsoner Aug 24, 2026
03b7eba
fix: place main-window grid boxes in their own cells
larsoner Aug 24, 2026
ccda75e
fix: stretch ipynb toolbars across their bar area so spacers expand
larsoner Aug 24, 2026
846a9c8
test: run main-window tests after test_widgets to avoid Windows crash
larsoner Aug 24, 2026
f5f8234
Merge branch 'main' into main-window-604
tlambert03 Aug 26, 2026
6f874e3
Merge remote-tracking branch 'upstream/main' into main-window-604
larsoner Aug 26, 2026
2c70182
style(pre-commit.ci): auto fixes [...]
pre-commit-ci[bot] Aug 26, 2026
b7184c6
FIX: Test order shouldnt matter
larsoner Aug 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/examples/applications/main_window.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""# Main window

Use `MainWindow` to build an application shell with a menu bar, tool bars,
dock widgets, and a status bar around a central widget area.
"""

from magicgui import widgets

main = widgets.MainWindow()

# toolbar
toolbar = widgets.ToolBar()
toolbar.add_button(text="Folder", icon="mdi:folder")
toolbar.add_spacer()
toolbar.add_button(text="Edit", icon="mdi:square-edit-outline")
main.add_tool_bar(toolbar, area="top")

# status bar
main.status_bar.set_message("Hello Status!", timeout=5000)

# dock widgets
main.add_dock_widget(widgets.PushButton(text="Push me."), area="right")

# menus
file_menu = main.menu_bar.add_menu("File")
assert file_menu is main.menu_bar["File"] # can also access like this
file_menu.add_action("Open", callback=lambda: print("Open"))
submenu = file_menu.add_menu("Submenu")
submenu.add_action("Subaction", callback=lambda: print("Subaction"))
submenu.add_separator()
submenu.add_action("Subaction2", callback=lambda: print("Subaction2"))

# central widget
main.append(widgets.Label(value="Central widget"))

main.height = 400

if __name__ == "__main__":
main.show(run=True)
8 changes: 8 additions & 0 deletions src/magicgui/backends/_ipynb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
Label,
LineEdit,
LiteralEvalLineEdit,
MainWindow,
Menu,
MenuBar,
Password,
ProgressBar,
PushButton,
Expand All @@ -21,6 +24,7 @@
Select,
Slider,
SpinBox,
StatusBar,
TextEdit,
TimeEdit,
ToolBar,
Expand All @@ -44,6 +48,9 @@
"Label",
"LineEdit",
"LiteralEvalLineEdit",
"MainWindow",
"Menu",
"MenuBar",
"Password",
"ProgressBar",
"PushButton",
Expand All @@ -53,6 +60,7 @@
"Select",
"Slider",
"SpinBox",
"StatusBar",
"TextEdit",
"TimeEdit",
"ToolBar",
Expand Down
Loading
Loading