菜单或组合框clickright在组合框中选择?

时间:2019-03-06 14:24:03

标签: python-3.x combobox menu wxpython

我的组合框中有第一个列表(可见,Infrarouge,模拟),我需要创建列表2(VIS04,VIS05,VIS06,ir039,IR087,IR103,SIM1,SIM2,SIM2)我会喜欢这样的菜单:VIS04,VIS05,VIS06 以及对于红外和模拟的类似图像描述:

enter image description here enter image description here

当我在显示框或组合菜单中的其他选项上单击鼠标右键时,我如何拥有像图像描述这样的菜单,而我的菜单中有列表选项呢?或所有其他建议

我在python3中使用wxpython

这是我的代码的一部分:

class MainPanel(wx.Panel):

    def __init__(self, parent):
        super().__init__(parent)
        wx.Frame.__init__(self, parent,size = (250,250))
        self.splitter = wx.SplitterWindow(self, -1, size = (500,500))

#panelone
        pan1 =wx.Window(self.splitter, style=wx.DEFAULT_FRAME_STYLE) 
        pan1.SetBackgroundColour("white")

#paneltwo
        pan2 = wx.Window(self.splitter, style=wx.DEFAULT_FRAME_STYLE)
        pan2.SetBackgroundColour("white")
#combobox

     List1 = ['Infra', 'Vis','simulat']

        combobox = wx.ComboBox(pan2, id=wx.ID_ANY, choices = List1, style=wx.CB_DROPDOWN,pos=(80,5))

一些帮助或例举

我是wxpython的新手

谢谢你

1 个答案:

答案 0 :(得分:0)

您的问题和代码参考$(document).ready(function() { changeAuthor('Jim'); $(document).ajaxStop(function() { changeAuthor('Jim'); }); }); function changeAuthor(name) { $('.author').text(name) } ,但是您的图像示例是弹出菜单。我认为您正在尝试实现以下目标:

wx.ComboBox

enter image description here