# Using KCWin for Input/Output Windows

`KCWin` is a standard plugin distributed with KildClient that allows you to create windows with a terminal for output and an entry box for input. These windows do nothing by themselves, but they can be used by other plugins when they need a window for input and output. The output area supports ANSI colors and thus is like a mini MUD window.

This plugin requires the gtk3-perl bindings. It will fail to run if these bindings are not found.

This plugin is more often used as a helper for other plugins. A plugin that uses `KCWin` should use `$::world->requireplugin('KCWin')` in a `BEGIN` block, as described in Section E.5.1, “Plugins That Require Other Plugins”.

Use `KCWin->new` to create a new window. `KCWin` derives from `Gtk3::Window` so you can use all of its methods.

The widgets are accessible for customization. If `$kcw` is a `KCWin`, the following widgets are available:

- `$kcw->{VBOX}`, `Gtk3::Box`, the vertical box that contains the output and input areas.

- `$kcw->{SCROLLWIN}`, `Gtk3::ScrolledWindow`, this holds the TextView that is used for output.

- `$kcw->{TEXTVIEW}`, `Gtk3::TextView`, is the widget used for output.

- `$kcw->{TEXTBUFFER}`, `Gtk3::TextBuffer`, for convenience, the TextBuffer displayed in the window.

- `$kcw->{CMDAREA}`, `Gtk3::HBox`, a box that holds a button to clear the input area, and the input area itself.

- `$kcw->{BTNCLEAR}`, `Gtk3::Button`, a button that clears the input entry widget when clicked.

- `$kcw->{ENTRY}`, `Gtk3::Entry`, the input entry widget. Connect to the activate signal of this widget to do something when the user presses ENTER in this widget.

The widgets can be used, and the window can be customized (by adding other widgets, for example). Some common actions have functions in `KCWin` as a shortcut. These functions will be described in the following sections.