[comp.sys.amiga] custom screen trick

bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt) (07/23/87)

Here's a little trick I ran across that you might find useful:

Recently I needed a screen with the standard drag bar, depth gadgets *AND*
a close box.  A close box is not one of the standard things you can add to
a screen.  About six characters into a custom gadget definition I realized
that there was a quicker, dirtier, easier way; this is it:

struct NewWindow MyGadgetW = {
	0, 0,
	15, 10,                  /* LO-RES */
	-1, -1,
	CLOSEWINDOW,
	WINDOWCLOSE|SIMPLE_REFRESH|NOCAREREFRESH,
	NULL,
	NULL,
	NULL,
	NULL,			/* Screen pointer filled in later */
	NULL,
	0, 0, 0, 0,
	CUSTOMSCREEN
};

This can be used to open a SIMPLE_REFRESH window that's the size of a close
gadget.  Since all it contains is a close gadget that's all it will be.
(For some fun add a one pixel drag bar... :-)


|\ /|  . Ack! (NAK, EOT, SOH)
{o O} . 
( " )	bryce@cogsci.berkeley.EDU -or- ucbvax!cogsci!bryce
  U	"Success leads to stagnation; stagnation leads to failure."