ki icon indicating copy to clipboard operation
ki copied to clipboard

Getting started documentation?

Open ahctangU opened this issue 3 years ago • 4 comments

There's a lot of documentation regarding advanced features, but it is a little ridiculous there is no documentation anywhere on how to even initialize the basic tree structure.

Maybe, I'm dumb, but I can't even build the tree let alone try the advanced signaling features.

ahctangU avatar Oct 11 '21 05:10 ahctangU

good point! see the ki/node_test.go file for some examples -- e.g.,

	parent := NodeEmbed{}
	parent.InitName(&parent, "par1")
	typ := reflect.TypeOf(parent)
	child := parent.AddNewChild(typ, "child1")

will add to README.md.

In GoGi there are methods like AddNewButton etc that call AddNewChild with a specific type.

rcoreilly avatar Oct 11 '21 06:10 rcoreilly

Thanks for the quick reply!

Some additional help with how to do BFS and DFS traversal would also be immensely helpful. The function KiToMyNode(k) doesn't actually exist, but I am assuming that means I need to do some runtime type assertion to get my original type back.

ahctangU avatar Oct 11 '21 07:10 ahctangU

yep you need to write that method or its equivalent.. simple example per above is now in README

rcoreilly avatar Oct 11 '21 08:10 rcoreilly

Thank you so much for the great library. This is a life saver.

ahctangU avatar Oct 11 '21 09:10 ahctangU