scotties:
doug had posted a concern about the wm's tkined icon flash. i
made some simple changes to tkiFlash.c to correct it -- letting
you have the option of it flashing or not.
it can be toggled on/off via a resource in your tkined.defaults
file.
tkined.wmIconFlash: true
or
tkined.wmIconFlash: false
i've included the source code -- please save your old copy
and verify it before changing -- it works for me on my
box { sunos5.5 }. If there is a better way please let me
know.
- billa
ps: of course, if you don't want any of it just change the
#if 1 to #if 0.
-- ---------------------------|------------------------------- Bill Anderson | First Union / One First Union 704-383-7191 (voice) | 301 S. College Street, TW7/NC0116 email: banderso@funb.com | Charlotte, NC ----------------------------------------------------------- http://cmwww2.capmark.funb.com/~banderso/ ---------------------------|-------------------------------
******************* NOTE ******************* There may be important message content contained in the following MIME Information. ********************************************
------------------ MIME Information follows ------------------
-- --PART-BOUNDARY=.19610220834.ZM19154.funws230 Content-Type: text/plain; charset=us-ascii<<<<<< See above "Message Body" >>>>>>
--PART-BOUNDARY=.19610220834.ZM19154.funws230 X-Zm-Content-Name: tkiFlash.c Content-Type: text/plain ; name="tkiFlash.c" ; charset=us-ascii
/* * tkiFlash.c -- * * Some utility functions to implement flashing icons. * * Copyright (c) 1995-1996 Technical University of Braunschweig. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */
#include "tkined.h" #include "tkiPort.h"
typedef struct FlashItem { char *id; struct FlashItem *nextPtr; } FlashItem;
/* added resource for window mgr. flash */ static char* TopIconFlash = "wmIconFlash"; static FlashItem *flashList = NULL;
/* * Forward declarations for procedures defined later in this file: */
static void FlashProc _ANSI_ARGS_((ClientData clientData));
/* * The FlashProc callback flashes every object in the flashList * and calls it again if there are any jobs left. */ static char *argv[2];
static void FlashProc (clientData) ClientData clientData; { Tcl_Interp *interp = (Tcl_Interp *) clientData; Tki_Object *object; char *color; FlashItem *p; int max = 0;
Tk_Window window; Tk_Window tkwin = Tk_MainWindow(interp);
for (p = flashList; p != NULL; p = p->nextPtr) {
if (p->id == NULL) continue;
object = Tki_LookupObject (p->id); if (object == NULL) continue;
window = Tk_NameToWindow(interp, object->editor->toplevel, tkwin); if (! window) { continue; }
if (! object->editor->color) { if ((object->flash) % 2) { color = "black"; } else { color = "white"; } } else { color = object->color; if ((object->flash) % 2) { if (strcasecmp(color, "white") == 0) color = "black"; } else { color = "white"; } }
Tcl_VarEval (interp, type_to_string (object->type), "::color ", object->id, " ", color, (char *) NULL);
#if 1
if (object->editor) { /* get window manager resource to flash or not */ Tki_EditorAttribute( object->editor, interp, 1, &TopIconFlash); /* do we flash the window manager * will recognize the first character as a boolean */ if ( (*interp->result != '\0') && ( (*interp->result == 't' ) || (*interp->result == 'T' ) || (*interp->result == '1' ) ) ) { char *buf = (object->flash % 2) ? "icon" : "noicon"; Tcl_VarEval(interp, "if ![winfo ismapped ", object->editor->toplevel, "] {", "wm iconbitmap ", object->editor->toplevel, " ", buf, "}", (char *) NULL); } } #endif
object->flash -= 1;
if (object->flash == 0) { notrace (m_color, interp, object, 1, &object->color); ckfree (p->id); p->id = NULL; }
max = ( object->flash > max ) ? object->flash : max; }
if (max <= 0) { /* everything is done - remove the flashList */
FlashItem *q;
for (p = flashList; p != NULL; p = q) { q = p->nextPtr; if (p->id != NULL) ckfree (p->id); ckfree ((char *) p); }
flashList = NULL; }
Tcl_Eval (interp, "update");
if (max > 0) { Tk_CreateTimerHandler (500, FlashProc, (ClientData) interp); } }
/* * Add a new flash node to our list of flashing objects. * Start flash callback if we create the first entry. */
void flash (interp, object) Tcl_Interp *interp; Tki_Object *object; { FlashItem *p;
if (flashList == NULL) { flashList = (FlashItem *) ckalloc (sizeof(FlashItem)); p = flashList; p->id = ckstrdup(object->id); p->nextPtr = NULL; Tk_CreateTimerHandler (500, FlashProc, (ClientData) interp);
} else {
/* * Move to the end of the list and check if it exists already. */
for (p = flashList; p->nextPtr != NULL; p = p->nextPtr) { if (p->id && strcmp (p->id, object->id) == 0) return; } if (p->id && strcmp (p->id, object->id) == 0) { return; }
/* * Create a new entry for the flash list. */
p->nextPtr = (FlashItem *) ckalloc (sizeof(FlashItem)); p = p->nextPtr; p->id = ckstrdup(object->id); p->nextPtr = NULL; } }
--PART-BOUNDARY=.19610220834.ZM19154.funws230--
------------------ RFC822 Header Follows ------------------ Received: by qmgate.cc.oberlin.edu with ADMIN;22 Oct 1996 20:32:19 -0400 Received: from first.firstunion.com [204.116.54.6] by ra.ibr.cs.tu-bs.de (8.6.10/tubsibr) with SMTP id OAA07757 for <tkined@ibr.cs.tu-bs.de>; Tue, 22 Oct 1996 14:34:38 +0200 Received: by firstunion.com (4.1/SMI-4.1) id AA17020; Tue, 22 Oct 96 08:34:21 EDT Received: from cm_mailhost.capmark.funb.com(168.175.82.50) by first-capmark.firstunion.com via smap (V1.3) id sma017015; Tue Oct 22 08:34:04 1996 Received: from funws230.capmark.funb.com (funws230 [168.175.7.42]) by cm_mailhost.capmark.funb.com (8.7.5/8.7.3) with ESMTP id IAA17164 for <tkined@ibr.cs.tu-bs.de>; Tue, 22 Oct 1996 08:34:03 -0400 (EDT) From: Bill Anderson <banderso@funb.com> Received: (banderso@localhost) by funws230.capmark.funb.com (8.6.12/8.6.12) id IAA19156 for tkined@ibr.cs.tu-bs.de; Tue, 22 Oct 1996 08:34:02 -0400 Date: Tue, 22 Oct 1996 08:34:02 -0400 Message-Id: <9610220834.ZM19154@funws230> X-Mailer: Z-Mail (3.2.1 10apr95) To: tkined@ibr.cs.tu-bs.de Subject: Stopping the wm's icon from flashing Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="PART-BOUNDARY=.19610220834.ZM19154.funws230"