The configure method

The configure method can be used to set and retrieve widget configuration values. For example, to change the width of a button:

$button->configure(-width => 100);

To get the value for a current widget, just supply it without a value:

$button->configure(-width);

The result is an array of scalars; the important values are the last two, which represent the default value and its current value, respectively.

You can also call configure without any options at all, which will give you a listing of all options and their values.

Get Perl in a Nutshell, 2nd Edition 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.