Subject: FVWM: Track->Scheduler and own functions

From: Mario Domgörgen <[email-masked]>
Date: Thu, 22 Jan 2004 10:57:53 +0100

Hello list!

I use the following code to update a GnomeIcuPanel in my ButtonBar:
,----
| 
| #!/usr/bin/perl -w
| 
| use lib `fvwm-perllib dir`;
| use FVWM::Module;
| 
| my %status_symbols =
|   ("Online" => "/home/drache/.icq/icons/Windows ICQ/gnomeicu-online.png",
|    "Offline" => "/home/drache/.icq/icons/Windows ICQ/gnomeicu-offline.png",
|    "Away" => "/home/drache/.icq/icons/Windows ICQ/gnomeicu-away.png",
|   );
| 
| my $module = new FVWM::Module();
| 
| my $scheduler = $module->track("Scheduler");
| $scheduler->schedule(2,gnomeicu_update);
| 
| sub gnomeicu_update {
|   my $status = `gnomeicu-client icuask`;
|   if ($status =~ /^(.+?)\s(.+?)\s(.+?)\s.*/s) {
|     $module->send("SendToModule GnomeIcu ChangeButton icon Icon \"$status_symbols{$1}\"");
|     $module->send("SendToModule GnomeIcu ChangeButton icon Title " . $2 +1);
|   }
|   $scheduler->reschedule;
| }
| 
| $module->send("Module FvwmButtons GnomeIcu");
| 
| gnomeicu_update()
`----

The first call of gnomeicu_update() at the end of the script is called
but not the one in the scheduler?

I'm a straigt perl newbie so there might be a really dumb error... :)

Greetings!

Mario

-- 
You step in the stream,
but the water has moved on.
This page is not here.

--
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: Thu, 22 Jan 2004 10:34:38 +0000

> I use the following code to update a GnomeIcuPanel in my ButtonBar:
...
> but not the one in the scheduler?

How do you name and run your module? Currently for Scheduler tracker and
some other things to work, you should place your module in
$FVWM_MODULEDIR or ModulePath and run "Module module". Invoking it as
"Module /full/path/to/your/module" should fail. I plan to improve the way
Module and SendToModule work in fvwm later, so the last form works too.

If this does not help, add (Debug => 2) to your module constructor and
send the output.

Regards,
Mikhael.

---

From: Mario Domgörgen <[email-masked]>
Date: Thu, 22 Jan 2004 17:00:04 +0100

> If this does not help, add (Debug => 2) to your module constructor and

Not very sure about how to debug fvwm and send you a backtrace, i found
FvwmDebug (doh!) and my $module = new FVWM::Module(Debug =>2); get me
the following backtrace:

,---- 
| [FvwmDebug]: got M_ADD_WINDOW
| M_ADD_WINDOW
| 	win_id       0x1c00001
| 	frame_id     0x0800395
| 	ptr          3221222712
| 	frame_x      0
| 	frame_y      0
| 	frame_width  40
| 	frame_height 24
| 	desk         0
| 	layer        4
| 	title_height 0
| 	border_width 0
| 	win_width    0
| 	win_height   0
| 	resize_width_inc   1
| 	resize_height_inc  1
| 	minimum_width      1
| 	minimum_height     1
| 	maximum_width      32767
| 	maximum_height     32767
| 	icon_title_id      0x0000000
| 	icon_image_id      0x0000000
| 	gravity      1
| 	fore_color   rgb:00/ff/ff
| 	back_color   rgb:00/84/10
| 	ewmh_layer   4294967295
| 	ewmh_desktop 0
| 	ewmh_window_type   0
| 	window_flags [window flags are not supported yet]
| [FvwmDebug]: got M_WINDOW_NAME [GnomeIcu]
| M_WINDOW_NAME
| 	win_id       0x1c00001
| 	frame_id     0x0800395
| 	ptr          135487384
| 	name         "GnomeIcu"
| [FvwmDebug]: got M_RAISE_WINDOW
| M_RAISE_WINDOW
| 	win_id       0x1c00001
| 	frame_id     0x0800395
| 	ptr          135487384
| [FvwmDebug]: got M_RES_CLASS [FvwmButtons]
| M_RES_CLASS
| 	win_id       0x1c00001
| 	frame_id     0x0800395
| 	ptr          135487384
| 	name         "FvwmButtons"
| [FvwmDebug]: got M_RES_NAME [GnomeIcu]
| M_RES_NAME
| 	win_id       0x1c00001
| 	frame_id     0x0800395
| 	ptr          135487384
| 	name         "GnomeIcu"
| [FvwmDebug]: got M_MAP
| M_MAP
| 	win_id       0x1c00001
| 	frame_id     0x0800395
| 	ptr          135487384
| [FvwmDebug]: got M_MAP
| M_MAP
| 	win_id       0x1c00001
| 	frame_id     0x0800395
| 	ptr          135487384
| [FvwmDebug]: got M_RAISE_WINDOW
| M_RAISE_WINDOW
| 	win_id       0x1800010
| 	frame_id     0x0800321
| 	ptr          135486136
| [FvwmDebug]: got M_RAISE_WINDOW
| M_RAISE_WINDOW
| 	win_id       0x1800010
| 	frame_id     0x0800321
| 	ptr          135486136
`----

Mario

-- 
Error messages
cannot completely convey.
We now know shared loss.

---

From: Shay Hill <[email-masked]>
Date: Thu, 22 Jan 2004 10:42:07 -0600

Mikhael Goikhman wrote:

I apologize again about the personal email, Mikhael. Again, it was 
unintentional.

Colorful:
http://www.simcoparts.com/pics/fvwmcolorful.jpg

Looks good on dark:
http://www.simcoparts.com/pics/fvwmondark.html

 -Shay

---

From: Johan Svedberg <[email-masked]>
Date: Thu, 22 Jan 2004 18:01:30 +0100

* Jan 22 17:45 Shay Hill <[email-masked]>:

[...]

> Colorful: http://www.simcoparts.com/pics/fvwmcolorful.jpg
>
> Looks good on dark: http://www.simcoparts.com/pics/fvwmondark.html

Wow, those looked very good!

-- 
Johan Svedberg, [email-masked], http://johan.svedberg.pp.se/

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 22 Jan 2004 17:30:22 +0000

> FvwmDebug (doh!) and my $module = new FVWM::Module(Debug =>2); get me

I meant a debug trace of your module, not fvwm. This Debug line is ok.
Just restart fvwm (to ensure all additional noisy modules are killed),
optionally run your module from FvwmConsole if not yet, and paste the
output you find in the X output file. Or just post your whole module.

Regards,
Mikhael.

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 22 Jan 2004 17:38:24 +0000

> Wow, those looked very good!

Yes, very nice.

Is it possible to make also an alpha blended PNG version instead of the
current JPG on the black background, so it looks good on any dark (or
even light) background, not just black?

Regards,
Mikhael.

---

From: Mario Domgörgen <[email-masked]>
Date: Thu, 22 Jan 2004 21:42:17 +0100

> output you find in the X output file. Or just post your whole module.

,---- 
| [gnomeicu]: sent [SET_MASK 0]
| [gnomeicu]: sent [SET_SYNC_MASK 0]
| [gnomeicu]: observe "scheduled alarm"
| [gnomeicu]: sent [Schedule 2000 8778153 SendToModule gnomeicu FVWM::Tracker::Scheduler alarm 1]
| [gnomeicu]: sent [Module FvwmButtons GnomeIcu]
| [gnomeicu]: sent [SendToModule GnomeIcu ChangeButton icon Icon "/home/drache/.icq/icons/Windows ICQ/gnomeicu-away.png"]
| [gnomeicu]: sent [SendToModule GnomeIcu ChangeButton icon Title 0]
| GnomeIcu: Cannot create a title, only change one
`----

I hope that is the right backtrace.... :)

Mario

-- 
A file that big?
It might be very useful.
But now it is gone.

---

From: Mario Domgörgen <[email-masked]>
Date: Thu, 22 Jan 2004 21:43:32 +0100

> output you find in the X output file. Or just post your whole module.

Oh, sorry i missed that sentence ... i posted the whole module! :) I
just code it up and get stung up with the scheduler problem... so that
was all there is to see yet.

Mario

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 22 Jan 2004 21:11:12 +0000

> | GnomeIcu: Cannot create a title, only change one

This last error means you didn't define Title property in you FvwmButtons
button having id "icon". So, you are not able to change the non existing
title to "0" as shown above.

> I hope that is the right backtrace.... :)

Yes, this is right, and you may see there are only "sent (to fvwm)" and
no single "got (from fvwm)". Your module immediatelly exits after
reaching the end. This is not what you want. You want to make it
persistent by entering the event loop:

  $module->eventLoop;

So just add this line to the end of your module. You configured the
scheduler tracker so every 2 seconds it communicates with fvwm and
updates your FvwmButtons. So the debug output will be pretty verbose.

To break the event loop, do $module->terminate from any event handler.
Otherwise your module lives forever until fvwm closes a pipe to it on
exit or on KillModule, this is probably what you want.

Regards,
Mikhael.

---

From: Mario Domgörgen <[email-masked]>
Date: Thu, 22 Jan 2004 22:27:52 +0100

First, thank you, the missing $module->eventLoop was the problem, i
thought because of not wanting data from Fvwm i could leave that
out... So, i got the next error, but this time i bet it's totally perl
related...

,---- 
| Can't use string ("gnomeicu_update") as a subroutine ref while "strict
| refs" in use at
| /usr/local/stow/fvwm-2.5.8/share/fvwm/perllib/FVWM/Tracker/Scheduler.pm
| line 57.
`----

