On Wed, 21 Jan 2015, Thomas Adam wrote:
On Wed, Jan 21, 2015 at 02:23:21PM +0100, Lucio Chiappetti wrote:
On Wed, 21 Jan 2015, Thomas Adam wrote:


This is why you use FvwmEvent and the SendToModule directive:

        DestroyModuleConfig FE-UpdateDeskNum
        *FE-UpdateDeskNum: new_desk NewFunc

        DestroyFunc NewFunc
        AddToFunc   NewFunc
        + I SendToModule MyDesk0 ChangeButton desklabel Title $0

in fact I do not understand ho FvmwEvent passes argument $0 to the function
!!

As for your other problem, see: $[desk.n] and: $[desk.name$[desk.n]]
You should really pass those to 'NewFunc'.

not really "pass", more "hardcode" so they are automatically expanded !

With the code above, doing "NewFunc anything" was correctly changing the label to argument anything.

I tried "calling NewFunc from FvwmEvent with desktop as argument"

mod     DestroyModuleConfig FE-UpdateDeskNum
mod     *FE-UpdateDeskNum: new_desk NewFunc $[desk.n]

but that is WRONG
the correct way is instead

mod     AddToFunc   NewFunc
mod     + I SendToModule MyDesk0 ChangeButton desklabel Title "desk
                                                        $[desk.n]"

I was aware of the $-variables, only I noted that inserting them in menus or buttons, the value at the moment of the menu or button defintion was used. Instead for the function, the value at the moment of function call is used !

So it works, even with desktop names (the only provision is that the button title shall be created at beginning with a string long enough to cater for the longest value it would receive in the future)

--
------------------------------------------------------------------------
Lucio Chiappetti - INAF/IASF - via Bassini 15 - I-20133 Milano (Italy)
For more info : http://www.iasf-milano.inaf.it/~lucio/personal.html
------------------------------------------------------------------------
Do not like Firefox >=29 ?  Get Pale Moon !  http://www.palemoon.org

Reply via email to