Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Mar 1995 09:03:24 -0700
From:      Steve Misek <misek@boulder.openware.com>
To:        avraad@nyqsdsn1.eq.gs.com
Cc:        oi-users@freefall.cdrom.com
Subject:   Re: adding cells to Help menu
Message-ID:  <199503091603.JAA03687@marvin.boulder.openware.com>

next in thread | raw e-mail | index | archive | help

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' ;
}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503091603.JAA03687>