nicer output

This commit is contained in:
Dana Jansens 2002-12-30 06:46:19 +00:00
parent 349ac3f0e3
commit 78a8588126
2 changed files with 6 additions and 5 deletions

View file

@ -21,6 +21,7 @@ static void print_branch(BindingTree *first, std::string str)
while (p) { while (p) {
if (p->first_child) if (p->first_child)
print_branch(p->first_child, str + " " + p->text); print_branch(p->first_child, str + " " + p->text);
if (!p->chain)
printf("%d%s\n", p->id, (str + " " + p->text).c_str()); printf("%d%s\n", p->id, (str + " " + p->text).c_str());
BindingTree *s = p->next_sibling; BindingTree *s = p->next_sibling;
delete p; delete p;
@ -83,9 +84,8 @@ static BindingTree *buildtree(const OBBindings::StringVect &keylist, int id)
p->chain = false; p->chain = false;
} }
printf("<BUILDING>\n"); printf("BUILDING:\n");
print_branch(ret, ""); print_branch(ret, "");
printf("</BUILDING>\n");
// successfully built a tree // successfully built a tree
return ret; return ret;

View file

@ -150,8 +150,8 @@ Openbox::Openbox(int argc, char **argv)
_bindings = new OBBindings(); _bindings = new OBBindings();
OBBindings::StringVect v; OBBindings::StringVect v;
// v.push_back("C-x"); v.push_back("C-x");
// v.push_back("C-y"); v.push_back("C-y");
v.push_back("v"); v.push_back("v");
_bindings->add(v, 1); _bindings->add(v, 1);
v.clear(); v.clear();
@ -160,6 +160,7 @@ Openbox::Openbox(int argc, char **argv)
v.push_back("a"); v.push_back("a");
_bindings->add(v, 2); _bindings->add(v, 2);
printf("CHAINS:\n");
_bindings->display(); _bindings->display();
::exit(0); ::exit(0);