php-doc-en/reference/newt/reference.xml

129 lines
3.3 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- Purpose: utilspec.cmdline -->
<!-- Membership: pecl, external -->
<!-- State: experimental -->
<reference id="ref.newt">
<title>Newt Functions</title>
<titleabbrev>Newt</titleabbrev>
<partintro>
<section id="newt.intro">
&reftitle.intro;
<para>
This is a PHP language extension for RedHat Newt library, a terminal-based
window and widget library for writing applications with user friendly interface.
Once this extension is enabled in PHP it will provide the use of Newt
widgets, such as windows, buttons, checkboxes, radiobuttons, labels,
editboxes, scrolls, textareas, scales, etc. Use of this extension if very
similar to the original Newt API of C programming language.
</para>
</section>
<section id="newt.requirements">
&reftitle.required;
<para>
This module uses the functions of the RedHat Newt library.
You need libnewt version &gt;= 0.51.0.
</para>
</section>
<!-- Information found in configure.xml -->
&reference.newt.configure;
<section id="newt.resources">
&reftitle.resources;
<para>
This extension uses two resource types: "newt component" and "newt grid".
Resource type "newt component" is returned by functions, which create
common newt widgets (for example: <function>newt_button</function>)
Resource type "newt grid" is a special link identifier for components,
returned by newt grid factory functions (for example: <function>newt_create_grid</function>)
</para>
</section>
<!-- Information found in constants.xml -->
&reference.newt.constants;
<section id="newt.examples">
&reftitle.examples;
<para>
This example is a PHP port of RedHat 'setup' utility dialog, executed in text
mode.
</para>
<example>
<title>Newt Usage Example</title>
<programlisting role="php">
<![CDATA[
<?php
newt_init ();
newt_cls ();
newt_draw_root_text (0, 0, "Test Mode Setup Utility 1.12");
newt_push_help_line (null);
newt_draw_root_text (-30, 0, "(c) 1999-2002 RedHat, Inc");
newt_get_screen_size (&$rows, &$cols);
newt_open_window ($rows/2-17, $cols/2-10, 34, 17, "Choose a Tool");
$form = newt_form ();
$list = newt_listbox (3, 2, 10);
foreach (array (
"Authentication configuration",
"Firewall configuration",
"Mouse configuration",
"Network configuration",
"Printer configuration",
"System services") as $l_item)
{
newt_listbox_add_entry ($list, $l_item, $l_item);
}
$b1 = newt_button (5, 12, "Run Tool");
$b2 = newt_button (21, 12, "Quit");
newt_form_add_component ($form, $list);
newt_form_add_components ($form, array($b1, $b2));
newt_refresh ();
newt_run_form ($form);
newt_pop_window ();
newt_pop_help_line ();
newt_finished ();
newt_form_destroy ($form);
?>
]]>
</programlisting>
</example>
</section>
</partintro>
&reference.newt.functions;
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->