Appendix B.  Options and Default Valuesfor Each Widget

In Chapter 13 we discussed how to use the configure and cget methods on our widgets. This appendix shows the output from configure on each of the widgets we cover in this book. The program used to generate the data is as follows:

use Tk;
use strict;

my $mw = MainWindow->new;
while (my $w = <DATA>) {
    next if $w =~ /^#/;
    chomp $w;
    print "\n\n====== $w\n";
    my $o = $mw->$w;
    my(@o) = $o->configure;
    foreach my $opt (@o) {
    	@$opt = map {defined($_) ? $_ : 'undef'} @$opt;
	printf "%s\t%s\t%s\t%s\t%s\n", @$opt;
	
	if ($$opt[4] =~ /^System/) {
	 my ($r, $g, $b) = $mw->rgb($$opt[4]);
	 print "$r $g $b\n";
	}
    }
}

__DATA__
Adjuster
Balloon
Bitmap
BrowseEntry
Button
## ... list shortened ...
Toplevel
Tree

Get Mastering Perl/Tk now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.