[comp.sys.amiga.tech] Window resource sharing?

cunniff@hpfcdc.HP.COM (Ross Cunniff) (02/15/89)

Two questions:

	1.  Is it legal for multiple windows to share the same
	    Menu list?

	2.  Is it legal for multiple windows to share the same
	    Gadget list?


My guesses:  1: Maybe (80% probability)		2: probably not


				Ross Cunniff
				Hewlett-Packard Colorado Languages Lab
				...{ucbvax,hplabs}!hpfcla!cunniff
				cunniff%hpfcrt@hplabs.HP.COM

peter@sugar.uu.net (Peter da Silva) (02/17/89)

In article <11640010@hpfcdc.HP.COM>, cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
> 	1.  Is it legal for multiple windows to share the same
> 	    Menu list?

Browser does this.
-- 
Peter "Have you hugged your wolf today" da Silva  `-_-'  Hackercorp.
...texbell!sugar!peter, or peter@sugar.uu.net      'U`

shf@well.UUCP (Stuart H. Ferguson) (02/19/89)

+-- peter@sugar.uu.net (Peter da Silva) writes:
| In article <>, cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
| > 	1.  Is it legal for multiple windows to share the same Menu list?
| Browser does this.

That doesn't answer the question.
	;-)
-- 
		Stuart Ferguson		(shf@well.UUCP)
		Action by HAVOC

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (02/20/89)

In article <11640010@hpfcdc.HP.COM> cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
>	1.  Is it legal for multiple windows to share the same
>	    Menu list?
>
	Possible, but problematic.  The NextMenu pointers will be going
every which way, depending on which Window last had the menu.  This is
important because, if the user manages to interact with the Menu in one of
the other Windows before you've chased down all the NextMenu elements, you
could get propelled into a brick wall.  Also, if you have CHECKIT MenuItems,
then one Window may change the state of the CHECKED flags behind the others'
back.

>	2.  Is it legal for multiple windows to share the same
>	    Gadget list?
>
	Again, possible, but problematic.  Largely for the same reasons.
However, because of the strange nature of the SELECTED bit in the current
release, it's much easier to get yourself into trouble.  It may *look*
highlighted, when in fact you just turned it off.

	Stu Ferguson would be able to comment more completely on the
subject, since he wrote Modeller 3D, which has multiple Windows using the
"same" Menus and Gadgets.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	INET: well!ewhac@ucbvax.Berkeley.EDU
 \_ -_		Recumbent Bikes:	UUCP: pacbell > !{well,unicom}!ewhac
O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor

shf@well.UUCP (Stuart H. Ferguson) (02/21/89)

+-- ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes:
| In article <11...M> cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
| >	1.  Is it legal for multiple windows to share the same Menu list?
| 	Stu Ferguson would be able to comment more completely on the
| subject, since he wrote Modeller 3D, which has multiple Windows using the
| "same" Menus and Gadgets.

I don't know the answer to the question of legality, but I did it by creating
new menus and gadgets for each window at run time.  Modeler can have any
number of windows of the same class but since the gadgets and menu checkmarks
may be in a different state for each window, I give them all their own private
structures.  I just made a set of statically declared Gadget structures as a 
prototype and wrote some code to make a copy for each new window.  Not too
difficult.

Menus were more complex, but for that I wrote a generic package for generating
new menu structures at run-time from a simple static specification.  I sent
that code to comp.sources.amiga so it should be generally available sometime.
-- 
		Stuart Ferguson		(shf@well.UUCP)
		Action by HAVOC

beh@caen.engin.umich.edu (Bob Hruska) (02/21/89)

From article <10780@well.UUCP>, by ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab):
> In article <11640010@hpfcdc.HP.COM> cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
>>	1.  Is it legal for multiple windows to share the same
>>	    Menu list?
>>
> 	Possible, but problematic.  The NextMenu pointers will be going
> every which way, depending on which Window last had the menu.  This is
.....

I've got a program in which several windows share the same Menu list, and 
when I deactivate a window and then reactivate it, its title changes to the
same title as the last window I opened.  Could this be the cause?  I hope
so, because otherwise I am hopelessly lost...


-- 
Bob Hruska   University of Michigan Computer Aided Engineering Network (CAEN)

INTERNET: beh@caen.engin.umich.edu
    UUCP: {umix|ucbvax|uunet}!caen.engin.umich.edu!beh

peter@sugar.uu.net (Peter da Silva) (02/21/89)

In article <10780@well.UUCP>, ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes:
> In article <11640010@hpfcdc.HP.COM> cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
> >	1.  Is it legal for multiple windows to share the same
> >	    Menu list?

> 	Possible, but problematic.  The NextMenu pointers will be going
> every which way, depending on which Window last had the menu.

If you have several windows open simultaneously, and treat it all as one
input stream, it's no problem.

> Also, if you have CHECKIT MenuItems,
> then one Window may change the state of the CHECKED flags behind the others'
> back.

This is, again, not a problem of you design the program to consider it one big
shared menu.
-- 
Peter "Have you hugged your wolf today" da Silva  `-_-'  Hackercorp.
...texbell!sugar!peter, or peter@sugar.uu.net      'U`

kevin@uts.amdahl.com (Kevin Clague) (02/21/89)

In article <3442@sugar.uu.net> peter@sugar.uu.net (Peter da Silva) writes:
>In article <11640010@hpfcdc.HP.COM>, cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
>> 	1.  Is it legal for multiple windows to share the same
>> 	    Menu list?
>
>Browser does this.

I do this also and it seems to work well.  This does not mean it is legal.
Maybe Jimm has the answer.

>-- 
>Peter "Have you hugged your wolf today" da Silva  `-_-'  Hackercorp.

Kevin
-- 
UUCP:  kevin@uts.amdahl.com
  or:  {sun,decwrl,hplabs,pyramid,seismo,oliveb}!amdahl!kevin
DDD:   408-737-5481
USPS:  Amdahl Corp.  M/S 249,  1250 E. Arques Av,  Sunnyvale, CA 94086

[  Any thoughts or opinions which may or may not have been expressed  ]
[  herein are my own.  They are not necessarily those of my employer. ]

kevin@uts.amdahl.com (Kevin Clague) (02/21/89)

In article <10780@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes:
>In article <11640010@hpfcdc.HP.COM> cunniff@hpfcdc.HP.COM (Ross Cunniff) writes:
>>	1.  Is it legal for multiple windows to share the same
>>	    Menu list?
>>
>	Possible, but problematic.  The NextMenu pointers will be going
>every which way, depending on which Window last had the menu.  This is
>important because, if the user manages to interact with the Menu in one of
>the other Windows before you've chased down all the NextMenu elements, you
>could get propelled into a brick wall.  Also, if you have CHECKIT MenuItems,
>then one Window may change the state of the CHECKED flags behind the others'
>back.

Good point.  Could MENUVERIFY help?  i.e. I catch the right mouse button
and then present the menu when the user pushes the button?  Does this not
solve the problem since the user can't use the menu until I give it to
her?

I don't believe there is a similar situation for gadgets....

>Leo L. Schwab -- The Guy in The Cape	INET: well!ewhac@ucbvax.Berkeley.EDU

Kevin
-- 
UUCP:  kevin@uts.amdahl.com
  or:  {sun,decwrl,hplabs,pyramid,seismo,oliveb}!amdahl!kevin
DDD:   408-737-5481
USPS:  Amdahl Corp.  M/S 249,  1250 E. Arques Av,  Sunnyvale, CA 94086

[  Any thoughts or opinions which may or may not have been expressed  ]
[  herein are my own.  They are not necessarily those of my employer. ]