Definitions in Tix.hs


The Tix environment

The Tix environment extends the Tk environment by providing three new methods:
struct TixEnv < TkEnv =
  tixWindow  :: [WindowOpt]     -> Request TixWindow
  fileDialog :: [FileDialogOpt] -> Request FileDialog
  popupMenu  :: [PopupMenuOpt]  -> Request PopupMenu
A TixWindow is an extension of a Tk Window with some new widgets. A FileDialog and a PopupMenu should be self-explanatory, except for the fact that the popup menu is provided here (and not as a method of TixWindow), since it can be bound to different top-level windows.

TixWindows

A TixWindow extends a Tk BasicWindow:
struct TixWindow < TixBasicWindow WindowOpt, ManagedWindow, Window

struct TixBasicWindow a < BasicWindow a =
  toolTip            :: [FrameOpt]         -> Request ToolTip
  comboBox           :: Bool -> [ComboOpt] -> Request ComboBox
  spinBox            :: [SpinBoxOpt]       -> Request SpinBox
  hList              :: [HListOpt]         -> Request HList
  noteBook           :: [NoteBookOpt]      -> Request NoteBook
  panedWindow        :: [PanedWindowOpt]   -> Request PanedWindow
  optionMenu         :: [String] -> [OptionMenuOpt] -> Request OptionMenu
  scrolledHList      :: [ScrHListOpt]      -> Request ScrolledHList
  scrolledListBox    :: [ScrListBoxOpt]    -> Request ScrolledListBox
  scrolledTextEditor :: [ScrTextEditorOpt] -> Request ScrolledTextEditor
  scrolledTree       :: [ScrTreeOpt]       -> Request ScrolledTree
  scrolledBasicWindow:: [ScrWindowOpt]     -> Request ScrolledBasicWindow
All the methods produce window widgets.

File dialogs

A FileDialog is a widget that can be popped up on screen (using the popup method) and allows the user to browse files and directories and select a file. The file dialog can be configured with the CmdString option, thus installing a callback procedure that will be applied to the file name that the user selected. The buttons that appear in the dialog can be accessed with the sub... methods, thus permitting change of text or changed behavior.
struct FileDialog < ConfWidget FileDialogOpt, PopupWidget =
  subOK, subFilter, subCancel, subHelp :: Button

struct PopupWidget =
   popup   :: Action
   popdown :: Action

data FileDialogOpt  > StdOpt, CmdString

data CmdString = CmdString (String -> Cmd ())

Popup menus

A Popup menu has a full-scale Menu as a subwidget, but presently only limited behavior: it can be attached to a widget by using its attachTo method; after that it pops up at the place of the mouse cursor when the user presses the right mouse button over that widget and disappears after user selection. The menu is built using menu methods from Tk, using the sub... methods to access the subwidgets.
type PopupMenuOpt = Title

struct PopupMenu < Configurable PopupMenuOpt, HasMenu, HasMenuButton =
  popupIn       :: Widget -> Action

struct HasMenu =
  subMenu :: Menu

struct HasMenuButton =
  subMenuButton :: MenuButton

TixWindow widgets

In addition to the window widgets in BasicWindow, a TixWindow provides the following widgets:
struct ToolTip < WWidget FrameOpt, HasLabel = 
   attachTo     :: Widget -> String -> Action

struct ComboBox < WWidget ComboOpt, LineEditable, 
                  Cell Int, HasLabel, HasListBox, HasEntry

struct SpinBox < WWidget SpinBoxOpt, Cell Int, HasLabel, HasEntry

struct OptionMenu < WWidget OptionMenuOpt, Cell Int

struct HList < WWidget HListOpt, Cell [String] =
  addEntry :: [HListEntryOpt] -> Request HListEntry
  childAt  :: HListPath -> Request HListEntry

struct PanedWindow < WWidget PanedWindowOpt =
  pane :: [PaneOpt] -> Request (TixBasicWindow PaneOpt)
  
struct NoteBook < WWidget FrameOpt =
  page   :: [PageOpt] -> Request (TixBasicWindow PageOpt)
  raised :: Request (Maybe(TixBasicWindow PageOpt))

struct ScrolledTree < WWidget ScrTreeOpt, HasHList = 
  decorate :: Action

struct ScrolledListBox < WWidget ScrListBoxOpt, HasListBox 
   
struct ScrolledWindow < WWidget ScrWindowOpt, HasBasicWindow 
   
struct ScrolledTextEditor < WWidget ScrTextEditorOpt, HasTextEditor

struct ScrolledHList < WWidget ScrHListOpt, HasHList

type PopupMenuOpt = Title
data PanedWindowOpt > StdOpt, Orientation
data PaneOpt        > Min, Max, ExpandRate
data PageOpt        > CLabel, Img, Btmp, Enabled, Underline, Justify, RaiseCmd
data FileDialogOpt  > StdOpt, CmdString
data ComboOpt       > StdOpt, CmdString, CLabel, Dropdown
data SpinBoxOpt     > StdOpt, CmdInt, CLabel, Min, Max, Step
type NoteBookOpt = StdOpt
data HListOpt         > StdOpt, Font, Foreground, 
                        SelectMode, CmdString, DrawBranch
data HListEntryOpt    > Btmp, Img, Text
data ScrWidgetOpt     > StdOpt, ScrollPolicy
type ScrTextEditorOpt = ScrWidgetOpt
type ScrHListOpt      = ScrWidgetOpt
type ScrTreeOpt       = ScrWidgetOpt
type ScrWindowOpt     = ScrWidgetOpt
data ScrListBoxOpt    > ScrWidgetOpt, Command, Anchor
data OptionMenuOpt    > StdOpt, CmdString, Enabled, CLabel
Several of these widget types have supertypes with names of the form HasXXX where XXX is a window widget type. All these structures have one single element, namely subXXX :: XXX. Thus these Tix widgets have a Tk window widget as a subwidget, and this subwidget can be accessed and its methods (from Tk) used.

A brief description of these widgets are: