[comp.sys.apollo] answers to dialog question

wcwang@iuvax.cs.indiana.edu (08/19/87)

From: Bill Wang <wcwang@iuvax.cs.indiana.edu>



I got enough responses for my popup question about dialog.There are
also a couple of replies directly sent to comp.sys.apollo.
For my application, I used the solution of Bruce Thompson from
U. of Calgary.

Thanks to all of the respondants because I could not reach some of you
by mail.

Here are two of the best responses I have received:

From: pircher@mis.ucsf.edu (Peter Pircher)
Message-Id: <8708180027.AA18662@mis.ucsf.edu>
To: wcwang@iuvax.cs.indiana.edu
Subject: dialog popus
Status: R


If I understand your question right you want to call a C-action
and use POPDOWN at the same time.

The /sys/ins/dialog_user.ins.dps file defines the m1 transition
as
	[m1]	=> < * select > ;
This will select the task (menu entry) and cause the callback.
Since you also want to POPDOWN the popup you need to redefine
m1 for the techniques inside the popup to select the item and
to popdown the named popup technique:

	my_popup := popup:
		contents := popup_row;
		leave => <* popdown>;
	end

	popup_row := row:
		contents = 
		(
			row_1_menu
			row_1_button
		);
	end

	row_1_menu := menu:
		task = menu_task;
		[m1] = <* select; my_popup popdown>;
	end

	row_1_button := icon:
		task = button_task; { task then calls C-action }
		[m1] = <* select; my_popup popdown>;
	end

I hope this help


-- Peter Pircher

pircher@renoir.berkeley.edu
pircher@ide.com
ucbvax!sun!ide!pircher	{ UUCP }

From: Bruce Thompson <seismo!calgary!vaxb!thompson>
To: wcwang@iuvax.cs.indiana.edu
Subject: Re: popup in dialog
In-Reply-To: your article <3064@iuvax.UUCP>
News-Path: calgary!alberta!ihnp4!inuxc!iuvax!wcwang
Status: R

Hi there. The problem you describe is one that I spent a long time
trying to figure out. The frustrating thing is that the solution is
quite simple. I'm going to assume that the task for the menu in the
popup is called `menu_task', and that the popup technique is called
`popup_tech'. The following lines should appear in your <>.dps file:

USER_INTERFACE  <whatever>

	menu_task DEACTIVATE => <popup_tech POPDOWN>
	menu_task ACTIVATE => <popup_tech SHOW>


A call like the following:
	DP_$TASK_DEACTIVATE(menu_task, status);

will cause the popup to disappear, and a call like:
	DP_$TASK_ACTIVATE(MENU_TASK, STATUS);

will cause it to re-appear. If you don't need the latter ability
(i.e. getting it to show itself is no problem), then eliminate the
ACTIVATE line given above for the <>.dps file.

	See section 5.2 of the Dialogue User's Guide for more info.


    Hope this helps,

    Bruce Thompson.

------------------------------------------------------------------------------
Bruce Thompson				| Disclaimer? But...but... I didn't
University of Calgary,			| say anything....really! Well,
Computer Science Department		| nothing of any interest anyways.
(403)220-3538 or (403)220-5109 (office)	|

=========


Bill Wang
Speech & Hearing Center, Indiana University, Bloomington, IN 47405

UUCP  = {ihnp4,seismo,cbosgd}!iuvax!wcwang
CSNET = wcwang@indiana
ARPA  = wcwang@iuvax.cs.indiana.edu
Phone = (812) 335-0714