Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tk::Balloon causes MainWindow to lose focus

Status
Not open for further replies.

jprice526

Programmer
Jun 30, 2004
1
US
I'm somewhat new to Tk, so hopefully someone can shed some light on this for me.

Whenever I use the Tk::Balloon widget the MainWindow is not active when the my app starts up.
Clicking on the window makes it active, and everything works fine.

The main problem I'm having is when you mouseover the ballooned widget when the window isn't active.
When you move the mouse off the widget the balloon disappears and the window that called the app (usually the command prompt) becomes active, effectively hiding the application window.

The following sample code illustrates the issue:

###############################
use Tk;
use Tk::Balloon;

my $main = MainWindow->new();

my $frame = $main->Frame();
my $hellobutton = $frame->Button(-text => "Hello")->grid();

$frame->pack();

# uncomment following lines and MainWindow no longer has focus when app is run
#my $balloon = $frame->Balloon();
#$balloon->attach(
# $hellobutton,
# -balloonposition => "mouse",
# -balloonmsg => "This is a test"
#);

MainLoop;
##############################

Anyone have any idea how I can fix this?
Is there other tooltip widgit that is available?

BTW, this is on a windows platform.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top