From: Todd_Lewis@unc.edu (Todd M. Lewis)
Subject: Re: A lot of questions
Organization: UNC Office of Information Technology
Date: Mon, 11 Jan 1993 15:59:39 GMT

In article <a2bartel.726750456@rzdspc24>  
a2bartel@rzdspc24.informatik.uni-hamburg.de (Henner Bartels) writes:
>So now the questions:
> a) I wanna get informed, if the user (actually me) clicks on a
>    system-gadget. Example: If the User clicks on the Screen2Front
>    gadget, not the Screen2Front function shall be invoked, but
>    a screenselection list  will be displayed. To perform this,
>    I must know when a system gadget is clicked and the information
>    has to be `stolen` from the system, so that the system can`t
>    perform the original function.

There are several approaches which could give you hints that this
has happened, but nothing fool proof.  Nothing in the system supports
this type of operation.  Unless/until a method is provided by the
system, almost anything you come up with is practically guaranteed to break.

> b) Belonging to this, is there a way of telling the system that
>    one of it`s gadgets is clicked, when it is`nt really.

You can introduce your own input events into the input stream.  However,
there is no way to reliably tie these events to specific gadgets.

> c) I want to send messages to a window (better it`s controlling
>    process). e.g. I`ve got the address of a window, and want to tell
>    it that it should close.

If it has a close gadget and its IDCMP supports a WINDOWCLOSE message,
you could send it a fake IntuiMessage to that effect.  It will work
most of the time.  You will break often enough that you will regret it though.

> d) I also want to add a gadget in the menubar of any window
>    e.g. a gadget wich will call DisplayBeep() when pressed. The point
>    is that this gadget should be attached to any window (not only
>    the windows controlled by my specific task. For example
>    to support a minimize/maximize function for OS < 2.0

Again, a neat idea that will break under some circumstances no matter
how you do it.  You just can't do it reliably.

> e) How can I program a window-iconify mechanism. To be more
>    precise, what have I got to do, that the window-owner still
>    could draw into his window, even though it`s not displayed anymore.

You can't do it without breaking.  Sorry, I know these are not the
answers you wanted to hear, but people have been hacking around on
the Amiga since 1985 trying to add these "features" and every attempt
so far fails under one or more normal circumstances.

>Answers to one ore more (even better: all ;-]) questions will leed
>to extrem happiness. C-source will be welcomed.

Somehow I don't think you are happy with the answers to your questions.
You've obviously thought about user interactions in some detail
and you are probably a reasonably capable programmer to be willing
to tackle this level of problem.  Apply your skills to tools for
users and other programmers, and send your suggestions to
suggestions@cbmvax.commodore.com.
--
 _/_/_/  _/     Todd_Lewis@unc.edu          You can lead a horse to 
  _/    _/     utoddl@guitar.oit.unc.edu   Mohammad, but you can't make
 _/    _/_/_/                             a mountain drink a mole hill.