In your example on the manpage you used a small sub in place of the
callback, but that will be harder to read for my subroutine, so i'm not
sure what to do about that?! I try &gnomeicu_update and
&gnomeicu_update() but i haven't worked in both cases...

And let thank you again for your help!

Mario

-- 
One Editor to rule them all.  One Editor to find them,
One Editor to bring them all and in the darkness bind them.

(do ((a 1 b) (b 1 (+ a b))) (nil a) (print a))

---

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 22 Jan 2004 21:53:38 +0000

On 22 Jan 2004 22:27:52 +0100, Mario Domg?rgen wrote:
> sure what to do about that?!

You may still use the syntax from the example:

  sub { gnomeicu_update(); }

But of course, you may make gnomeicu_update to be a callback directly.

> I try &gnomeicu_update and

Both of these call the function.

Use \&gnomeicu_update as a reference to the function.

Regards,
Mikhael.

---

From: Shay Hill <[email-masked]>
Date: Thu, 22 Jan 2004 16:35:45 -0600

>even light) background, not just black?
http://www.simcoparts.com/pics/alphafvwm.html

 -Shay

---

From: Mario Domgörgen <[email-masked]>
Date: Thu, 22 Jan 2004 23:39:00 +0100

> Use \&gnomeicu_update as a reference to the function.

/me is happy now, it works!

Thanks!

Mario

-- 
Yesterday it worked
Today it is not working
Windows is like that

---

From: Julian Finn <[email-masked]>
Date: Fri, 23 Jan 2004 03:32:55 +0100

Hi List, 

I have following Problem: 

want to compile fvwm 2.5.8 on my new Debian 2.6.1 system. 
Now I have freetype2 installed and I have this fontconfig-config-script in /usr/bin. But nevertheless configure tells me, I don't have it installed. 
(the freetype test program failed to run. if your system uses shared libraries and they are installed outside the normal system library path, make sure the variable LD_LIBRARY_PATH (or whatever is appropriate for your system) is correctly set). 
I use a normal Debian, so that shouldn't be...
No Idea what, but fvwm definately doesn't look so nice without.. 
Anybody have an Idea? 

Please let me know :)

Cheers, 

Julian

---

From: stu <[email-masked]>
Date: Fri, 23 Jan 2004 11:29:52 +0200

On Thu, 22 Jan 2004 18:01:30 +0100

> Wow, those looked very good!

Awesome design! I see feline influence runs strong in fvwm. I
recently discovered the fvwm-cats page and thoroughly enjoyed it. I am
owned by two - Mugwort and Tibbins. Their Mom (a feral cat) wandered in
off the street one day and insisted on gifting me with her offspring.
Life has been very different since . . . :)

-- 
Stuart Logie
Programmer

UNIVERSAL COMPUTER SERVICES (PTY) LTD
A member of South Africa's largest retail software vendor, the UCS Group

Tel : (011) 712 1371   Cell : 082 902 5632
Fax : (011) 339 3421
Internet : http://ucs.co.za

"I am the Unconquerable Spirit."
               -- Poet Unknown
   
Powered by Debian GNU/Linux - testing/unstable

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 23 Jan 2004 11:04:39 +0100

> Life has been very different since . . . :)

Then don't hesitate and send some pictures and a short
accompanying text to add to the cats page :-D

Ciao

Dominik ^_^  ^_^

---

From: stu <[email-masked]>
Date: Fri, 23 Jan 2004 12:47:21 +0200

On Fri, 23 Jan 2004 11:04:39 +0100
Dominik Vogt <[email-masked]> wrote:

> > recently discovered the fvwm-cats page and thoroughly enjoyed it. I
> > am owned by two - Mugwort and Tibbins. Their Mom (a feral cat)
> > wandered in off the street one day and insisted on gifting me with
> > her offspring. Life has been very different since . . . :)
> 

I will have to ask my cats of course ;) but I think they will be
honoured and delighted!

-- 
Stuart Logie
Programmer

---

From: Perry Hutchison <[email-masked]>
Date: Fri, 23 Jan 2004 10:37:27 -0800 (PST)

> Their Mom (a feral cat) wandered in off the street one day and
> insisted on gifting me with her offspring.  Life has been very
> different since . . . :)

My guess is that Mom was not born feral -- more likely she had
accepted an independent lifestyle after being abandoned -- or she
would not have considered a human habitation to be a safe place.

If you haven't seen her since, she may have returned to the place
from which she got booted when they found out she was expecting.
--
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: Shay Hill <[email-masked]>
Date: Fri, 23 Jan 2004 15:57:01 -0600

>even light) background, not just black?
alpha-blended logo for light (warm) background.
http://www.simcoparts.com/pics/alphafvwmlt.html

 -Shay