Tk-SMListbox

 view release on metacpan or  search on metacpan

lib/Tk/SMListbox.pm  view on Meta::CPAN

##
##############################################################################
## SMCListbox is similar to an ordinary listbox, but with the following 
## differences:
## - Calls an -updatecommand whenever something happens to it.
## - Horizontal scanning is disabled, calls -xscancommand to let parent widget
##   handle this.

{
	package Tk::SMListbox::SMCListbox;
	use base qw(Tk::Derived Tk::Listbox);

	Tk::Widget->Construct('SMCListbox');

	sub Populate {
		my ($w, $args) = @_;
		$w->SUPER::Populate($args);
		$w->ConfigSpecs(
				-updatecommand => ['CALLBACK'],
				-xscancommand  => ['CALLBACK'],
		);

lib/Tk/SMListbox.pm  view on Meta::CPAN

		$w->Callback(-updatecommand=>$w->can('Tk::Listbox::CtrlPriorNext'),@_);
	}
}

##############################################################################
## SMHButton is like an ordinary Button, but with an addition option:
## -pixelwidth
## The new configure method makes sure the pixelwidth is always retained.
{
	package Tk::SMListbox::SMHButton;
	use base qw(Tk::Derived Tk::Button);   
	Tk::Widget->Construct('SMHButton');

	sub Populate {
		my ($w, $args) = @_;
		$w->SUPER::Populate($args);
		$w->ConfigSpecs(
				-pixelwidth => ['PASSIVE'],
				-bitmap => [qw/SELF bitmap bitmap/, 'noarrow'],
				-compound => [qw/SELF compound compound/, 'right'],
				-background    => [qw/SELF background Background/, undef],



( run in 1.182 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )