src/ui-term.c
errr Term_activate(term *t)
{
	/* Hack -- already done */
	if (Term == t) return (1);

	/* Deactivate the old Term */
	if (Term) Term_xtra(TERM_XTRA_LEVEL, 0);

	/* Hack -- Call the special "init" hook */
	if (t && !t->active_flag) {
		/* Call the "init" hook */
		if (t->init_hook) (*t->init_hook)(t);

		/* Remember */
		t->active_flag = TRUE;

		/* Assume mapped */
		t->mapped_flag = TRUE;
	}

	/* Remember the Term */
	Term = t;

	/* Activate the new Term */
	if (Term) Term_xtra(TERM_XTRA_LEVEL, 1);

	/* Success */
	return (0);
}
/**
 * Activate a new Term (and deactivate the current Term)
 *
 * This function is extremely important, and also somewhat bizarre.
 * It is the only function that should "modify" the value of "Term".
 *
 * To "create" a valid "term", one should do "term_init(t)", then
 * set the various flags and hooks, and then do "Term_activate(t)".
 */
Activate a new Term (and deactivate the current Term)
This function is extremely important, and also somewhat bizarre.
It is the only function that should "modify" the value of "Term".


Activate a new Term ( and deactivate the current Term ) This function is extremely important and also somewhat bizarre . It is the only function that should " modify " the value of " Term " .
errr Term_activate(term *t)
{
	if (Term == t) return (1);
	if (Term) Term_xtra(TERM_XTRA_LEVEL, 0);
	if (t && !t->active_flag) {
		if (t->init_hook) (*t->init_hook)(t);
		t->active_flag = TRUE;
		t->mapped_flag = TRUE;
	}
	Term = t;
	if (Term) Term_xtra(TERM_XTRA_LEVEL, 1);
	return (0);
}
errr Term_activate ( term * t ) { if ( Term == t ) return ( 1 ) ; if ( Term ) Term_xtra ( TERM_XTRA_LEVEL , 0 ) ; if ( t && ! t -> active_flag ) { if ( t -> init_hook ) ( * t -> init_hook ) ( t ) ; t -> active_flag = TRUE ; t -> mapped_flag = TRUE ; } Term = t ; if ( Term ) Term_xtra ( TERM_XTRA_LEVEL , 1 ) ; return ( 0 ) ; }
Activate a new Term (and deactivate the current Term)
 This function is extremely important, and also somewhat bizarre.
Activate a new Term ( and deactivate the current Term ) This function is extremely important and also somewhat bizarre .
/* Hack -- already done */ /* Deactivate the old Term */ /* Hack -- Call the special "init" hook */ /* Call the "init" hook */ /* Remember */ /* Assume mapped */ /* Remember the Term */ /* Activate the new Term */ /* Success */