Floating Frame Problem

Morton Publications wrote:

I am trying to make a small floating search feature in a miniframe to search through texts, display them in a html window in another class and frame, and remain open after a search. I first tried to do this with wx.dialog and got it to work except the dialog always closed when the button was clicked. I need it to remain open. I have been trying it with a miniframe and can get the frame to stay up, but I cannot get the main frame in the other class to receive the search data. Here is the relevent code.

Class StatMini():....
                          self.Bind(wx.EVT_BUTTON, self.OnAnalyze, self.button)

     def OnAnalyze(self, event):
        entry = self.StatEnter.GetValue()
        result = fInst(entry, orig)
        MyFrame.DisplayStat(MyFrame(self), result)

Are you intentionally making another instance of MyFrame, or does it already exist? If it already exists, then you should be calling DisplayStat via a reference to the existing instance, like this:

  self.myFrame.DisplayStat(result)

If you are intending to make a new instance, this this code is much more understandable:

  myFrame = MyFrame(self)
  myFrame.Show()
  myFrame.DislayStat(result)

I expect that the reason you see the printing of your result but not the window is because you are unintentionally making a new instance, and it is not shown.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!