I'm doing a multithreaded network application that uses Queue objects to manage communication between the threads. If a modal dialog gets launched while a wxTipWindow is displayed, it causes my system to lock. I have to hit ctrl-alt-backspace to get out of X. Although the example below is not realistic, I think it's close enough, and it does demonstrate this behavior. Is this a bug or a feature?
I'm using Linux, python 2.2, and wxPython 2.4.1.2
#!/usr/bin/env python
from wxPython.wx import *
class ListFrame(wxFrame):
def __init__(self):
wxFrame.__init__(self, NULL, -1, 'Frame')
self.list = wxListCtrl(self, 10000, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxLC_REPORT | wxLC_SINGLE_SEL)
self.list.InsertColumn(0, '')
for i in range(0, 100):
self.list.InsertStringItem(i, str(i))
self.tipShown = -1
EVT_MOTION(self.list, self.OnMotion)
def OnMotion(self, event):
x, y = event.GetPosition()
(index, flags) = self.list.HitTest(wxPoint(x, y))
if index != -1 and index != self.tipShown:
rect = self.list.GetItemRect(index)
left, top = self.list.ClientToScreenXY(rect.x, rect.y)
right, bottom = self.list.ClientToScreenXY(rect.GetRight(), rect.GetBottom())
rect = wxRect(left, top, right - left + 1, bottom - top + 1)
txt = self.list.GetItem(index, 0).GetText()
self.tip = wxTipWindow(self, txt)
self.tip.SetBoundingRect(rect)
self.tipShown = index
dialog = wxMessageDialog(self, 'This function has yet to be implemented.', 'Not Implemented', wxOK | wxICON_ERROR)
dialog.ShowModal()
class PYoo(wxApp):
def OnInit(self):
self.frame = ListFrame()
self.frame.Show(1)
self.SetTopWindow(self.frame)
return 1
app = PYoo()
app.MainLoop()