I would like to change the page in a wxNotebook
without the user actually clicking on the tab.
I start two copies of my application and they
communicate using the AccessGrid toolkit. When
the user changes the page in the notebook (by
clicking on the tab) in one application
it sends a message to the other application
telling it what page to change to. I then try
to change the page in the second application,
so they both display the same page. I have tried
using wxNotebook::AdvanceSelection() and
wxNotebook::SetSelection(), but I commonly get
the error:
I would like to change the page in a wxNotebook
without the user actually clicking on the tab.
I start two copies of my application and they
communicate using the AccessGrid toolkit. When
the user changes the page in the notebook (by
clicking on the tab) in one application
it sends a message to the other application
telling it what page to change to. I then try
to change the page in the second application,
so they both display the same page. I have tried
using wxNotebook::AdvanceSelection() and
wxNotebook::SetSelection(), but I commonly get
the error:
Xlib: unexpected async reply (sequence 0x1d34)!
Does anyone know what the problem is?
I don't know how AccessGrid works but you're probably making the call from a thread other than the GUI thread. Try using wx.CallAfter to add a pending call to SetSelection in the GUI thread:
wx.CallAfter(theNotebook.SetSelection, page)
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!