Skip to content

Instantly share code, notes, and snippets.

@jhoolmans
Created September 18, 2014 17:10
Show Gist options
  • Save jhoolmans/977b83c5d21ada3cd9fd to your computer and use it in GitHub Desktop.
Save jhoolmans/977b83c5d21ada3cd9fd to your computer and use it in GitHub Desktop.
MAYA: Toggle MainWindow menubar to be native or not. Moves the menubar into the mainwindow on OSX. This may be useful while recording and scaling your window to fit a certain size.
import maya.OpenMayaUI as OMUI
from PySide import QtCore
from PySide import QtGui
from shiboken import wrapInstance
def maya_main_window():
mainWindowPtr = OMUI.MQtUtil.mainWindow()
return wrapInstance(long(mainWindowPtr), QtGui.QMainWindow)
def toggle_menubar_native():
mainWindow = maya_main_window()
menubar = mainWindow.menuBar()
menubar.setNativeMenuBar(not menubar.isNativeMenuBar())
toggle_menubar_native()
@jhoolmans
Copy link
Author

This actually breaks the menu's so far.. Not so sure why that is.. 🎱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment