How to display an object in a hierarchical listbox

Hi guys,
I remember to have seen a component or HDI to do that.
But I’m not able to find it back again !

You give an object and the listbox is populated with hierarchical data.

If you know where to find something like that, in pure 4D and listbox, please tell me !


I answer myself :


You can display with List, Listbox, text, and it is a good start for your own displayer…

Hi Olivier,
where is it?

I use this for “something” to hierarchical list:
(ask for an example if it’s not clear)

Note: as far as I can remember, screen representation of “big” objects with text or hierarchical list is very slow.

if I unzip it, I get a .c4D file : what’s that ?

I attache the file for you…

.c4d is produced with menu Method/save, when you’re in the method editor; you just have to create a method a import that file (same menu). That format ensures you can import the method with correct recognition of tokenised elements (commands, constants) whatever 4d version (fr/us and number) - unlike copy/paste the code-as-text in 4dbb.

O yes, sorry, will have a look on it too.

La base que tu cites ne fonctionne pas en V17 ; fonctionne-t-elle en V16 ? y a-t-il des évolutions qui la rendent incompatible ?

Pardon ?
it works perfectly in v16, and in v17 after conversion, nothing more.

So, what issue do you encounter ?

I have identified at least one problem: the type is array object to be replaced with is collection; it is an evolution of the behavior of 4D already mentioned on the forum.

Hierarchical list display is fine but not in text or listbox mode.
To be continued…

Strange, as for me it works perfectly, in v16 and v17. For txt, List and Listbox.

It is now integrated in ogTools future version and all is fine.
I’ll tell you when this version is released, as this code will be a free part, obviously :slight_smile:

Can you tell more about ?
What do you mean and where do you suggest to change Array object to collection ?

“Object array” replaced by “is collection” in 2 methods :
projectMethod OBJ_SetObject2List method : ($type=Is collection) //($fl_IsArray) 35
projectMethod OBJ_SetObject2Text method : ($type=Is collection) //($fl_IsArray) 47

Other issues not investigated

new version of ogTools, including a widget to display an object in text.
“wog_ob_txt”, with choice of colors for properties, arrays, objects, and values.

This widget is obviously free, as based on given code, rewritten.

Component in HDI, download link :

[]30867738;“Your comment here…”[/]

Hi Olivier,
I took a look yesterday, beautiful! Are performances good with a “big” json (I mean file size > 100/200Ko)?

Thanks Arnaud :slight_smile:

I don’t know about performances for big size, as my purpose is to display easily 4d objects. If size is big, I let you check and tell it back here !!!

Ok, about performances…

With a 1 Mo json…
To convert object to multistyle text, it takes 22 seconds.
But then, for 4D to display the multistyle zone, I got the dead circle for ever :frowning:

I’ll try with a 100 Ko file later.

: Olivier GRIMBERT

But then, for 4D to display the multistyle zone, I got the dead
circle for ever :frowning:
Sounds like what I found>: 4D seems to be struggling to display a “big” text in a form, even in 64b. I don’t know the responsible (length, rich text, both?). Quite frustrating anyway.