[wxPython-users] Re: insert / edit item in customtreectrl ?
Stef Mientki
s.mientki at ru.nl
Thu Nov 8 08:56:25 PST 2007
Larry Bates wrote:
> Stef Mientki wrote:
>> hello,
>>
>> I've 3 questions (at least for now ;-) about customtreectrl:
>>
>> 1. How do I insert an tree-item ?
>> # item is the selected item of the tree
>> parent = item.GetParent()
>> self.Tree.DoInsertItem ( parent.GetId() , item, 'Ins' )
>> Now this doesn't work, because tree items don't have an ID.
>>
>> self.Tree.DoInsertItem ( parent , item, 'Ins' )
>> This gives an error: GenericTreeItem instance has no attribute '__int__'
>>
>> 2. How do I edit labels
>> I've set CT.TR_EDIT_LABELS,
>> I can edit the labels,
>> but pressing ENTER (on windows) doesn't close the editor.
>> Clicking somewhere else closes the window, but removes my changes :-(
>> In the GREAT wxPython demo this isn't working either.
>>
>> 3. In the wxPython demo I saw a multiline treeitem, Great !!
>> How can I edit a newline in the edit mode ?
>>
>> thanks,
>> Stef Mientki
>
> I can help with the first one:
>
> 1. How do I insert an tree-item ?
> # item is the selected item of the tree
> parent = item.GetParent()
> self.Tree.DoInsertItem ( parent.GetId() , item, 'Ins' )
> Now this doesn't work, because tree items don't have an ID.
>
> root=self.TC.AddRoot('WebSafe Logs', -1, -1)
> treeItem=self.Tree.AppendItem(root, 'Ins')
thanks Larry,
Yes, I don't have trouble with append,
but I want to insert :-(
cheers,
Stef
Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629.
The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.
More information about the wxpython-users
mailing list