<CHAPTER ID="chapter.widget.button">
  <TITLE>The button widget</TITLE>
<p>
A button is a widget that displays a textual string, bitmap or image. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines or if wrapping occurs because of the wrapLength option) and one of the characters may optionally be underlined using the underline option. It can display itself in either of three different ways, according to the state option; it can be made to appear raised, sunken, or flat; and it can be made to flash. When a user invokes the button (by pressing mouse button 1 with the cursor over the button), then the Oz action specified in the action option is invoked.

Parameters :

activebackground



The introductory example showed the building of a simple application and how its gui is expressed in QTk. This chapter will detail all the informations you need to start working with QTk. The geometry management and the different principles of QTk are described.

<section> <TITLE>Geometry management</TITLE>

The geometry management is done by means of dedicated widgets :
<LIST>
<ITEM> td which organizes widgets top down.
<ITEM> lr which organizes widgets from left to right.
</LIST>

By default all widgets take exactly the size they need to draw themselves. If there is more space available, widgets are centered by default inside that space. That behaviour can be changed by the glue paramater all widgets have. Valid values for this parameter are atoms that are a combination of the letters &laquo;n>>, &laquo;s>>, &laquo;w>> and &laquo;e>> that correspond respectively to the top, bottom, left and right side of the widget. Gluing a side consist of placing a constraint on that side with its corresponding neighboor. Gluing two opposite sides have result in the widget taking all the space available in the direction of these sides.

Let's consider :

&laquo;lr(glue:nswe
   button(text:"Left")
