GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Tk::CWidget(3) User Contributed Perl Documentation Tk::CWidget(3)

Tk::CWidget - Frame-based Composite Base class.

CWidget is a base class for Frame-based Composite widgets. It contains methods that may be useful for Composites, and is used as a way of extending or overriding the Widget, Derived, or Frame modules without directly changing them. It is not intended for use as a standalone widget. Currently, it has few methods, but will likely increase as common code is moved from subclasses to this one.

Name subwidgets
Class Subwidgets
Switch -subwidgets
Specifies one or more configuration options for subwidgets contained within the Composite. Assuming a Composite that contains two subwidgets: LabelA and LabelB (both Label widgets), the following examples show how these might be configured.

The first example shows that for each named subwidget, one or more options can be set.

   $cwidget->configure(-subwidgets => [
      LabelA => { -background => 'blue', -foreground => 'white' },
      LabelB => { -background => 'white', -foreground => 'blue' }
   ]);
    

The second example show that more than one subwidget can be associated with a set of options.

   $cwidget->configure(-subwidgets => [
      ['LabelA', 'LabelB'] => { -bg => 'blue', -fg  => 'white'},
      LabelA               => { -text => 'A'},
      LabelB               => { -text => 'B'}
   ]);
    

Why is this useful? If you have several composites that have the same option configurations, this allows the options to be defined once in a variable, and then passed to each one, eliminating some of the common code from repeatedly calling:

  $cwidget->Subwidget('LabelA')->configure(...)
    

$cwidget->configureSubwidgets(array|arrayref)
Provides an alternative to using the -subwidgets option. This method take either an array reference or an array. Either way the contents of the array reference or array are identical.

   $cwidget->configureSubwidgets(
      ['LabelA', 'LabelB'] => { -bg => 'blue', -fg  => 'white'},
      LabelA               => { -text => 'A'},
      LabelB               => { -text => 'B'}
   );
    

or:

   $cwidget->configureSubwidgets([   
      ['LabelA', 'LabelB'] => { -bg => 'blue', -fg  => 'white'},
      LabelA               => { -text => 'A'},
      LabelB               => { -text => 'B'}
   ]);
    

Rob Seegel (RobSeegel@comcast.net)
2006-10-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.