SendToModule change Title accepts no blank

I have a function, to change the title of a button in FvwmButton.

  • I SendToModule FvwmButton ChangeButton $0 Title " $1 $2"

But the function doesn´t accept the blank as a first charakter. How ca i do this right?

regards scientific

Sure it does. What do $1 and $2 expand to in this context?

– Thomas Adam

$1 expands to “Volume (” and $2 expands to " xx%)"
But i need a blank before “Volume” so it looks as " Volume", and this doesn´t work.

I tried $1 as " Volume" and like above " $1 $2", but the first blank ist missing in every case…

look at the “Volume”-Button. I hope, you can see the pic.

scientific

Right – completely different problem to what you were describing.

Well done.

Can I have the FvwmButtons config which shows this problem?

– Thomas Adam

*FvwmButton: (22x2, Title(Side) " Audio Mixer", Center, Id “Vol”, Icon stock_volume.png, Action(Mouse 1) Exec exec gnome-alsamixer,
Action(Mouse 4) Exec amixer -q -c 0 -- sset Master 2+,
Action(Mouse 5) Exec amixer -q -c 0 -- sset Master 2-,
Action(Mouse 3) Exec amixer -q -c 0 -- sset Master toggle)

DestroyFunc CHANGE_TITLE
AddToFunc CHANGE_TITLE

  • I SendToModule FvwmShelf ChangeButton $0 Title " $1 $2"

And the part of the Script calling this function:

If $mute == on Then
Begin
If $chvol == 1 Then
Begin
If $volume == 0 Then
Do {CHANGE_ICON Vol audio-volume-muted.png}
If $volume > 0 Then
Do {CHANGE_ICON Vol audio-volume-low.png}
If $volume >= 33 Then
Do {CHANGE_ICON Vol audio-volume-medium.png}
If $volume >= 66 Then
Do {CHANGE_ICON Vol audio-volume-high.png}
Do {CHANGE_TITLE Vol " "Volume (} $volume {%)}
End
End
Else
Begin
If $chmute == 1 Then
Do {CHANGE_ICON Vol audio-volume-muted.png}
End

The Problem still exists…

and unfortunately, i have no solution for it… :frowning:

greetz

scientific

And the Problem STILL exists… I played around in a FvwmConsole a little with

SendToModule FvwmShelf ChangeButton Vol Title " Test" SendToModule FvwmShelf ChangeButton Vol Title " Test" SendToModule FvwmShelf ChangeButton Vol Title " Test" SendToModule FvwmShelf ChangeButton Vol Title " Test" SendToModule FvwmShelf ChangeButton Vol Title " \ Test" SendToModule FvwmShelf ChangeButton Vol Title " \\ Test" SendToModule FvwmShelf ChangeButton Vol Title " \\\ Test" SendToModule FvwmShelf ChangeButton Vol Title " \\\\ Test" SendToModule FvwmShelf ChangeButton Vol Title " \\\\ Test" SendToModule FvwmShelf ChangeButton Vol Title "\t Test" SendToModule FvwmShelf ChangeButton Vol Title "\. Test" SendToModule FvwmShelf ChangeButton Vol Title "" Test"" SendToModule FvwmShelf ChangeButton Vol Title " " SendToModule FvwmShelf ChangeButton Vol Title "\" " SendToModule FvwmShelf ChangeButton Vol Title "\ " SendToModule FvwmShelf ChangeButton Vol Title "\ T"

With one or three backslash the following space is ignored, with two or four backslashes, one backslash is printet to the buttons title followed by the Spaces…
Is there a trim-function in the ChangeButton-Code, wich removes leading spaces?

scientific

I’ve tried to setup a FvwmButtons with one button, text and an icon because it was too complicated to use your configuration parts …

And … it works as expected …

Here’s the code (file path ~/.fvwm/FvwmShelf)]DestroyModuleConfig FvwmShelf: *
*FvwmShelf: Colorset 10
*FvwmShelf: Frame 0
*FvwmShelf: Padding 3 0
*FvwmShelf: Columns 1
*FvwmShelf: Rows 1
*FvwmShelf: Geometry 160x40

*FvwmShelf: (1x1, Title(Side) " Audio Mixer", Center, Id “Vol”, Icon icon_fns.svg:24x24, Action(Mouse 1) Exec exec gnome-alsamixer)
[/code]I used your FvwmButtons-FvwmShelf.fvwm (ok with some reductions :mrgreen: ) and the main part of your FvwmButton configuration in post 3.

As I run it in FvwmConsole withread FvwmShelf Module FvwmButtons FvwmShelfit looks like

As I enter SendToModule FvwmShelf ChangeButton Vol Title "Audio Mixer" the text moved near the icon:

If you can reproduce your problem by changing this small example I could tell you what’s wrong hopefully.

– Thomas –

This is exactly what happens here.
Starting the FvwmButton there is some space between icon an Title (Text)
Change the title with this function, the leading spaces are gone and the text is near by the icon.

And i want change the title including exact one space bevore “Volume” like in the original config from FvwmShelf loaded on fvwm-startup.

scientific :slight_smile:

Aaah, now I understand … and yes, you’re right - it removes leading spaces. I will play a little bit around. If there’s no chance it could be a “bug” …

– Thomas –

I filed a bug-report to fvwm-workers list.

No you didn’t.

Thomas Adam

I got my own mail back from this list: fvwm-workers@fvwm.org

It’s from my address: jakob@xundeenergie.at

But i hat a weird subject, because i didn’t check, how and when to fill in a subject in the application fvwm-bug… :-/

scientific