2
如何將工具提示添加到wx.Menu()的元素中?下面是我的項目編寫的代碼:wxPython - 將工具提示添加到菜單項目
#Patient menu (1st menu):
self.patientMenu = wx.Menu()
self.registerNewPatient = self.patientMenu.Append(-1, 'Cadastrar paciente...')
self.listPatientsByName = self.patientMenu.Append(-1, u'Listar pacientes em ordem alfabética')
self.listPatientsByNumber = self.patientMenu.Append(-1, u'Listar pacientes por número em ordem crescente')
self.searchForPatients = self.patientMenu.Append(-1, 'Pesquisar paciente(s)...')
#Appointment menu (2nd menu):
self.appointmentMenu = wx.Menu()
self.seeAppointmentsForToday = self.appointmentMenu.Append(-1, 'Visualizar consultas de hoje')
self.registerNewAppointment = self.appointmentMenu.Append(-1, 'Marcar consulta...')
self.cancelAppointment = self.appointmentMenu.Append(-1, 'Desmarcar consulta...')
self.seeAppointmentsForOtherSpecificDate = self.appointmentMenu.Append(-1, 'Pesquisar consultas...')
#Exit menu (3rd menu):
self.exitMenu = wx.Menu()
self.exitProgram = self.exitMenu.Append(-1, 'Encerrar')
#Menu bar:
self.menuBar = wx.MenuBar()
self.menuBar.Append(self.patientMenu, 'Paciente')
self.menuBar.Append(self.appointmentMenu, 'Consulta')
self.menuBar.Append(self.exitMenu, 'Sair')
self.SetMenuBar(self.menuBar)
謝謝你的鏈接。其實,我並沒有這樣想。爲了提供帶有簡單工具提示的菜單元素,我希望這是一種簡單的方法。 –
有:http://wxpython.org/Phoenix/docs/html/ToolTip.html?highlight=tooltip ...但這似乎是整個窗口。如果他們得到時間,您可能會收到Mike或Robin的回覆。他們通常在wxpython標籤上非常活躍。我還添加了另一個鏈接到balloontip。 – jmunsch