develooper Front page | perl.perl6.users | Postings from March 2023

my zenity adventure

Thread Next
ToddAndMargo via perl6-users
March 26, 2023 23:35
my zenity adventure
Message ID:
Hi All,

Fedora 36

My adventure with a zenity call!

I just worked around a problem with a call to zenity:

Note: zenity can not resolve Raku's "\n", so you have to
preformat the "text" field with "sprintf".

$NotifyStr = sprintf "\nStarting $ProgramName\n\nTakes about $Timeout 
seconds to finish compiling\nMozilla Mirror = <$MozillaMirror>\n";

The above gave me "All updates are complete" in the text
field. Hmmmmmmmm.  I do goof a lot of stuff up (who me????)
but I am "pretty sure" I did not tell zenity that.
I did a direct print of $NotifyStr to the command
line to make sure anyway.

I traced it down to the "<" and ">".

Separating the "<" and ">" with `~ ">" ~` in the string
did not help.

Taking out the "<" and ">" got rid of the problem.  Not
as pretty, but it will due.

$NotifyStr = sprintf "\nStarting $ProgramName\n\nTakes about $Timeout 
seconds to finish compiling\nMozilla Mirror = $MozillaMirror\n";

The zenity call:

shell "zenity --info --title \"$Title\" --text \"$NotifyStr\" 
--width=220 --timeout=$Timeout &";

I was unable to reproduce this from a direct call
to zenity from the command line, so it was probably
something that happened between Raku and zenity.

Of interest, on the direct call "\n" came out as an "S".

Hope this helps someone else.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About