# Common Widget Manipulation Tool

Simple manipulation with widgets

Jiri Srain
2003 SUSE LLC

This document is meant for YaST2 development only.

Simple manipulation with widgets. Version &version; - &date;

## Introduction

Currently commonly used technique to create dialogs brings several problems. The most important are:

- Handling of all events is at one place, in one function, it is a little "spaghetti code"

- 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 variable

- If one widget should be placed in multiple dialogs, then pieces of code related to the widget are duplicated

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 maintain.

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.

## TODO

- Testsuite

- Documentation update:

  - Examples screenshots

  - Runnable examples

  - Polish (better examples, using Popup:: module,...)

  - Predefined useful routines

  - Differences between description and real status

  - Table Up/Down buttons handling

&terminology; &concept; &advanced; &widgets; &cwm_table; &table_popup; &dialog_tree; &cwm_tab; &service_start; &tsig_keys; &tutor;