Does anything cover this?

I need something that allows me to say, set the text of a textbox to “hi” when I select an item in a DTree.

Yes, I’ve tried DTree:GetSelectedItem() and from what I’ve seen it doesn’t select subitems.

I’m not sure I fully understand what you’re doing, but try this:
[lua]
DTree.DoClick = function()
TextEntry:SetText( DTree:GetSelectedItem() );
end
[/lua]

actually, it does work but it comes out like this… example, when I clicked the first item it set the text as: Panel: 31921FC8 instead of 123

Are you using the method I proposed?

yes… I told you I’ve tried it before and it didn’t work properly.

I’ve never used DTree before but from what I can see, it doesn’t look like you can change the node name. Maybe you could just create a new node with the same properties as the old and then remove the old one?

Why wouldn’t I just be able to read the text…?

Are you able to [lua]PrintTable( DTree:GetSelectedItem() ) [/lua]

not a table.

[@lua\includes\util.lua:35] bad argument #1 to ‘pairs’ (table expected, got Panel)[@lua\includes\util.lua:35] bad argument #1 to ‘pairs’ (table expected, got Panel)

DTree:GetSelectedItem():GetText()

[editline].[/editline]

When trying to print a panel’s data, use panel:GetTable().

danks u good sir

[editline]16th May 2011[/editline]

mh, it doesn’t work

[lua]DTree:GetSelectedItem():GetValue()[/lua]

[editline]17th May 2011[/editline]

If that doesn’t work:

[lua]DTree:GetSelectedItems()[1]:GetValue()[/lua]

nope

I’ve done this in faphack, hang on while I read my code.

[editline]17th May 2011[/editline]

[lua]for k , v in pairs(FapHack.MenuItems) do

		local node = dtree:AddNode(v.label)

		node.OldClick = node.DoClick

		node.DoClick = function(...)

			FapHack:SelectMenuItem(v.label)

			return node.OldClick(...)

		end

	end[/lua]

that didn’t work either.

[editline]17th May 2011[/editline]

lol king flawless rates every post dumb.

That means you’re doing it wrong. It’s worked on around 4000 to 14000 people’s games.

yes i am doing it wrong, that is possibly the reason why i’m asking for help. Perhaps a demonstration or am i going to be fed examples? I don’t know how to do it and i really don’t feel like messing with it.

why havent you posted your code

You got a demonstration in the form of examples.

I don’t need to paste my code because it’s a simple fucking thing. It’s just setting the text of a textbox when a dtree item is clicked. That’s like 6 lines of code.