# # The help widget that provides both "balloon" and "status bar" # types of help messages. # # This is a patched version of Balloon 3.037 - it adds support # for different orientations of the balloon widget, depending # on wether there's enough space for it. The little arrow now # should always point directly to the client. # Added by Gerhard Petrowitsch (gerhard.petrowitsch@philips.com) # # Nov 1, 2003 - Jack Dunnigan # Added support for more than one screen in single logical # screen mode (i.e. xinerama, dual monitors) package Tk::Balloon; use vars qw($VERSION); $VERSION = sprintf '4.%03d', q$Revision: #10 $ =~ /\D(\d+)\s*$/; use Tk qw(Ev Exists); use Carp; require Tk::Toplevel; Tk::Widget->Construct('Balloon'); use base qw(Tk::Toplevel); # use UNIVERSAL; avoid the UNIVERSAL.pm file subs are XS in perl core use strict; my @balloons; my $button_up = 0; my %arrows = ( TL => 'R0lGODlhBgAGAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAGAAYAAAINjA0HAEdwLCwMKIQfBQA7', TR => 'R0lGODlhBgAGAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAGAAYAAAIRBGMDwAEQkgAIAAoCABEEuwAAOw==', BR => 'R0lGODlhBgAGAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAGAAYAAAIPDOHHhYVRAIgIAEISQLELADs=', BL => 'R0lGODlhBgAGAJEAANnZ2QAAAP///////yH5BAEAAAAALAAAAAAGAAYAAAIPhB1xAUFALCIMKAaAWQAVADs=', NO => 'R0lGODlhAQABAJEAANnZ2f///////////yH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==' ); sub ClassInit { my ($class, $mw) = @_; $mw->bind('all', '', ['Tk::Balloon::Motion', Ev('X'), Ev('Y'), Ev('s')]); $mw->bind('all', '', ['Tk::Balloon::Motion', Ev('X'), Ev('Y'), Ev('s')]); $mw->bind('all', '