wxPython - Detach() function in wx.MenuBar Last Updated : 02 Mar, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn about Detach() function associated with wx.MenuBar class of wxPython. Detach() function simply detaches the menubar associated/attached with the frame. Detach() function takes no arguments. Syntax: wx.MenuBar.Detach(self) Parameters: Detach() function takes no arguments. Code Example: Python3 import wx class Example(wx.Frame): def __init__(self, *args, **kwargs): super(Example, self).__init__(*args, **kwargs) self.InitUI() def InitUI(self): self.locale = wx.Locale(wx.LANGUAGE_ENGLISH) self.menubar = wx.MenuBar() self.fileMenu = wx.Menu() self.item = wx.MenuItem(self.fileMenu, 1, '&Check', helpString ="Check Help") self.item.SetBitmap(wx.Bitmap('right.png')) # SET BLUE COLOUR FOR TEXT FORMAT(R, B, G, A) self.item.SetTextColour((79, 81, 230, 255)) self.fileMenu.Append(self.item) self.menubar.Append(self.fileMenu, '&File') self.menubar.Attach(self) # Detach menubar self.menubar.Detach() self.SetSize((350, 250)) self.SetTitle('Icons and shortcuts') self.Centre() def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output: Comment More infoAdvertise with us Next Article wxPython - FindMenuItem() function in wx.MenuBar R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Practice Tags : python Similar Reads wxPython - Attach() function in wx.MenuBar In this article, we are going to learn about Detach() function associated with wx.MenuBar class of wxPython. Attach() function simply attaches the menubar with the frame. Attach() function takes only one wx.Frame type argument. Syntax: wx.MenuBar.Attach(self, frame)Parameters: ParameterInput TypeDes 1 min read wxPython - FindMenuItem() function in wx.MenuBar In this article we will learn about FindMenuItem() function present in wx.MenuBar class of wxPython. FindMenuItem() is used to return item identifier. FindMenuItem() takes two parameters that is Menu title and submenu item string. Syntax : wx.MenuBar.FindMenuItem(self, menuString, itemString) Parame 1 min read wxPython - Remove() function in wx.MenuBar In this article we are going to learn about Remove() function of wx.MenuBar class. Remove() function removes Menu from a particular position in MenuBar in frame. This function takes pos parameter, that is, position of Menu to be deleted. Parameters : Parameter Input Type Description pos int The posi 2 min read wxPython - Insert() function in wx.MenuBar In this article we are going to learn about Insert() function associated to wx.MenuBar class of wxPython. So Insert() function is a very important function in wx.MenuBar class. Insert() function Inserts the menu at the given position into the menu bar. Inserting menu at position 0 will insert it in 1 min read wxPython - Check() function in wx.MenuItem In this article we are going to learn about Check function associated with the wx.MenuItem class of wxPython. As the name Check suggests Check() function checks or unchecks the menu item(ITEM_CHECK). Note that this only works when the item is already appended to a menu. Syntax: wx.MenuItem.Check(sel 1 min read wxPython - Enable() function in wx.MenuItem In this article we are going to learn about Enable() function associated with the wx.MenuItem class of wxPython. As the name Enable suggests Enable() function enables or disables the menu item. It only takes a boolean parameter enable, True for Enable and False for Disable. Syntax: wx.MenuItem.Enabl 1 min read Like