[comp.windows.x] Xtk Iconic State

billa@edsews.EDS.COM (bill anderson) (07/29/88)

       I am a relative novice xtk programmer and I seeking some
   possible directions on the following ...

 
          I would like a widget to be initially in an 
          IconicState and have the ability to recieve
          and handle events from this Icon. I wish to
          use xtk and not xlib. However,I believe
          I cannot guarantee events from an Icon, or
          can I ? 

          I realize how to handle events from a widget(window)
          in a NormalState, but how would I do it in an
          IconicState without writing my own event handler
          ( like XtMainLoop ) or using xlib. Possible ??

         ( This assumes a Window Manager is running )

                            
                         Thanks in advance for the insight.
-- 

Arpanet: billa@edsews.eds.com     |  " ... one man gathers
UUCP:  uunet!edsews!billa         |        what another man spills ... "

haynes@WSL.DEC.COM (07/31/88)

I don't understand your question. Widgets aren't ever iconic. A given
window manager may put up an icon for your appliction when the
application is not active, but the icon belongs to the window manager,
and while the icon is up your application windows are "non-viewable".
That is the root window of your application is unmapped, or, in the
case of a "reparenting" window manager, some ancestor window of your
application's top level window is unmapped.

Since the window manager owns the icon window, there is no easy way for
you to do any event processing on the icon. Now there are (may be) some
window managers that let the application provide a window for the icon,
in which case you would simply (!) create a popup widget for the icon,
and pass the window manager the window for that icon.

If the window manager instead is willing to tell you about the icon
window, but is not willing to let you pass the window in yourself, you
need to provide a new subclass of some widget class that has a special
realize proc that doesn't create the window for the widget, but instead
takes the window manager window and configures it to match the
parameters passed in to the realize.

Clear? If not, please feel free to ask more.

	-- Charles

ellis@AUDI.SIEMENS.COM (Ellis Cohen) (08/02/88)

> I would like a widget to be initially in an 
> IconicState and have the ability to recieve
> and handle events from this Icon. I wish to
> use xtk and not xlib. However,I believe
> I cannot guarantee events from an Icon, or
> can I ? 

Some information and warnings from the window manager
point of view:

You can arrange for a specific window to be used as an
icon for a top-level window by setting the icon_window
field in the top-level window's WM_HINTS property
(see section 9.1.5 of the Xlib manual).

Window managers are supposed to use that window as (or in)
the icon for the top-level window.  At present, some
do and some don't.  It is expected that more and more will
do so in the future.

Unfortunately, there is no guarantee or requirement that input
to the icon window will be passed along to the client.  Most
wm's will preeempt at some least some inputs as triggering window
manager functions.  For example, most wm's will interpret a click of
some button to mean deiconize (i.e. map the top-level window).

However, many wm's will pass at least some input events on to the
client, however, there is no telling which ones.  For example,
our wm passes through all keypress and keyrelease events, and
passes through left or right button presses which have either
the SHIFT or CTRL button pressed (but not both).  It uses other
button events for wm-related purposes, such as deiconizing,
moving the icon, redrawing it, etc.  Other wm's have their
own conventions.

At the very least, for portability, you should treat all buttonpress
events you do receive in an icon as having the same effect, since
you don't know which ones you'll actually get.  If you want to trigger
different functions when you're iconic, bring up a popup menu.

  Ellis Cohen
  Siemens RTL Tiled Window Project