Discussion:
Notes on wxTreeCtrl::DeleteAllItems and EVT_TREE_DELETE_ITEM
Hugo Benicio
2014-03-14 15:03:47 UTC
Permalink
Hi guys!

wxWidgets 3.0.0 documentation about wxTreeCtrl::DeleteAllItems:

"Note that this may not generate EVT_TREE_DELETE_ITEM events under some
Windows versions although normally such event is generated for each removed
item"

The experience I had on my project and systems:
[wxMSW 2.8.12] DeleteAllItems always triggers EVT_TREE_DELETE_ITEM, on my
windows xp and windows 7. (considering that the treectrl has elements, of
course)

[wxMSW 3.0.0] DeleteAllItems doen't triggers EVT_TREE_DELETE_ITEM, on my
windows 7. (considering that the treectrl has elements, of course).

I had some troubles fixing a bug in my system because 2.8.12 *always
triggered the event* for me, and 3.0.0 *doesn't triggers it*. Even if both
of them are on the same windows version.
Something has changed on this control and method, of course, but nothing
has changed on the documentation of it.

So the question is... Is it still uncertain that DeleteAllItems triggers
EVT_TREE_DELETE_ITEM depending on windows versions? If so, why? It should
be important to be certain, because it would be nice that this method could
be portable between windows versions. (what happens on linux, mac
distributions?).
If DeleteAllItems now doesn't triggers it at all (since 3.0.0 or other
previous version at least) and the documentation is just not updated, it
would be nice that it could be updated.

Some words or ideas about that? Wouldn't it be nice to remove this
"uncertain" thing?

Thanks!
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-03-14 15:59:42 UTC
Permalink
On Fri, 14 Mar 2014 12:03:47 -0300 Hugo Benicio wrote:

HB> wxWidgets 3.0.0 documentation about wxTreeCtrl::DeleteAllItems:
HB>
HB> "Note that this may not generate EVT_TREE_DELETE_ITEM events under some
HB> Windows versions although normally such event is generated for each removed
HB> item"
HB>
HB> The experience I had on my project and systems:
HB> [wxMSW 2.8.12] DeleteAllItems always triggers EVT_TREE_DELETE_ITEM, on my
HB> windows xp and windows 7. (considering that the treectrl has elements, of
HB> course)
HB>
HB> [wxMSW 3.0.0] DeleteAllItems doen't triggers EVT_TREE_DELETE_ITEM, on my
HB> windows 7. (considering that the treectrl has elements, of course).
HB>
HB> I had some troubles fixing a bug in my system because 2.8.12 *always
HB> triggered the event* for me, and 3.0.0 *doesn't triggers it*. Even if both
HB> of them are on the same windows version.
HB> Something has changed on this control and method, of course, but nothing
HB> has changed on the documentation of it.

I am not sure what exactly has changed, there doesn't seem to be anything
obvious in the diff with 2.8 version. If you could debug this, e.g. by
checking whether we are getting TVN_DELETEITEM in both cases, it would be
interesting.

HB> So the question is... Is it still uncertain that DeleteAllItems triggers
HB> EVT_TREE_DELETE_ITEM depending on windows versions? If so, why?

AFAIR it was just due to the differences between the implementations of
the common control in the different Windows versions.

HB> It should be important to be certain, because it would be nice that
HB> this method could be portable between windows versions. (what happens
HB> on linux, mac distributions?).

I didn't test it but I think the events are sent under the other
platforms.

HB> If DeleteAllItems now doesn't triggers it at all (since 3.0.0 or other
HB> previous version at least) and the documentation is just not updated, it
HB> would be nice that it could be updated.
HB>
HB> Some words or ideas about that? Wouldn't it be nice to remove this
HB> "uncertain" thing?

It would certainly be nice.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Hugo Benicio
2014-03-17 11:56:16 UTC
Permalink
I tryed but I didn't get the reason of why this happens, after all my
debugging here.
Should I open a ticket or something about it? (about removing this "not
portable behavior" about wxTreeCtrl::DeleteAllItems on sending or not an
EVT_TREE_DELETE_ITEM depending on windows version).

Anyways, thanks a lot Vadim for your support and help.
Post by Vadim Zeitlin
HB>
HB> "Note that this may not generate EVT_TREE_DELETE_ITEM events under some
HB> Windows versions although normally such event is generated for each removed
HB> item"
HB>
HB> [wxMSW 2.8.12] DeleteAllItems always triggers EVT_TREE_DELETE_ITEM, on my
HB> windows xp and windows 7. (considering that the treectrl has elements, of
HB> course)
HB>
HB> [wxMSW 3.0.0] DeleteAllItems doen't triggers EVT_TREE_DELETE_ITEM, on my
HB> windows 7. (considering that the treectrl has elements, of course).
HB>
HB> I had some troubles fixing a bug in my system because 2.8.12 *always
HB> triggered the event* for me, and 3.0.0 *doesn't triggers it*. Even if both
HB> of them are on the same windows version.
HB> Something has changed on this control and method, of course, but nothing
HB> has changed on the documentation of it.
I am not sure what exactly has changed, there doesn't seem to be anything
obvious in the diff with 2.8 version. If you could debug this, e.g. by
checking whether we are getting TVN_DELETEITEM in both cases, it would be
interesting.
HB> So the question is... Is it still uncertain that DeleteAllItems triggers
HB> EVT_TREE_DELETE_ITEM depending on windows versions? If so, why?
AFAIR it was just due to the differences between the implementations of
the common control in the different Windows versions.
HB> It should be important to be certain, because it would be nice that
HB> this method could be portable between windows versions. (what happens
HB> on linux, mac distributions?).
I didn't test it but I think the events are sent under the other
platforms.
HB> If DeleteAllItems now doesn't triggers it at all (since 3.0.0 or other
HB> previous version at least) and the documentation is just not updated, it
HB> would be nice that it could be updated.
HB>
HB> Some words or ideas about that? Wouldn't it be nice to remove this
HB> "uncertain" thing?
It would certainly be nice.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-03-17 19:32:39 UTC
Permalink
On Mon, 17 Mar 2014 08:56:16 -0300 Hugo Benicio wrote:

HB> I tryed but I didn't get the reason of why this happens, after all my
HB> debugging here. Should I open a ticket or something about it?

It would be very useful to test the behaviour under the other platforms.
If it's different from the (current) wxMSW behaviour, it's definitely a bug
and would need to be fixed (somehow...).

Thanks,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Loading...