Game Development Community

GuiTreeViewCtrl Icons

by GAMEHACK3R · in Technical Issues · 04/19/2008 (9:34 am) · 3 replies

How do you add an icon to a GuiTreeViewCtrl Item

im using the method

filemanagerGUIdirectory.insertItem(1 , "Folder");

and i wish to add the Default /common/ui/folder.png icon to this Item

#1
04/30/2008 (11:37 pm)
Bump :(

anyone ?
#2
05/01/2008 (9:18 am)
To be honest it's not a function I have used before but let me try and help you, every object in torque exposes a function called .dump() that prints to the console a list of the methods functions and attributes available for that object. It's a great tool when you get stuck and are trying to figure something out like this.

For example:

==>[b]filemanagerGUIdirectory.dump();[/b]

Methods:
...
  getType() - obj.getType()
  getValue() - 
  insertItem() - (TreeItemId parent, name, value, icon, normalImage=0, expandedImage=0)
  isActive() - 
  isAwake() - 
  isChildOfGroup() -  returns true, if we are in the specified simgroup - or a subgroup thereof
...

Once you have that list you can have a scan down that list for functions like SetImage, setIcon or something like that as most functions have names that explain a little about what they do i.e. the InsertItem() function you are using.

Now as you can see above in the codeblock this insertItem() shows you what parameters the function accepts (be aware these are not always 100% accurate as changes in the past haven't updated the descriptions but it's a good start).

insertItem() - (TreeItemId parent, name, value, icon, normalImage=0, expandedImage=0)

As you can see the function should accept as one of its parameters the icon you wish to use, assuming there isn't a bug then it should work fine for you.
#3
03/05/2009 (11:13 pm)
How do you change the size of icon?