🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #12811

Re: SunView tricks needed: background to a panel

#12811
From: Neil Hunt
Date: Fri, 12 May 1989 03:32
60 lines
1686 bytes
This seems to work for me;  get the panel items painted
before you paint your own custom background by calling
notify_next_event_func from your event func handler;

The example below simply puts a box around a number of items
in the panel to group them together visually.

Notify_value
bg_paint(panel, event, arg, type)
Panel panel;
Event *event;
Notify_arg arg;
Notify_event type;
{
	Pixwin *pw;
	Notify_value value;

	/*
	 * Call the normal notify_event handler.
	 */
	value = notify_next_event_func(panel, event, arg, type);

	if(event_id(event) != WIN_REPAINT)
		return value;

	/*
	 * Add additional repainting actions.
	 */
	pw = (Pixwin *)window_get(panel, WIN_PIXWIN);
	pw_rect(pw, S_X, S_Y, S_W, S_H, 1, PIX_SRC, -1);

	return value;
}

Frame
create_frame()
{
	Frame frame;
	Panel panel;

	frame = window_create(
	  ...
	  WIN_WIDTH, E_W+10+10,
	  WIN_HEIGHT, E_Y+E_H+5+20,
	  0);
	if(frame == NILFRAME)
		return NILFRAME;

	panel = panel_create(frame,
	  ...
	  WIN_WIDTH, E_W+10,
	  WIN_HEIGHT, E_Y+E_H+5,
	  0);

	notify_interpose_event_func(panel, bg_paint, NOTIFY_SAFE);

	return frame;
}

Neil/.
Technical Details
Message-ID: <8905082339.AA10732@wayback.teleos.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: neil@teleos.com (Neil Hunt)
Newsgroups: comp.sys.sun
Subject: Re: SunView tricks needed: background to a panel
Keywords: Windows
Message-ID: <8905082339.AA10732@wayback.teleos.com>
Date: 12 May 89 03:32:09 GMT
Sender: usenet@rice.edu
Organization: Sun-Spots
Lines: 60
Approved: Sun-Spots@rice.edu
Original-Date: Mon, 8 May 89 16:39:26 PDT
X-Sun-Spots-Digest: Volume 7, Issue 285, message 1 of 10