CustomTreeCtrl problem

If you want to add a validator to your dialog, that should be fairly easy.
Just create your own dialog rather than using one of the prebuilt ones.
Than you can put your own TextCtrl in it and hook a validator to that.

If instead you mean validating at the label level, you should be able to
catch the event and either roll your own validation script to run the
label's contents through or you might be able to just pass the text to a
validator class. Not sure about the latter though.

One of the other gurus on the list will probably have better ideas...

Mike

< snipped >

ยทยทยท

-----Original Message-----
From: Norberto Lopes [mailto:collector@mail.telepac.pt]
Sent: Friday, January 18, 2008 12:26 PM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] CustomTreeCtrl problem

At Fri, 18 Jan 2008 12:06:02 -0600, > Rickey, Kyle W wrote:
>
> Hmm, I'm not exactly sure what's happening here. By the time
> EVT_TREE_END_LABEL_EDIT is sent, the edit control is already
> destroyed, so you can't just call event.Veto() and when
> EVT_TREE_BEGIN_LABEL_EDIT is sent, the edit control has not been
> created yet, so you can't create a custom binding for it.
>
> It seems to me like you're trying a different approach.
After the item
> has been renamed, check to see if it was blank and then prompt the
> user to fix it. However, if I'm understanding correctly,
> EVT_TREE_END_LABEL_EDIT is not sent when you press enter?
>
EVT_TREE_END_LABEL_EDIT is sent when the user presses enter.

> Also, if this is the route you use, you would probably need
to get the
> text of the item when EVT_TREE_BEGIN_LABEL_EDIT is sent, so if the
> user does not enter a string, the item will be reset. This
seems clunky.
>
> A better way would be to somehow add a validator to the
edit control,
> but I don't know how we can accomplish that.
>
This would probably be the best way to go, but I don't know
how to do it either.