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

View file

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