lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: [lmi] Code review: product editor


From: Evgeniy Tarassov
Subject: Re: Re[2]: [lmi] Code review: product editor
Date: Thu, 29 Mar 2007 17:21:12 +0200

On 3/29/07, Vadim Zeitlin <address@hidden> wrote:
On Thu, 29 Mar 2007 12:09:27 +0000 Greg Chicares <address@hidden> wrote:

GC> Here's the way we're thinking of handling this situation,
GC> in an EVT_TREE_SEL_CHANGED handler:
GC>
GC>     wxTreeCtrl& tree = GetTreeCtrl();
GC>
GC>     wxTreeItemId item_id = event.GetItem();
GC>     if(!item_id.IsOk())
GC>         {
GC>         item_id = tree.GetRootItem(); // QUESTION
GC>         }
GC>     LMI_ASSERT( item_id.IsOk() );
GC>     ...

 IMO this fallback on the (hidden!) root item doesn't make much sense.
Either we should handle the case when item_id is invalid (indicating that
there is no valid selection in the tree). Or we should simply assert that
it's valid immediately.

Let's simply remove it then.

GC> Suppose a selected non-root item is removed under program
GC> control. Then doesn't some other item gain the selection?

 It does or at least it should.

Do you want me to update the docs (and the code if needed) to ensure
that it _is_ true in wx?

--
With best wishes,
Evgeniy Tarassov




reply via email to

[Prev in Thread] Current Thread [Next in Thread]