[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: ProgressBar set_text



On Tue, Jul 17, 2007 at 11:00:29AM +0200, Jeffrey Ratcliffe wrote:
> On 17/07/07, Wouter Verhelst <wouter nixsys be> wrote:
>> directly using values which you extract using a regex like that has
>> issues with glib (it wants to have modifiable variables, which these
>> things aren't). Try assigning them to temporary variables before going
>> on:
>>
>> if($line =~ /(\d*\.?\d*)(.*)/) {
>>         my $fraction=$1;
>>         my $text=$2;
>>         $pbar->set_fraction($fraction);
>>         $pbar->set_text($text);
>> }
>
> Your modification works. Thanks. I don't understand then why it worked
> with the print statement.

My guess would be that it worked because you used them inside a string,
which did some magic on them. Not sure, though, and it's something fishy
none the less.

-- 
Wouter Verhelst
NixSys BVBA
Louizastraat 14, 2800 Mechelen
T: +32 15 27 69 50 / F: +32 15 27 69 51 / M: +32 486 836 198



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]