Home > Archive > PerlTk > January 2005 > Tk::Balloon with life update
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Tk::Balloon with life update
|
|
| gerhard.petrowitsch@philips.com 2004-10-25, 8:56 am |
|
Hi all,
I'm using the Tk::Balloon widget to display the state of an object.
This state is changing. The current Balloon widget doesn't allow
to change the message while the Balloon is displayed (the message
is only configured, when the Balloon pops up).
For some reason - hard to understand for me - Balloon is
dereferencing a scalar reference if used in the -balloonmsg,
-statusmsg or -msg switches. I think, one could get the same
effect from using the scalar reference and the -textvariable switch
for the underlying Label widget rather then dereferencing it and
using the -text switch.
Moreover, if Balloon would use the scalar reference and the -textvariable
switch,
the message could be updated while the Balloon is displayed.
This patch works for me ('<' is new, '>' is original code):
279,284c279,282
< # if it looks like a scalar reference, use the -textvariable switch
for a 'life updateable' balloon
< if (UNIVERSAL::isa($msg, 'SCALAR')) {
< $w->Subwidget('message')->configure(-text => undef, -textvariable
=> $msg);
< } else {
< $w->Subwidget('message')->configure(-text => $msg, -textvariable =>
undef);
< }
---
> # Dereference it if it looks like a scalar reference:
> $msg = $$msg if UNIVERSAL::isa($msg, 'SCALAR');
>
> $w->Subwidget('message')->configure(-text => $msg);
The patch could cause a problem with existing code using the reference and
changing it while the Balloon is displayed, but NOT wanting it to
show immediately, which is very likely extremely uncommon.
Could this patch be included in the official 'Balloon' code, or would you
rather prefer to have -ballonmsgvariable / -statusmsgvariable /
-msgvariable
switches?
Regards,
Gerhard
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
| |
| Nick Ing-Simmons 2004-10-25, 4:00 pm |
| Gerhard Petrowitsch <gerhard.petrowitsch@philips.com> writes:
>This patch works for me ('<' is new, '>' is original code):
That isn't a 'patch' it is a diff ;-)
Please do
diff -u originalfile newfile
(Use diff -c if you diff doesn't do -u ...)
>
>279,284c279,282
>< # if it looks like a scalar reference, use the -textvariable switch
>for a 'life updateable' balloon
>< if (UNIVERSAL::isa($msg, 'SCALAR')) {
>< $w->Subwidget('message')->configure(-text => undef, -textvariable
>=> $msg);
>< } else {
>< $w->Subwidget('message')->configure(-text => $msg, -textvariable =>
>undef);
>< }
>---
>
>The patch could cause a problem with existing code using the reference and
>changing it while the Balloon is displayed, but NOT wanting it to
>show immediately, which is very likely extremely uncommon.
>
>Could this patch be included in the official 'Balloon' code, or would you
>rather prefer to have -ballonmsgvariable / -statusmsgvariable /
>-msgvariable
>switches?
>
>Regards,
>Gerhard
>
>-++**==--++**==--++**==--++**==--++**==--++**==--++**==
>This message was posted through the Stanford campus mailing list
>server. If you wish to unsubscribe from this mailing list, send the
>message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
| |
| gerhard.petrowitsch@philips.com 2004-10-25, 4:00 pm |
|
I'm sorry, I'm not experienced in those things. Anyway, here's
the patch:
--- Balloon.pm Thu May 30 16:22:28 2002
+++ BalloonNew.pm Mon Oct 25 16:45:11 2004
@@ -276,10 +276,12 @@
my $client = $w->{'client'};
return if not defined $client or not exists $w->{'clients'}{$client};
my $msg = $client->BalloonInfo($w, $w->pointerxy,'-balloonmsg');
- # Dereference it if it looks like a scalar reference:
- $msg = $$msg if UNIVERSAL::isa($msg, 'SCALAR');
-
- $w->Subwidget('message')->configure(-text => $msg);
+ # if it looks like a scalar reference, use the -textvariable switch
for a 'life update-able' balloon
+ if (UNIVERSAL::isa($msg, 'SCALAR')) {
+ $w->Subwidget('message')->configure(-text => undef, -textvariable =>
$msg);
+ } else {
+ $w->Subwidget('message')->configure(-text => $msg, -textvariable =>
undef);
+ }
$w->idletasks;
return unless Exists($w);
Regards,
Gerhard
|---------+---------------------------->
| | |
| | |
| | |
| | |
| | |
| | Nick Ing-Simmons |
| | <nick@ing-simmons.net> |
| | |
| | Sent by: |
| | owner-ptk@lists.Stanford|
| | .EDU |
| | |
| | 2004-10-25 04:28 PM |
| | Please respond to Nick |
| | Ing-Simmons |
| | |
|---------+---------------------------->
>---------------------------------------------------------------------------------------------------------------------------|
| |
| To: Gerhard Petrowitsch/STN/SC/PHILIPS@PHILIPS |
| cc: ptk@lists.Stanford.EDU |
| Subject: Re: Tk::Balloon with life update |
| |
| Classification: |
| |
| |
>---------------------------------------------------------------------------------------------------------------------------|
Gerhard Petrowitsch <gerhard.petrowitsch@philips.com> writes:
>This patch works for me ('<' is new, '>' is original code):
That isn't a 'patch' it is a diff ;-)
Please do
diff -u originalfile newfile
(Use diff -c if you diff doesn't do -u ...)
>
>279,284c279,282
>< # if it looks like a scalar reference, use the -textvariable switch
>for a 'life updateable' balloon
>< if (UNIVERSAL::isa($msg, 'SCALAR')) {
>< $w->Subwidget('message')->configure(-text => undef, -textvariable
>=> $msg);
>< } else {
>< $w->Subwidget('message')->configure(-text => $msg, -textvariable
=>
>undef);
>< }
>---
>
>The patch could cause a problem with existing code using the reference and
>changing it while the Balloon is displayed, but NOT wanting it to
>show immediately, which is very likely extremely uncommon.
>
>Could this patch be included in the official 'Balloon' code, or would you
>rather prefer to have -ballonmsgvariable / -statusmsgvariable /
>-msgvariable
>switches?
>
>Regards,
>Gerhard
>
>-++**==--++**==--++**==--++**==--++**==--++**==--++**==
>This message was posted through the Stanford campus mailing list
>server. If you wish to unsubscribe from this mailing list, send the
>message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
| |
| Jack D. 2004-10-25, 8:56 pm |
| This is a multi-part message in MIME format.
------=_NextPart_000_0010_01C4BAA3.400DFA70
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
This is a problem I had a couple of years back - I solved it by generating
an event in order for the balloon to autoupdate.
I have attached my test code which I used at that time. Maybe a new option
is needed at balloon instantiation:
-autoupdate => 1||0
Jack
> -----Original Message-----
> From: owner-ptk@lists.Stanford.EDU
> [mailto:owner-ptk@lists.Stanford.EDU] On Behalf Of
> gerhard.petrowitsch@philips.com
> Sent: October 25, 2004 8:47 AM
> To: Nick Ing-Simmons
> Cc: ptk@lists.Stanford.EDU
> Subject: Re: Tk::Balloon with life update
>
>
>
>
>
> I'm sorry, I'm not experienced in those things. Anyway,
> here's the patch:
>
> --- Balloon.pm Thu May 30 16:22:28 2002
> +++ BalloonNew.pm Mon Oct 25 16:45:11 2004
> @@ -276,10 +276,12 @@
> my $client = $w->{'client'};
> return if not defined $client or not exists
> $w->{'clients'}{$client};
> my $msg = $client->BalloonInfo($w, $w->pointerxy,'-balloonmsg');
> - # Dereference it if it looks like a scalar reference:
> - $msg = $$msg if UNIVERSAL::isa($msg, 'SCALAR');
> -
> - $w->Subwidget('message')->configure(-text => $msg);
> + # if it looks like a scalar reference, use the
> -textvariable switch
> for a 'life update-able' balloon
> + if (UNIVERSAL::isa($msg, 'SCALAR')) {
> + $w->Subwidget('message')->configure(-text => undef,
> -textvariable
> + =>
> $msg);
> + } else {
> + $w->Subwidget('message')->configure(-text => $msg,
> -textvariable
> + =>
> undef);
> + }
> $w->idletasks;
>
> return unless Exists($w);
>
> Regards,
> Gerhard
>
>
>
> |---------+---------------------------->
> | | |
> | | |
> | | |
> | | |
> | | |
> | | Nick Ing-Simmons |
> | | <nick@ing-simmons.net> |
> | | |
> | | Sent by: |
> | | owner-ptk@lists.Stanford|
> | | .EDU |
> | | |
> | | 2004-10-25 04:28 PM |
> | | Please respond to Nick |
> | | Ing-Simmons |
> | | |
> |---------+---------------------------->
>
> --------------------------------------------------------------|
> |
> |
> | To: Gerhard
> Petrowitsch/STN/SC/PHILIPS@PHILIPS
> |
> | cc: ptk@lists.Stanford.EDU
> |
> | Subject: Re: Tk::Balloon with life update
> |
> |
> |
> | Classification:
> |
> |
> |
> |
> |
>
> --------------------------------------------------------------|
>
>
>
>
> Gerhard Petrowitsch <gerhard.petrowitsch@philips.com> writes:
>
> That isn't a 'patch' it is a diff ;-)
>
> Please do
>
> diff -u originalfile newfile
>
> (Use diff -c if you diff doesn't do -u ...)
>
> -textvariable switch
> -textvariable
> -textvariable
> =>
> reference
> wanting it to
> or would
>
>
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing
> list server. If you wish to unsubscribe from this mailing
> list, send the message body of "unsubscribe ptk" to
> majordomo@lists.stanford.edu
>
>
>
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing
> list server. If you wish to unsubscribe from this mailing
> list, send the message body of "unsubscribe ptk" to
> majordomo@lists.stanford.edu
>
------=_NextPart_000_0010_01C4BAA3.400DFA70
Content-Type: application/octet-stream;
name="balloononthefly.pl"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="balloononthefly.pl"
use Tk;
use Tk::Balloon;
my $i=0;
my $text;
my $mw=tkinit;
my $c=$mw->Canvas->pack;
my $o = $c->create('oval',50,50,100,100,-fill=>'red',-tags=>'CYQR');
my $l = $mw->Label(-textvariable=>\$text)->pack;
$b = $mw->Balloon(-background=>'red',-statusbar => $l);
my $lab = $b->Subwidget('message');
$lab->configure(-justify=>'left',-anchor=>'e');
$status{CYQR} = $i;
$balloon{CYQR} = $i;
$b->attach($c, -initwait=>0,
-balloonposition => 'mouse',
-statusmsg => \%status,
-balloonmsg=>\%balloon,
);
$mw->repeat(25,sub{ $i++;
$status{CYQR}= $i;
$balloon{CYQR}= $i;
$mw->eventGenerate('<Motion>',
-rootx => $mw->pointerx,
-rooty => $mw->pointery);
});
MainLoop;
------=_NextPart_000_0010_01C4BAA3.400DFA70--
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
| |
| gerhard.petrowitsch@philips.com 2004-10-26, 3:56 am |
|
Hi Jack,
thanks for your reply.
Well, your script does what I'm looking for, but isn't this a very
brute force workaround? OK, you don't have to touch the Balloon
code, but as a drawback you must generate a lot of events, which
will slow down other processing.
I think it's more elegant and Tk-ish using the patch I suggested.
Or if a new switch is introduced (call it -autoupdate or -noDeRef
or whatever), it should be used to prevent the dereferencing of
a scalar reference if given for the -balloonmsg, -statusmsg, and
-msg switches; i.e. it would switch between the original code and
my patch.
Cheers,
Gerhard
|---------+---------------------------->
| | |
| | |
| | |
| | |
| | |
| | "Jack D." |
| | <goodcall1@hotmail.com> |
| | |
| | Sent by: |
| | owner-ptk@lists.Stanford|
| | .EDU |
| | |
| | 2004-10-25 10:59 PM |
| | |
|---------+---------------------------->
>---------------------------------------------------------------------------------------------------------------------------|
| |
| To: Gerhard Petrowitsch/STN/SC/PHILIPS@PHILIPS |
| "'Nick Ing-Simmons'" <nick@ing-simmons.net> |
| cc: <ptk@lists.Stanford.EDU> |
| Subject: RE: Tk::Balloon with life update |
| |
| Classification: Unclassified |
| |
| |
>---------------------------------------------------------------------------------------------------------------------------|
This is a problem I had a couple of years back - I solved it by generating
an event in order for the balloon to autoupdate.
I have attached my test code which I used at that time. Maybe a new option
is needed at balloon instantiation:
-autoupdate => 1||0
Jack
> -----Original Message-----
> From: owner-ptk@lists.Stanford.EDU
> [mailto:owner-ptk@lists.Stanford.EDU] On Behalf Of
> gerhard.petrowitsch@philips.com
> Sent: October 25, 2004 8:47 AM
> To: Nick Ing-Simmons
> Cc: ptk@lists.Stanford.EDU
> Subject: Re: Tk::Balloon with life update
>
>
>
>
>
> I'm sorry, I'm not experienced in those things. Anyway,
> here's the patch:
>
> --- Balloon.pm Thu May 30 16:22:28 2002
> +++ BalloonNew.pm Mon Oct 25 16:45:11 2004
> @@ -276,10 +276,12 @@
> my $client = $w->{'client'};
> return if not defined $client or not exists
> $w->{'clients'}{$client};
> my $msg = $client->BalloonInfo($w, $w->pointerxy,'-balloonmsg');
> - # Dereference it if it looks like a scalar reference:
> - $msg = $$msg if UNIVERSAL::isa($msg, 'SCALAR');
> -
> - $w->Subwidget('message')->configure(-text => $msg);
> + # if it looks like a scalar reference, use the
> -textvariable switch
> for a 'life update-able' balloon
> + if (UNIVERSAL::isa($msg, 'SCALAR')) {
> + $w->Subwidget('message')->configure(-text => undef,
> -textvariable
> + =>
> $msg);
> + } else {
> + $w->Subwidget('message')->configure(-text => $msg,
> -textvariable
> + =>
> undef);
> + }
> $w->idletasks;
>
> return unless Exists($w);
>
> Regards,
> Gerhard
>
>
>
> |---------+---------------------------->
> | | |
> | | |
> | | |
> | | |
> | | |
> | | Nick Ing-Simmons |
> | | <nick@ing-simmons.net> |
> | | |
> | | Sent by: |
> | | owner-ptk@lists.Stanford|
> | | .EDU |
> | | |
> | | 2004-10-25 04:28 PM |
> | | Please respond to Nick |
> | | Ing-Simmons |
> | | |
> |---------+---------------------------->
>
> --------------------------------------------------------------|
> |
> |
> | To: Gerhard
> Petrowitsch/STN/SC/PHILIPS@PHILIPS
> |
> | cc: ptk@lists.Stanford.EDU
> |
> | Subject: Re: Tk::Balloon with life update
> |
> |
> |
> | Classification:
> |
> |
> |
> |
> |
>
> --------------------------------------------------------------|
>
>
>
>
> Gerhard Petrowitsch <gerhard.petrowitsch@philips.com> writes:
>
> That isn't a 'patch' it is a diff ;-)
>
> Please do
>
> diff -u originalfile newfile
>
> (Use diff -c if you diff doesn't do -u ...)
>
> -textvariable switch
> -textvariable
> -textvariable
> =>
> reference
> wanting it to
> or would
>
>
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing
> list server. If you wish to unsubscribe from this mailing
> list, send the message body of "unsubscribe ptk" to
> majordomo@lists.stanford.edu
>
>
>
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing
> list server. If you wish to unsubscribe from this mailing
> list, send the message body of "unsubscribe ptk" to
> majordomo@lists.stanford.edu
>
[attachment "balloononthefly.pl" deleted by Gerhard
Petrowitsch/STN/SC/PHILIPS]
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
| |
| Jack D. 2004-10-26, 8:59 am |
|
> -----Original Message-----
> From: owner-ptk@lists.Stanford.EDU
> [mailto:owner-ptk@lists.Stanford.EDU] On Behalf Of
> gerhard.petrowitsch@philips.com
> Sent: October 25, 2004 11:20 PM
> To: Jack D.
> Cc: ptk@lists.Stanford.EDU
> Subject: RE: Tk::Balloon with life update
>
> Hi Jack,
>
> thanks for your reply.
> Well, your script does what I'm looking for, but isn't this a
> very brute force workaround?
Yes - it was .. and still is :)
> OK, you don't have to touch the
> Balloon code, but as a drawback you must generate a lot of
> events, which will slow down other processing.
>
> I think it's more elegant and Tk-ish using the patch I suggested.
I completely agree. I was just showing how "I" worked around the problem.
Your solution is much nicer.
> Or if a new switch is introduced (call it -autoupdate or
> -noDeRef or whatever), it should be used to prevent the
> dereferencing of a scalar reference if given for the
> -balloonmsg, -statusmsg, and -msg switches; i.e. it would
> switch between the original code and my patch.
Now that I think of it - I can't see a reason for the balloon *not* to
change. So I'm not sure if it is needed? Maybe this need more
thought/discussion?
Anyways - it would be quite easy - just a PASSIVE boolean variable in the
ConfigSpecs would do it and then use it's value in the conditional
statements along with your code. (Since the attach and GetOption methods
already allow these to be overridden on a widget by widget basis - there
would be no harm in having this as an extra option)
So - Any other suggestions on an option name?
Jack
[color=darkred]
> $w->pointerxy,'-balloonmsg');
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
| |
| gerhard.petrowitsch@philips.com 2004-10-27, 8:56 am |
|
Jack,
I'd suggest '-useref' as an option name. It defaults to 0, which exposes
the original behaviour of the Balloon (though I also don't see any sense in
dereferencing a reference here). Anyway, if the option is set to '1', the
balloon uses the reference (therefore 'useref'), instead of dereferencing
it.
So how about this patch?
--- Balloon.pm Thu May 30 16:22:28 2002
+++ BalloonNew.pm Wed Oct 27 08:59:27 2004
@@ -76,6 +76,7 @@
-statusbar => ['PASSIVE', 'statusBar', 'StatusBar',
undef],
-statusmsg => ['PASSIVE', 'statusMsg', 'StatusMsg',
''],
-balloonmsg => ['PASSIVE', 'balloonMsg', 'BalloonMsg',
''],
+ -useref => ['PASSIVE', 'useRef', 'UseRef', 0],
-balloonposition => ['PASSIVE', 'balloonPosition',
'BalloonPosition', 'widget'],
-postcommand => ['CALLBACK', 'postCommand',
'PostCommand', undef],
-cancelcommand => ['CALLBACK', 'cancelCommand',
'CancelCommand', undef],
@@ -276,10 +277,16 @@
my $client = $w->{'client'};
return if not defined $client or not exists $w->{'clients'}{$client};
my $msg = $client->BalloonInfo($w, $w->pointerxy,'-balloonmsg');
- # Dereference it if it looks like a scalar reference:
- $msg = $$msg if UNIVERSAL::isa($msg, 'SCALAR');
-
- $w->Subwidget('message')->configure(-text => $msg);
+ # if it looks like a scalar reference, use the -textvariable switch or
dereference it
+ if (UNIVERSAL::isa($msg, 'SCALAR')) {
+ if ($w->GetOption(-useref => $client)) {
+ $w->Subwidget('message')->configure(-text => undef, -textvariable
=> $msg); # use reference
+ } else {
+ $w->Subwidget('message')->configure(-text => $$msg, -textvariable
=> undef); # deref
+ }
+ } else {
+ $w->Subwidget('message')->configure(-text => $msg, -textvariable =>
undef); # use value
+ }
$w->idletasks;
return unless Exists($w);
Regards,
Gerhard
---------------------------------------------------------------------------------------
Be like the ant. When the ant gets a mixture of sand and sugar,
it selects only sugar; it neglects sand. See only good in others.
Pay no attention to the bad. (Sathya Sai
Baba)
--------------------------------------------------------------------------------------------
|---------+---------------------------->
| | |
| | |
| | |
| | |
| | |
| | "Jack D." |
| | <goodcall1@hotmail.com> |
| | |
| | 2004-10-26 12:09 PM |
| | |
|---------+---------------------------->
>---------------------------------------------------------------------------------------------------------------------------|
| |
| To: Gerhard Petrowitsch/STN/SC/PHILIPS@PHILIPS |
| cc: <ptk@lists.Stanford.EDU> |
| Subject: RE: Tk::Balloon with life update |
| |
| Classification: |
| |
| |
>---------------------------------------------------------------------------------------------------------------------------|
> -----Original Message-----
> From: owner-ptk@lists.Stanford.EDU
> [mailto:owner-ptk@lists.Stanford.EDU] On Behalf Of
> gerhard.petrowitsch@philips.com
> Sent: October 25, 2004 11:20 PM
> To: Jack D.
> Cc: ptk@lists.Stanford.EDU
> Subject: RE: Tk::Balloon with life update
>
> Hi Jack,
>
> thanks for your reply.
> Well, your script does what I'm looking for, but isn't this a
> very brute force workaround?
Yes - it was .. and still is :)
> OK, you don't have to touch the
> Balloon code, but as a drawback you must generate a lot of
> events, which will slow down other processing.
>
> I think it's more elegant and Tk-ish using the patch I suggested.
I completely agree. I was just showing how "I" worked around the problem.
Your solution is much nicer.
> Or if a new switch is introduced (call it -autoupdate or
> -noDeRef or whatever), it should be used to prevent the
> dereferencing of a scalar reference if given for the
> -balloonmsg, -statusmsg, and -msg switches; i.e. it would
> switch between the original code and my patch.
Now that I think of it - I can't see a reason for the balloon *not* to
change. So I'm not sure if it is needed? Maybe this need more
thought/discussion?
Anyways - it would be quite easy - just a PASSIVE boolean variable in the
ConfigSpecs would do it and then use it's value in the conditional
statements along with your code. (Since the attach and GetOption methods
already allow these to be overridden on a widget by widget basis - there
would be no harm in having this as an extra option)
So - Any other suggestions on an option name?
Jack
[color=darkred]
> $w->pointerxy,'-balloonmsg');
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
| |
| Nick Ing-Simmons 2005-01-03, 3:57 pm |
| Gerhard Petrowitsch <gerhard.petrowitsch@philips.com> writes:
>I'm sorry, I'm not experienced in those things. Anyway, here's
>the patch:
Applied to mainline sources.
>
>--- Balloon.pm Thu May 30 16:22:28 2002
>+++ BalloonNew.pm Mon Oct 25 16:45:11 2004
>@@ -276,10 +276,12 @@
> my $client = $w->{'client'};
> return if not defined $client or not exists $w->{'clients'}{$client};
> my $msg = $client->BalloonInfo($w, $w->pointerxy,'-balloonmsg');
>- # Dereference it if it looks like a scalar reference:
>- $msg = $$msg if UNIVERSAL::isa($msg, 'SCALAR');
>-
>- $w->Subwidget('message')->configure(-text => $msg);
>+ # if it looks like a scalar reference, use the -textvariable switch
>for a 'life update-able' balloon
>+ if (UNIVERSAL::isa($msg, 'SCALAR')) {
>+ $w->Subwidget('message')->configure(-text => undef, -textvariable =>
>$msg);
>+ } else {
>+ $w->Subwidget('message')->configure(-text => $msg, -textvariable =>
>undef);
>+ }
> $w->idletasks;
>
> return unless Exists($w);
>
>Regards,
>Gerhard
>
>
>
>|---------+---------------------------->
>| | |
>| | |
>| | |
>| | |
>| | |
>| | Nick Ing-Simmons |
>| | <nick@ing-simmons.net> |
>| | |
>| | Sent by: |
>| | owner-ptk@lists.Stanford|
>| | .EDU |
>| | |
>| | 2004-10-25 04:28 PM |
>| | Please respond to Nick |
>| | Ing-Simmons |
>| | |
>|---------+---------------------------->
> | |
> | To: Gerhard Petrowitsch/STN/SC/PHILIPS@PHILIPS |
> | cc: ptk@lists.Stanford.EDU |
> | Subject: Re: Tk::Balloon with life update |
> | |
> | Classification: |
> | |
> | |
>
>
>
>
>Gerhard Petrowitsch <gerhard.petrowitsch@philips.com> writes:
>
>That isn't a 'patch' it is a diff ;-)
>
>Please do
>
>diff -u originalfile newfile
>
>(Use diff -c if you diff doesn't do -u ...)
>
>=>
>
>
>-++**==--++**==--++**==--++**==--++**==--++**==--++**==
>This message was posted through the Stanford campus mailing list
>server. If you wish to unsubscribe from this mailing list, send the
>message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
|
|
|
|
|