Subject: FVWM: FvwmButtons Icon change on button click

From: "subbiah .L" <[email-masked]>
Date: Sun, 19 Jan 2003 15:18:51 +0530

Hello,

I am using Suse Linux 6.4 with fvwm 2.4.3. I am having default windows 95 
style in my desktop. If I press some BarButtons(using FvwmButtons), then the 
Icon has to change. (i.e) If the application is opened, then the icon has to 
change to some other to indicate the application is opened. Is it possible 
with fvwm?. If so please help me.

With Thanks and Regards,
L. Subbiah

_________________________________________________________________
Help STOP SPAM: Try the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 20 Jan 2003 11:40:16 +0000

On 19 Jan 2003 15:18:51 +0530, subbiah .L wrote:
> style in my desktop. If I press some BarButtons(using FvwmButtons), then 
> the Icon has to change. (i.e) If the application is opened, then the icon 
> has to change to some other to indicate the application is opened. Is it 
> possible with fvwm?. If so please help me.

If you use 2.5.4+, you may do this, see the man page of FvwmButtons.
In short you should use:

  SendToModule FvwmButtons ChangeButton my_button Icon new_icon.png, ...

whenever you want to change an icon.

I would use FvwmEvent in your case, on add_window you may change the icon
and on destroy_window you may restore it. Something like:

  *FvwmEvent: Cmd
  *FvwmEvent: PassId
  *FvwmEvent: add_window     SetButton1IconTo new_image.png
  *FvwmEvent: destroy_window SetButton1IconTo old_image.png

  AddToFunc SetButton1IconTo
  + I WindowId $1 ("my_app") SendToModule FvwmButtons \
	ChangeButton button1 Icon $0

Sorry, this is not tested, but I think it should work.

Regards,
Mikhael.