WindowAttributes

This page documents the new window attributes introduced in version 8.1a4
of AlphaX. These attributes let you select which controls should be drawn
when creating a new window with the [new] or the [openFile]
commands. By passing appropriate values via the -attr option in these
commands, one can now specify that a particular control be absent from the
window.

Traditionally, document windows in AlphaX come equipped with a certain number of
controls. In the top right corner of the contents area, one can find :

a small square known as the Dirty State Button which displays a red floppy disk icon when the document is unsaved

three popup menus known respectively as the VCS Popup, the Parse Popup and the Marks Popup

a small rectangle known as the Split Handle which allows to split the window into two panes

Other elements are also considered as window controls:

the vertical and horizontal scrollbars

the toolbar at the top of the window (introduced in AlphaX 8.1a4)

the message bar at the bottom of the window (introduced in AlphaX 8.1a4)

the resize handle (small square in the bottom right corner of the window)

the three buttons in the left part of the title bar, known respectively as the close button, the collapse button and the zoom button

For each of these controls, there is a flag stating that this control
should not be drawn. These flags are additive so that the new -attr
option's value is the sum of all the flags corresponding to the elements
you want to remove. A value of 0 corresponds to the traditional window
layout.
The flag values are shown in the table below:

No Toolbar

(1 << 0)

1

No Dirty State

(1 << 1)

2

No Vcs Popup

(1 << 2)

4

No Parse Popup

(1 << 3)

8

No Marks Popup

(1 << 4)

16

No Split Handle

(1 << 5)

32

No Message Bar

(1 << 6)

64

No Vertical Scrollbar

(1 << 7)

128

No Horizontal Scrollbar

(1 << 8)

256

No Close Button

(1 << 9)

512

No Collapse Button

(1 << 10)

1024

No Zoom Button

(1 << 11)

2048

No Resize Handle

(1 << 12)

4096

No Toolbar Button

(1 << 13)

8192

Note that in the case of the close button, the collapse button
and the zoom button, specifying the corresponding flag means
in fact that they will be drawn in disabled state.

Examples

Important Temporary Note

The examples below apply to the [new] and [openFile] core commands. Some modifications will be necessary in the AlphaTcl library to make them available with the redefined [new] command and with the [edit] command which is built on top of the [openFile] command. Since AlphaTcl renames the core [new] command as [__new] (with two underscores), you can try the examples directly with [__new].

Create a window without a toolbar

new -n FooWin -attr 1

Create a window without the VCS, Parse and Marks popup controls

new -n FooWin -attr 28

The value 28 is the sum of 16 (noMarksPopup), 8 (noParsePopup) and 4
(noVcsPopup). The vertical scrollbar's top is moved up accordingly.

Add 2 to the previous example and there will be no Dirty State button
either:

new -n FooWin -attr 30

Create a non resizable window:

new -n FooWin -attr 6144

because 6144 = 2048 + 4096 = noZoom + noResize

The sum of all the attributes is 8191 (since 1+2^1+...+2^12 = 2^13 -
1 = 8191). This creates a completely bare window:

new -n FooWin -attr 8191

The same -attr option is also supported by the [openFile]
command. For instance: