Tk
view release on metacpan or search on metacpan
pod/Widget.pod view on Meta::CPAN
binding information for a widget. It prints a widget's
bindtags. For each binding tag it prints all the bindings, comprised
of the event descriptor and the callback. Callback arguments are
printed, and B<Tk::Ev> objects are expanded.
=item I<$widget>-E<gt>B<Busy>?(?-recurse => 1?,I<-option> => I<value>?)?
This method B<configure>s a B<-cursor> option for I<$widget> and
(if B<-recurse => 1> is specified) all its descendants. The cursor to
be set may be passed as S<B<-cursor> => I<cursor>> or defaults to 'watch'.
Additional B<configure> options are applied to I<$widget> only.
It also adds a special tag B<'Busy'> to the B<bindtags> of the widgets so
configured so that B<KeyPress>, B<KeyRelease>, B<ButtonPress> and
B<ButtonRelease> events are ignored (with press events generating a call to
B<bell>). It then acquires a local B<grab> for I<$widget>.
The state of the widgets and the grab is restored by a call to
I<$widget>-E<gt>B<Unbusy>.
=item I<$widget>-E<gt>B<caret>( ?-x => I<x>?, ?-y => I<y>?, ?-height
=> I<height>? );
Sets and queries the caret location for the display of the specified
Tk window window. The caret is the per-display cursor location used
for indicating global focus (e.g. to comply with Microsoft
Accessibility guidelines), as well as for location of the
over-the-spot XIM (X Input Methods) or Windows IME windows. If no
options are specified, the last values used for setting the caret are
return in option-value pair format. -x and -y represent
window-relative coordinates, and -height is the height of the current
cursor location, or the height of the specified window if none is
given.
=item I<$widget>-E<gt>B<cells>
Returns a decimal string giving the number of cells in the
color map for I<$widget>.
=item I<$widget>-E<gt>B<children>
I<$widget->>B<children>
Returns a list containing all the children
of $widget. The list is in stacking order, with the lowest
window first. Top-level windows are returned as children
of their logical parents.
=item I<$widget>-E<gt>B<class>
Returns the class name for I<$widget>.
=item I<$widget>-E<gt>B<colormapfull>
Returns 1 if the colormap for I<$widget> is known to be full, 0
otherwise. The colormap for a window is ``known'' to be full if the last
attempt to allocate a new color on that window failed and this
application hasn't freed any colors in the colormap since the
failed allocation.
=item I<$widget>-E<gt>B<ConfigSpecs>
Used to perform delegated option configuration for a mega-widget.
Returns, in Tk::Derived::ConfigSpecs notation (see L<Tk::ConfigSpecs>),
all possible options for a widget. For example,
$s = $self->Scale;
$self->ConfigSpecs(
$s->ConfigSpecs,
.... more ConfigSpecs specifications
);
returns a hash of all Tk::Scale options, delegated to $s - e.g. some
representative examples:
-bigincrement => [$s, bigIncrement, BigIncrement, 0, 0]
-digits => [$s, digits, Digits, 0, 0]
-sliderlength => [$s, sliderLength, SliderLength, 10m, 30]
-troughcolor => [$s, troughColor, Background, #c3c3c3, #c3c3c3]
This provides an easy means of populating a mega-widget's ConfigSpecs
with initializers.
=item I<$widget>-E<gt>B<containing>(I<rootX,rootY>)
Returns the window containing the point given
by I<rootX> and I<rootY>.
I<RootX> and I<rootY> are specified in screen units (i.e.
any form acceptable to B<Tk_GetPixels>) in the coordinate
system of the root window (if a virtual-root window manager is in
use then the coordinate system of the virtual root window is used).
If no window in this application contains the point then an empty
string is returned.
In selecting the containing window, children are given higher priority
than parents and among siblings the highest one in the stacking order is
chosen.
=item I<$widget>-E<gt>B<depth>
Returns a decimal string giving the depth of I<$widget> (number
of bits per pixel).
=item I<$widget>-E<gt>B<destroy>
This command deletes the window related to
I<$widget>, plus all its descendants.
If all the B<MainWindows> are deleted then the entire application
will be destroyed.
The perl object I<$widget> continues to exist while references
to it still exist, e.g. until variable goes out of scope.
However any attempt to use Tk methods on the object will fail.
B<Exists>(I<$widget>) will return false on such objects.
Note however that while a window exists for I<$widget> the
perl object is maintained (due to "references" in perl/Tk internals)
even though original variables may have gone out of scope.
(Normally this is intuitive.)
=item B<Exists>(I<$widget>)
Returns 1 if there exists a window for I<$widget>, 0 if no such
window exists.
( run in 1.883 second using v1.01-cache-2.11-cpan-a1f116cd669 )