Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your code working MattH but my problem is actually i was showing button in click event of menubar at that time &amp;&amp; not works..check out below code...what should be done in such a case</p> <pre><code>import wx class MainWindow(wx.Frame): def __init__(self,parent,title): wx.Frame.__init__(self,parent,title=title,size=(699, 570)) fileMenu= wx.Menu() folder=wx.MenuItem(fileMenu, 1, "&amp;Start","Click here to start..") fileMenu.AppendItem(folder) about = wx.MenuItem(fileMenu, 2, '&amp;About',"Test") fileMenu.AppendItem(about) quit = wx.MenuItem(fileMenu, 3, '&amp;Quit',"Terminate the program") fileMenu.AppendItem(quit) menuBar = wx.MenuBar() menuBar.Append(fileMenu,"&amp;File") self.Bind(wx.EVT_MENU, self.ShowButton, folder) self.SetMenuBar(menuBar) pndSummaryButton = wx.Button(self, 3, "Button &amp;&amp;Two", (130, 146)) pndSummaryButton.name="pndSummary" self.printArea2 = wx.TextCtrl(self,pos = (290, 146), size = (255, 25),style = wx.TE_READONLY) pndSummaryButton.SetFont(wx.Font(11, wx.SWISS, wx.NORMAL,wx.LIGHT)) self.printArea2.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL,wx.LIGHT)) pndSummaryButton.SetBackgroundColour(wx.Colour(153,0,0)) pndSummaryButton.SetForegroundColour(wx.Colour(255,255,255)) pndSummaryButton.SetSize(pndSummaryButton.GetBestSize()) self.Show() def ShowButton(self,event): pndSummaryButton = wx.Button(self, 3, "Button &amp;&amp;Two", (130, 176)) pndSummaryButton.name="pndSummary1" self.printArea2 = wx.TextCtrl(self,pos = (290, 176), size = (255, 25),style = wx.TE_READONLY) pndSummaryButton.SetFont(wx.Font(11, wx.SWISS, wx.NORMAL,wx.LIGHT)) self.printArea2.SetFont(wx.Font(10, wx.SWISS, wx.NORMAL,wx.LIGHT)) pndSummaryButton.SetBackgroundColour(wx.Colour(153,0,0)) pndSummaryButton.SetForegroundColour(wx.Colour(255,255,255)) pndSummaryButton.SetSize(pndSummaryButton.GetBestSize()) app = wx.App(False) frame = MainWindow(None,"Hello Ampersand") app.MainLoop() </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload