Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is it wise/intended to use the attach method of a Balloon as a way to reconfigure the Balloon's message? i.e. Is it bad/wrong to repeatedly attach a Balloon to the same widget (without ever detaching it) each time changing the -balloonmsg option in order to make the associated message dynamic? Is there another way that this is intended to be done (e.g. something like a -balloonmsgvariable option)?

Replies are listed 'Best First'.
Re: reattaching Tk ballons
by eserte (Deacon) on Jun 18, 2004 at 17:34 UTC
    The Tk::Balloon doc says for the -balloonmsg option:
    If you give it a scalar reference then it is dereferenced before being displayed. Useful if the postcommand is used to change the message.
    It seems that it isn't necessary to utilize -postcommand for your problem, using a reference for -balloonmsg should suffice.
      Aha! Right you are. I must learn to read the documentation more carefully... but I'm still using -postcommand as a way to decide when to update the scalar that is being referenced by -balloonmsg. Thanks!