megaconfig.html

来自「perl教程」· HTML 代码 · 共 113 行

HTML
113
字号
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>Tkx::MegaConfig - handle configuration options for megawidgets</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body>

<script>writelinks('__top__',2);</script>
<h1><a>Tkx::MegaConfig - handle configuration options for megawidgets</a></h1>
<p><a name="__index__"></a></p>

<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#license">LICENSE</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Tkx::MegaConfig - handle configuration options for megawidgets</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
  <span class="keyword">package</span> <span class="variable">Foo</span><span class="operator">;</span>
  <span class="keyword">use</span> <span class="variable">base</span> <span class="string">qw(Tkx::widget Tkx::MegaConfig)</span><span class="operator">;</span>
</pre>
<pre>
  <span class="keyword">__PACKAGE__</span><span class="operator">-&gt;</span><span class="variable">_Mega</span><span class="operator">(</span><span class="string">"foo"</span><span class="operator">);</span>
  <span class="keyword">__PACKAGE__</span><span class="operator">-&gt;</span><span class="variable">_Config</span><span class="operator">(</span>
      <span class="string">-option</span>  <span class="operator">=&gt;</span> <span class="operator">[</span><span class="variable">$where</span><span class="operator">,</span> <span class="variable">$dbName</span><span class="operator">,</span> <span class="variable">$dbClass</span><span class="operator">,</span> <span class="variable">$default</span><span class="operator">]</span><span class="operator">,</span>
  <span class="operator">);</span>
</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The <code>Tkx::MegaConfig</code> class provide implementations of <code>m_configure()</code>
and <code>m_cget()</code> that can handle configuration options for megawidgets.
How these methods behave is set up by calling the <code>_Config()</code> class
method.  The <code>_Config()</code> method takes a set option/option spec pairs as
argument.</p>
<p>An option argument is either the name of an option with leading '-'
or the string 'DEFAULT' if this spec applies to all option with no
explict spec.</p>
<p>The spec should be an array reference.  The first element of the array
($where) describe how this option is handled.  Some $where specs take
arguments.  If you need to provide argument replace $where with an
array reference containg [$where, @args].  The rest specify names and
default for the options database, but is currently ignored.</p>
<p>The following $where specs are understood:</p>
<dl>
<dt><strong><a name="item__2efoo">.foo</a></strong>

<dd>
<p>Delegate the given configuration option to the &quot;foo&quot; kid of the mega
widget.  The name &quot;.&quot; can be used to deletegate to the megawidget
root itself.  An argument can be given to delegate using a different
name on the &quot;foo&quot; widget.</p>
</dd>
</li>
<dt><strong><a name="item_method">METHOD</a></strong>

<dd>
<p>Call the <em>_config_</em><em>opt</em> method.  For <code>m_cget()</code> no arguments are
given, while for <code>m_configure()</code> the new value is passed.  An argument
can be given to forward to that method instead of <em>_config_</em><em>opt</em>.</p>
</dd>
</li>
<dt><strong><a name="item_passive">PASSIVE</a></strong>

<dd>
<p>Store or retrieve option from $self-&gt;_data.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="license">LICENSE</a></h1>
<p>This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.</p>
<p>Copyright 2005 ActiveState.  All rights reserved.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><a href="../../lib/Tkx.html">the Tkx manpage</a>, <a href="../../lib/Tkx/LabEntry.html">the Tkx::LabEntry manpage</a></p>
<p>Inspiration for this module comes from <a href="../../lib/Tk/ConfigSpecs.html">the Tk::ConfigSpecs manpage</a>.</p>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?