<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Jens Thoms Toerring wrote:
<blockquote cite="mid:20081019221727.GA27479@toerring.de" type="cite">
  <pre wrap="">Hi Serge,

   nice to have you back on board;-)

  </pre>
  <blockquote type="cite">
    <pre wrap="">My problem was when a user minimized the screen using the window
manager decoration I did not have a way of knowing whether I should
raise the window or not since no variable was set. Hence my need to
trap the iconify action from the window manager.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <pre wrap="">I tried using the "fl_form_is_visible(form);" call but it always
returns TRUE whether the form is on the display or minimized. Other
attempts proved fruitless. i.e checking "form-&gt;visible" and
"form-&gt;wm_border" variables.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <pre wrap="">The problem was resolved by using the "XGetWindowAttributes(fl_display,
win_mini, &amp;xwa);" call. This call fills the xwa structure and one
variable in that structure is "xwa.map_state". This is TRUE if the
window is on the display and FALSE if it is minimized or not on the
current display. A test of this variable after a caller event was all I
needed to know if I should set my variables and raise the window.&lt;br&gt;
    </pre>
  </blockquote>
  <pre wrap=""><!---->
The value of "form-&gt;visible" or the return value of the function
fl_form_s_visible() only get changed by calls of the fl_hide_form()
or fl_free_form() function but not by the window getting unmapped
when it's iconified (XForms doesn't deal with the Unmap/Map event
except by calling XRefreshKeyboardMapping() on a MappingNotify
event). So even when the window is in iconified state it's treated
as "visible". As you already found out you have to query the
window attributes to find out if the window is mapped (but note
that the "map_state" value isn't just a boolean, there are three
possible values it can have, IsUnmapped (0), IsUnviewable (1) and
IsViewable (2), the IsUnviewable value undicating that while the
window itself is mapped a parent window is unmapped so it's not
really shown on the screen). So the combination of "form-&gt;visible"
being set to FL_VISIBLE (or the corresponding return value of
fl_form_is_visible()) together with XGetWindowAttributes() telling
you that the window is not mapped looks like the best indication of
the window being in iconified state.
  </pre>
</blockquote>
I was wondering what the second state was. Thanks.<br>
<blockquote cite="mid:20081019221727.GA27479@toerring.de" type="cite">
  <pre wrap="">
Perhaps I should add a function with a name like fl_form_is_iconified()
to make it easier to check for this. While the name of the function
fl_form_is_visible() is a bit unlucky I wouldn't like to change its
behaviour since that might break programs that rely on it to tell you
if a form has been hidden by a call of fl_hide_form() etc. or not.</pre>
</blockquote>
You are right. The "fl_form_is_iconified()"is preferable.<br>
<br>
<blockquote cite="mid:20081019221727.GA27479@toerring.de" type="cite">
  <pre wrap=""> Or
do you need a callback for a form's window becoming iconified or de-
iconified?
  </pre>
</blockquote>
This type of callback would be very useful if it can be done. Not only
for my app but for any instance where a form is minimized or maximized.
Knowing a forms size has changed or is no longer visible would allow
for font changes if maximized, no visual work need be done if minimized
and do the work if returned to normal state. I am sure there are more
uses.<br>
<br>
<blockquote cite="mid:20081019221727.GA27479@toerring.de" type="cite">
  <pre wrap="">                              Best regards, Jens
  </pre>
</blockquote>
<br>
Thanks,<br>
<br>
Serge<br>
<div class="moz-signature">-- <br>
<meta content="text/html; " http-equiv="content-type">
<title>Signature</title>
<meta content="Serge Bromow" name="author">
<pre class="moz-signature" cols="72"><span
 style="font-weight: bold; font-family: times new roman,times,serif;">Serge Bromow</span>
<small style="font-family: times new roman,times,serif;">DineAmix Inc.
<a class="moz-txt-link-rfc2396E" href="mailto:serge@dineamix.ca">&lt;serge@dineamix.ca&gt;</a>
888 411-6636
Ottawa, Canada.</small>
<small><small>
<a class="moz-txt-link-freetext" href="http://www.dineamix.ca">http://www.dineamix.ca</a>

IMPORTANT NOTICE: This message is intended only for the use of the individual or entity to which it is addressed. The message may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify DineAmix Inc. immediately by email at <a class="moz-txt-link-abbreviated" href="mailto:postmaster@dineamix.ca">postmaster@dineamix.ca</a>.

</small><small>Thank you.</small></small> </pre>
</div>
</body>
</html>