Problem with FvwmButtons and FvwmScript

Here is small script called clock.fvwm:

WindowTitle {clock}
WindowSize  40 18
Font "Shadow=0 se:xft:HandelGothic BT:encoding=iso10646-1:size=7"
Colorset 90

Init
 Begin
   Set $display= time

Set $tmp = (GetOutput {exec date "+%R"} 1 -1)

  ChangeTitle 1 $tmp
End

PeriodicTasks
 Begin 
  If (RemainderOfDiv (GetTime) 60)==0 Then
  Begin

Set $tmp = (GetOutput {exec date "+%R"} 1 -1)

    ChangeFont 1 {Shadow=0 se:xft:HandelGothic BT:encoding=iso10646-1:size=7}
    ChangeTitle  1 $tmp
  End
End

Widget 1
Property
 Position 0 0
 Size 40 18
 Type ItemDraw
 Flags NoReliefString
 Title {}
 Colorset 90
Main
 Case message of
  SingleClic :
  Begin
    If $display=={time} Then
    Begin
      Set $display= date
      ChangeFont 1 {Shadow=1 se:xft:HandelGothic BT:encoding=iso10646-1:size=7}
      Set $tmp = (GetOutput {exec date "+%d/%m"} 1 -1)
    End
    Else
    Begin
      Set $display= time
      ChangeFont 1 {Shadow=1 se:xft:HandelGothic BT:encoding=iso10646-1:size=7}
      Set $tmp = (GetOutput {exec date "+%R"} 1 -1)
    End
    ChangeTitle  1 $tmp
  End
End

I made window which swallows that script:

DestroyModuleConfig zegar: *
*zegar: Colorset 90
*zegar: ActiveColorset 90
*zegar: Padding 0 0
*zegar: Frame 0
*zegar: Rows 18
*zegar: Columns 40
*zegar: Geometry 40x18+100+100
*zegar: (40x18, Swallow "Clock" 'Module FvwmScript $[FVWM_USERDIR]/skrypty/clock.fvwm')

It doesn’t work (i’ve got two windows), but size of both windows are the same. Could someone tell me why?

greetings

The size of the windows is easy to answer as the size is defined as the same for both of them. With respect to why two windows instead of one, I do not have a clear answer. Nevertheless, could you check the window information of the created ‘clock’ window with, for example, FvwmIdent (or ‘xwininfo’, ‘xprop’)? Also, how do you activate the module you have defined? Is this a FvwmButtons?

Cheers!

I added this line to my config:

[code]
AddToFunc StartFunction

  • I Module FvwmButtons zegar[/code]

Here is screenshot with FvwmIdent:

http://img391.imageshack.us/img391/7096/desktopqd3.png

I also tried enhance size of window “zegar”, but it doesn’t work too…

I have copied your script, adapted one of my fvwmbuttons (to FvwmButtonsClock) and issue this commands in FvwmConsole:

read /home/joanet/.fvwm/conf/FvwmButtonsClock Module FvwmButtons FvwmButtonsClock

At this point, FvwmButtons module appears without the clock. After issuing:

Module FvwmScript $./conf/clock.fvwm

The clock appears in FvwmButtonsClock.

This is what I have in FvwmButtonsClock

DestroyModuleConfig FvwmButtonsClock: * *FvwmButtonsClock: Rows 1 *FvwmButtonsClock: Columns 2 *FvwmButtonsClock: Geometry 150x150+90+90 *FvwmButtonsClock: Colorset 8 *FvwmButtonsClock: Pixmap "none" *FvwmButtonsClock: Padding 0 0 *FvwmButtonsClock: Frame 0 *FvwmButtonsClock: (1x1, Icon kmix.png), Action (Mouse 1) 'Exec kmix') *FvwmButtonsClock: (1x1, Swallow "clock.fvwm" 'Module FvwmScript $./conf/clock.fvwm')

Therefore:
a) Is it possible that the clock script is executed before FvwmButtons module?
b) Could you try issuing the commands through FvwmConsole to see if you get similar results.

If this is the case, we narrow the issue to the FvwmButtons swallow command.

Cheers!

This entire thread is an odd contradiction. First of all you had this:

*zegar: (40x18, Swallow "Clock" 'Module FvwmScript $[FVWM_USERDIR]/skrypty/clock.fvwm')

Which is clearly wrong, since the actual name of the FvwmScript module is “clock” and NOT “Clock”. And now, after some mythical refinement which isn’t seemingly public, you now have:

*FvwmButtonsClock: (1x1, Swallow "clock.fvwm" 'Module FvwmScript $./conf/clock.fvwm')

AFAICT based on the rather sketchy implementations in this thread, you really meant:

*zegar: (40x18, Swallow "clock" 'Module FvwmScript $[FVWM_USERDIR]/skrypty/clock.fvwm')

(FvwmButtons alias notwithstanding, of course.)

With regards to your assertion of a) above, the answer is no since you’re asking it to be spawned with FvwmButtons, but c.f. the Swallow condition of “UseOld” and “SwallowNew”.

There’s nothing to narrow down.

Bark yes, but please make sure it’s up the right tree.

– Thomas Adam

Thanks! Now it works of course. I’m always forgetting about small things like this…

I am sorry. Copied the script, adapted one of my fvwmbuttons and got the script inside the buttons. I will do better next time. :wink: :smiley:

Cheers!