Phoenix icon indicating copy to clipboard operation
Phoenix copied to clipboard

ComboBox in a PopupTransientWindow can not input in 4.1.1 but 4.1.0 can be.

Open duohe opened this issue 2 years ago • 1 comments

I have a subclass of the PopupTransientWindow:

class IDFilterPopup(wx.PopupTransientWindow):
    def __init__(self, parent, x, y, string="", history=[]):
        wx.PopupTransientWindow.__init__(self, parent)
        self.panel = wx.Panel(self)
        self.panel.SetBackgroundColour("#FFB6C1")

        m_comboBox1Choices = history
        self.tc = wx.ComboBox(self.panel, wx.ID_ANY, string, wx.DefaultPosition, wx.DefaultSize, m_comboBox1Choices,
                      wx.TE_PROCESS_ENTER)
        self.tc.SetMinSize(wx.Size(INPUT_WINDOW_MIN_WIDTH, -1))
        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.sizer.Add(self.tc, 0, wx.ALL, 5)
        self.panel.SetSizer(self.sizer)

        self.sizer.Fit(self.panel)
        self.sizer.Fit(self)
        self.Layout()

        self.Position(wx.Point(x, y), wx.Size(-1, -1))
        self.tc.Bind(wx.EVT_TEXT, self.OnTextChange)
        self.tc.Bind(wx.EVT_TEXT_ENTER, self.OnTextEnter)
        self.tc_origin_width = self.tc.GetSize().width
        self.tc.SetInsertionPointEnd()
        self.is_entered = False
        self.has_error = False

It created in a button click event handler and the Popup method is called by wx.CallAfter: self.pop = IDFilterPopup(self, XXX, XXX, XXX, XXX) wx.CallAfter(self.pop.Popup, self.pop.tc)

The problem is that the ComboBox can gets the keyboard input on the vesion 4.1.0, but it can not work on 4.1.1.

duohe avatar Apr 11 '22 06:04 duohe

Please post a minimal, runnable sample.

DietmarSchwertberger avatar Apr 11 '22 18:04 DietmarSchwertberger