I’m having trouble getting the Notebook’s HitTest( ) call to return anything other than ( -1, int ) in Phoenix.
The int is always some really large number that changes with every run, but is consistently the same across all tabs during each session.
wx.version( ) == ‘4.0.0a3 msw (phoenix)’
Sample code (also attached):
import wx
def _on_right( event ):
pos = event.GetPosition( )
print( event.GetEventObject( ).HitTest( pos ) )
event.Skip( )
if name == ‘main’:
app = wx.App( )
frame = wx.Frame( None )
szr_main = wx.BoxSizer( wx.HORIZONTAL )
panel = wx.Panel( frame, size = ( 600, 600 ) )
panel.SetSizer( szr_main )
notebook = wx.Notebook( panel, size = ( 600, 600 ) )
notebook.AddPage( wx.TextCtrl( notebook ), ‘Page 1’ )
notebook.AddPage( wx.TextCtrl( notebook ), ‘Page 2’ )
notebook.AddPage( wx.TextCtrl( notebook ), ‘Page 3’ )
notebook.Bind( wx.EVT_RIGHT_DOWN, _on_right )
szr_main.Add( notebook, 0, wx.ALL | wx.EXPAND, 2 )
frame.Fit( )
frame.Show( )
app.MainLoop( )
notebook.py (709 Bytes)