Notebook.HitTest( ) on Phoenix

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)

Hi,

I’m having trouble getting the Notebook’s HitTest( ) call to return anything
other than ( -1, int ) in Phoenix.

Where is the mouse cursor when you try to check the HitTest() return?

Thank you.

···

On Tue, Sep 5, 2017 at 2:06 PM, Andy Kelts <Andy.Kelts@dsvolition.com> wrote:

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( )

________________________________
This e-mail may contain CONFIDENTIAL AND PROPRIETARY INFORMATION and/or
PRIVILEGED AND CONFIDENTIAL COMMUNICATION intended solely for the recipient
and, therefore, may not be retransmitted to any party outside of the
recipient's organization without the prior written consent of the sender. If
you have received this e-mail in error please notify the sender immediately
by telephone or reply e-mail and destroy the original message without making
a copy. Deep Silver, Inc. accepts no liability for any losses or damages
resulting from infected e-mail transmissions and viruses in e-mail
attachments.

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

On any one of the tabs:

It doesn’t matter which tab I right-click on; they all return exactly the same thing.

If I right-click anywhere else, the event is not picked up.

···

On Tuesday, September 5, 2017 at 1:54:54 PM UTC-5, Igor Korot wrote:

Hi,

On Tue, Sep 5, 2017 at 2:06 PM, Andy Kelts Andy....@dsvolition.com wrote:

I’m having trouble getting the Notebook’s HitTest( ) call to return anything

other than ( -1, int ) in Phoenix.

Where is the mouse cursor when you try to check the HitTest() return?

Thank you.

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( )

This e-mail may contain CONFIDENTIAL AND PROPRIETARY INFORMATION and/or

PRIVILEGED AND CONFIDENTIAL COMMUNICATION intended solely for the recipient

and, therefore, may not be retransmitted to any party outside of the

recipient’s organization without the prior written consent of the sender. If

you have received this e-mail in error please notify the sender immediately

by telephone or reply e-mail and destroy the original message without making

a copy. Deep Silver, Inc. accepts no liability for any losses or damages

resulting from infected e-mail transmissions and viruses in e-mail

attachments.

You received this message because you are subscribed to the Google Groups

“wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an

email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

It looks like the base class version of HitTest is being called instead of the one in wx.Notebook. It should be an easy fix, but please file an issue about this at Github anyway so it doesn’t get forgotten.

Robin

···

On Tuesday, September 5, 2017 at 1:30:31 PM UTC-7, Andy Kelts wrote:

On any one of the tabs:

It doesn’t matter which tab I right-click on; they all return exactly the same thing.

If I right-click anywhere else, the event is not picked up.

On Tuesday, September 5, 2017 at 1:54:54 PM UTC-5, Igor Korot wrote:

Hi,

On Tue, Sep 5, 2017 at 2:06 PM, Andy Kelts Andy....@dsvolition.com wrote:

I’m having trouble getting the Notebook’s HitTest( ) call to return anything

other than ( -1, int ) in Phoenix.

Where is the mouse cursor when you try to check the HitTest() return?

Thank you.

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( )

This e-mail may contain CONFIDENTIAL AND PROPRIETARY INFORMATION and/or

PRIVILEGED AND CONFIDENTIAL COMMUNICATION intended solely for the recipient

and, therefore, may not be retransmitted to any party outside of the

recipient’s organization without the prior written consent of the sender. If

you have received this e-mail in error please notify the sender immediately

by telephone or reply e-mail and destroy the original message without making

a copy. Deep Silver, Inc. accepts no liability for any losses or damages

resulting from infected e-mail transmissions and viruses in e-mail

attachments.

You received this message because you are subscribed to the Google Groups

“wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an

email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.