From owner-oi-users Thu Mar 9 08:06:38 1995 Return-Path: oi-users-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id IAA12065 for oi-users-outgoing; Thu, 9 Mar 1995 08:06:38 -0800 Received: from marvin.boulder.openware.com (marvin.boulder.openware.com [192.245.99.138]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id IAA12054 for ; Thu, 9 Mar 1995 08:06:33 -0800 Received: (from misek@localhost) by marvin.boulder.openware.com (8.6.9/8.6.9) id JAA03687; Thu, 9 Mar 1995 09:03:24 -0700 Date: Thu, 9 Mar 1995 09:03:24 -0700 From: Steve Misek Message-Id: <199503091603.JAA03687@marvin.boulder.openware.com> To: avraad@nyqsdsn1.eq.gs.com Subject: Re: adding cells to Help menu Cc: oi-users@freefall.cdrom.com Sender: oi-users-owner@FreeBSD.org Precedence: bulk I should start charging you a beer for each of these answers :-) You may find the following piece of code an interesting addition to your arsenal of tools when playing with OI. This piece of code will traverse a given object hierarchy and print out the names of all objects (properly indented -- well for vi users :-), you emacs type will just have to cope) in its path. Feed it a pointer to your top level app_window and it'll print out the full application window tree.... steve -------------------- cut here -------------------- void print_tree( OI_d_tech* dtp, OI_bool abs ) { /* External Procedures: */ /* Local Variables: */ static int ntabs = 0; static char tabs[64] ; int i ; /* Procedure: */ if (!ntabs) tabs[0] = '\0'; if (ntabs) fprintf(stderr, tabs); fprintf( stderr, "%s: ", dtp->name() ); if (dtp->is_internal_object()) { fprintf( stderr, "(uib %smodifiable) ", dtp->is_modifiable_internal() ? " " : "NON " ); } fprintf( stderr, "\n" ); tabs[ntabs++] = '\t'; tabs[ntabs] = '\0'; for (i= abs ? dtp->abs_num_props() : dtp->num_props(); i--;) print_tree( abs ? dtp->abs_numbered_child(i) : dtp->numbered_child(i), abs ); tabs[--ntabs] = '\0' ; }