Why does EVT_TREE_ITEM_HYPERLINK trigger on selection

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

Dag

Hi,

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

I believe you may be right, but short of modifying the CustomTreeCtrl
source there isn't much you can do. In any case, if there is someone
using hyperlink events on CustomTreeCtrl or HyperTreeList via keyboard
navigation, please speak up. Otherwise I'll modify the sources in SVN
to correct this behaviour when I get back home tonight.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

That would be excellent. Looking forward to it.

Dag

···

On Tue, May 15, 2012 at 9:32 AM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

Hi,

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

I believe you may be right, but short of modifying the CustomTreeCtrl
source there isn't much you can do. In any case, if there is someone
using hyperlink events on CustomTreeCtrl or HyperTreeList via keyboard
navigation, please speak up. Otherwise I'll modify the sources in SVN
to correct this behaviour when I get back home tonight.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Andrea,

Can I suggest modifying it so that select via keyboard doesn't raise a
left click event, (as it should really count as a hover), but that
pressing enter when a hyperlink is selected does raise the event, this
will enable people to use keyboard navigation in an intuitive manner to
select between such hyperlinks and to follow them.

Gadget/Steve

···

On 15/05/2012 8:32 AM, Andrea Gavana wrote:

Hi,

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

I believe you may be right, but short of modifying the CustomTreeCtrl
source there isn't much you can do. In any case, if there is someone
using hyperlink events on CustomTreeCtrl or HyperTreeList via keyboard
navigation, please speak up. Otherwise I'll modify the sources in SVN
to correct this behaviour when I get back home tonight.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Hi Steve,

···

On 15 May 2012 11:37, Gadget/Steve wrote:

On 15/05/2012 8:32 AM, Andrea Gavana wrote:

Hi,

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

I believe you may be right, but short of modifying the CustomTreeCtrl
source there isn't much you can do. In any case, if there is someone
using hyperlink events on CustomTreeCtrl or HyperTreeList via keyboard
navigation, please speak up. Otherwise I'll modify the sources in SVN
to correct this behaviour when I get back home tonight.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Andrea,

Can I suggest modifying it so that select via keyboard doesn't raise a
left click event, (as it should really count as a hover), but that
pressing enter when a hyperlink is selected does raise the event, this
will enable people to use keyboard navigation in an intuitive manner to
select between such hyperlinks and to follow them.

Yes, that's a good suggestion. I'll see what I can do about it.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

This should now be fixed in SVN, could you please test and see if it
works correctly?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

Just tested it and it seems to work fine. Thanks!
Now that that works, I'm thinking about the possibility to trigger a
hyperlink with space/enter. What do you think?

Dag

Dag

···

On Thu, May 17, 2012 at 10:03 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

This should now be fixed in SVN, could you please test and see if it
works correctly?

Hi,

···

On 21 May 2012 11:21, Dag Wastberg wrote:

On Thu, May 17, 2012 at 10:03 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

This should now be fixed in SVN, could you please test and see if it
works correctly?

Just tested it and it seems to work fine. Thanks!
Now that that works, I'm thinking about the possibility to trigger a
hyperlink with space/enter. What do you think?

I gave it a try and implemented it in SVN. Could you test it and see
if it works?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Bad attempt. Shame on me for not testing it... I'll fix it when I get
back home tonight :frowning:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 21 May 2012 22:05, Andrea Gavana wrote:

Hi,

On 21 May 2012 11:21, Dag Wastberg wrote:

On Thu, May 17, 2012 at 10:03 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

This should now be fixed in SVN, could you please test and see if it
works correctly?

Just tested it and it seems to work fine. Thanks!
Now that that works, I'm thinking about the possibility to trigger a
hyperlink with space/enter. What do you think?

I gave it a try and implemented it in SVN. Could you test it and see
if it works?

Should be fixed now in the latest SVN revision.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 22 May 2012 09:16, Andrea Gavana wrote:

On 21 May 2012 22:05, Andrea Gavana wrote:

Hi,

On 21 May 2012 11:21, Dag Wastberg wrote:

On Thu, May 17, 2012 at 10:03 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

On 14 May 2012 17:08, Dag Wastberg wrote:

Hi

I'm trying to use a hypertreelist (wx 2.9.3) in an app where some of
the tree items are hyperlinks. So far so good, no problems. However
my problem comes with the events bound to these items. They trigger
on both left click and when I happen to highlight the item via
keyboard navigation. I've read the customtreectrl.py source code and
this is clearly the intended behavior, but it's not the behavior I
need or want. I want it to only trigger on left clicks. What is the
reasoning behind this behavior, and is there a simple way (short of
editing customtreectrl.py) to change it? I've tried to come up with
some way of differentiating between the two in the callback, but
nothing has worked.

Any suggestions?

This should now be fixed in SVN, could you please test and see if it
works correctly?

Just tested it and it seems to work fine. Thanks!
Now that that works, I'm thinking about the possibility to trigger a
hyperlink with space/enter. What do you think?

I gave it a try and implemented it in SVN. Could you test it and see
if it works?

Bad attempt. Shame on me for not testing it... I'll fix it when I get
back home tonight :frowning: