View on GitHub


Test Coverage
<?xml version="1.0" encoding='ISO-8859-1'?>
<?xml-stylesheet href="/usr/share/xml/docbook/stylesheet/css/current/driver.css" type="text/css"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
<!ENTITY version "2.8.0">
<!ENTITY dx "DocBook-XML">
<!ENTITY concept SYSTEM "concept.xml">
<!ENTITY advanced SYSTEM "advanced.xml">
<!ENTITY widgets SYSTEM "widgets.xml">
<!ENTITY cwm_table SYSTEM "cwm_table.xml">
<!ENTITY table_popup SYSTEM "table_popup.xml">
<!ENTITY dialog_tree SYSTEM "dialog_tree.xml">
<!ENTITY cwm_tab SYSTEM "cwm_tab.xml">
<!ENTITY service_start SYSTEM "service_start.xml">
<!ENTITY tsig_keys SYSTEM "tsig_keys.xml">
<!ENTITY terminology SYSTEM "terminology.xml">
<!ENTITY tutor SYSTEM "tutor.xml">

<!ENTITY date "March 2009">

<book id="cwm">
    <title>Common Widget Manipulation Tool</title>
    <subtitle>Simple manipulation with widgets</subtitle>
    <copyright><year>2003</year><holder>SUSE LLC</holder></copyright>
    <legalnotice id="id_legal">
      <para>This document is meant for YaST2 development only.</para>
      <para>Simple manipulation with widgets. Version &version; - &date;</para>
    <chapter id="intro">
Currently commonly used technique to create dialogs brings several problems.
The most important are:
            <listitem><para>Handling of all events is at one place, in one
function, it is a little "spaghetti code"</para></listitem>
        <listitem><para>Moving one widget from one dialog to another one
brings the need to move also appropriate pieces of code used to set appropriate
value to the widget and when leaving the dialog store the widget state to some
        <listitem><para>If one widget should be placed in multiple dialogs,
then pieces of code related to the widget are duplicated</para></listitem>
Because of this it is useful not to bind the handling routines to a dialog,
but to a widget.
If the widgets have separated pieces of code related to it one from each other
and all from the event loop, the code will be more transparent and easier to
Also moving of a widget from one dialog to another one will mean minor changes
to the whole code, without need to check where the events related to the widget
are handled.
<listitem><para>Documentation update:
<listitem><para>Examples screenshots</para></listitem>
<listitem><para>Runnable examples</para></listitem>
<listitem><para>Polish (better examples, using Popup:: module,...)</para></listitem>
<listitem><para>Predefined useful routines</para></listitem>
<listitem><para>Differences between description and real status</para></listitem>
<listitem><para>Table Up/Down buttons handling</para></listitem>