473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

TreeNode End of Editing Event

Hi,
I just started implementing adding a new node to an existing tree.

In these statements, I add the node itself and attach the
"end of editing" event handler to the event
--------
id = self.tree.AppendItem(self.root,'New Item Node',-1,-1)
EVT_TREE_END_LABEL_EDIT(self.tree, treeID, self.OnEndEdit)
---------
But when I respond to the EVT_TREE_END_LABEL_EDIT event, I don't get the
new label when you change it:

The event handler:
-------------
def OnEndEdit(self,event):
item=event.GetItem()
s = self.tree.GetItemText(item) # for debugging

------------

The 's' variable shows the original label (set above) which is 'New Item
Node'. Should it not show the new text after entering and then press Enter
key?
Am I going about this the wrong way?



Jul 18 '05 #1
1 1893
Here's where I loused up: I didn't continue reading the documentation
carefully.

You don't use GetItemText(). Instead, in either a BEGIN_LABEL_EDIT event,
or a END_LABEL_EDIT (which I need to use) event, you use: GetLabel()

--------------
wxTreeEvent::GetLabel
const wxString& GetLabel() const

returns the label if the event was a begin or end edit label event.

-------------
"StvB" <me***********************@hotmail.com> wrote in message
news:rt*******************@newssvr21.news.prodigy. com...
Hi,
I just started implementing adding a new node to an existing tree.

In these statements, I add the node itself and attach the
"end of editing" event handler to the event
--------
id = self.tree.AppendItem(self.root,'New Item Node',-1,-1)
EVT_TREE_END_LABEL_EDIT(self.tree, treeID, self.OnEndEdit)
---------
But when I respond to the EVT_TREE_END_LABEL_EDIT event, I don't get the
new label when you change it:

The event handler:
-------------
def OnEndEdit(self,event):
item=event.GetItem()
s = self.tree.GetItemText(item) # for debugging

------------

The 's' variable shows the original label (set above) which is 'New Item
Node'. Should it not show the new text after entering and then press
Enter key?
Am I going about this the wrong way?


Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Andrew | last post by:
created a custom class that is derived from TreeNode, let's call it customTreeNode. I'm trying to use the TreeViewEventArgs (for the AfterSelect event) but I cannot cast to my derived TreeNode. ...
4
by: Patrick Noll | last post by:
hi ng, i have a problem when i try to change the text property of a TreeNode just before the user is able to edit this property. Example: // Label before anything happens... TreeNode.Text =...
1
by: yzhao | last post by:
I would like to put a treenode into edit mode right after its parent is expanded, i.e., a user clicks the plus sign of a parent node, after the expansion, put the first node into edit mode. I...
3
by: Matthew Woods | last post by:
Hi, does anyone know how to select a treenode with the first click? the first click on a treeview will highlight the node under the mouse when it was clicked BUT that node isn't actually selected...
5
by: Don | last post by:
I've created a small test class to extend the Treenode object and am having mixed success. In the Treeview's 'BeforeExpand' event I've used code from the help topic "Adding Custom Information to...
1
by: Andrea | last post by:
Hi, Im using an ASP.NET 2.0 TreeView control on a web page with an Xml MapSiteMenu. Some nodes does'nt have url property (just acts as container of other children nodes). My question is: Can i...
2
by: Alan T | last post by:
Desktop TreeView.TreeNode. Can I detect the click event on the treenode?
0
by: John Faris | last post by:
Hi all. I have a class that inherits from TreeNode and adds a generic property, NodeObject. Then I have several other classes that inherit from this class and specify the type of NodeObject as...
0
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.