15.4. Toplevel-Based Composite Widgets

There is one small difference between a composite widget based on a frame instead of a toplevel. If you want to be able to use ->new() to create your window, define InitObject instead of Populate. Most of the composite widgets included with the Tk distribution do not do this, however. Look at ColorEditor.pmand DialogBox.pm for examples of how to create a toplevel-based composite widget. All the rules for using ConfigDefaultsare the same.

Get Learning 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.