GNU TeXmacsUser manualReferenceAboutEnglish·Français
The graphical user interface (historical Widkit toolkit)

Warning 1. This chapter describes the original graphical toolkit of TeXmacs, called Widkit, together with its X11 backend. This toolkit still lives in the directories

src/src/Plugins/Widkit

and

src/src/Plugins/X11

. The widgets of Widkit are used by three of the current ports, which only differ by the implementation of the window interface (window_rep): X11 (./configure --with-gui=x11, x_window_rep), SDL (--with-gui=sdl, sdl_window_rep in

Plugins/SDL

, drawing with MuPDF) and Qtwk (--with-gui=qtwk, qtwk_window_rep in

Plugins/Qtwk

, Qt as a mere platform layer). The default user interface is based on the native widgets of Qt (

Plugins/Qt

), and the Vue (

Plugins/Vue

) and Cocoa (

Plugins/NS

) ports have widgets of their own; all user interfaces implement the abstract widget interface from

src/src/Graphics/Gui

. For an up-to-date description of the abstract widget system, of the main TeXmacs window and of the Scheme widget language, we refer to the chapter on the abstract widget system; for the graphical output, see the chapter on renderers. The present chapter dates back to the early days of TeXmacs; it has been revised so that the names used below correspond to the current sources, but it should mainly be read as a description of the design of Widkit.

1.Introduction

1.1.Main architecture

The Widkit toolkit has two main components: an abstract window interface, which is very similar to X Window, and the actual toolkit. The abstract window interface was first implemented for X Window, and later for SDL and for Qt (the Qtwk port).

The X11 implementation of the window interface consists of three main classes (see

Plugins/X11

): x_gui_rep, x_window_rep and x_drawable_rep. The x_gui_rep class (there is only one instance the_gui) is responsible for

The x_window_rep class implements the abstract class window_rep from

Graphics/Gui/window.hpp

and is responsible for

The graphical routines are provided by the x_drawable_rep class, which inherits from the abstract renderer_rep class (

Graphics/Renderer/renderer.hpp

). The same renderer interface is implemented for printing and for other output devices. Hence, user applications draw their graphics on a renderer, which allows them to visualize them in a window or to print them. In the original design, windows directly inherited from the “PostScript device” class, which played the role of renderers.

The graphical toolkit built on top of the abstract window interface is widget oriented. A large number of widget classes are implemented, which all inherit from the abstract wk_widget_rep class, which itself derives from the abstract widget_rep class of

Graphics/Gui/widget.hpp

. Widgets may have a finite number of children and they are responsible for

1.1.1.A simple example

In order to create a window “Test” with the text “Hello world” in it, one first opens the connection with the graphical system, then creates the widget with the text and finally the window, with the widget attached to it. Schematically:

gui_open (argc, argv);
wk_widget wid= text_wk_widget ("Hello world");
wk_widget win= plain_window_widget (wid, "Test");

Technically speaking, the window creation amounts to several actions:

The next step is to make the window visible by

win->win->set_visibility (true);

At this point repaint requests are generated, which are handled when starting the event loop by

gui_start_loop ();

The event loop terminates when all windows have been destroyed. A window widget win is destroyed using

destroy_window_widget (win);

At the end, the connection with the graphical system is closed by

gui_close ();

The user only has to bother about destroying windows; widgets are automatically destroyed if they are no longer being referenced to.

1.2.Widgets and event processing

From the implementation point of view, widgets are pointers to instances of the abstract widget representation class wk_widget_rep. Moreover, the wk_widget class supports reference counting. The wk_widget_rep class contains information about the window it is attached to and its location within this window, its size, the position of the origin of its local coordinates (north_west, north, etc.) and its children. The wk_widget_rep class also provides a virtual event handler wk_widget_rep::handle. This handler returns true if the event could be handled.

The implemented widget representation classes are organized in a hierarchy, which contains both concrete and abstract classes. The abstract classes reimplement the virtual event handler handle in such a way that if the event is recognized, then the event is dispatched to a more particular virtual event handler, possibly after some processing.

For example, instances of the basic_widget_rep class (

Plugins/Widkit/basic_widget.hpp

) can handle the most common events, such as keyboard, mouse, repaint events and so on. If a key is pressed, then the virtual function basic_widget_rep::handle_keypress is called with an argument of type keypress_event. The default implementation of this virtual function does nothing.

The user can also create his own events, which he can pass to any widget. For instance in order to invalidate a region for redrawing, one creates an invalidate event using emit_invalidate and sends it to the appropriate widget using the operator <<. Notice that the user is responsible for sending events to widgets which can handle them. Bad matches are only discovered at run time, in which case a warning is printed by <<.

1.2.1.A simple example

Suppose that we want to make a widget, which tracks keyboard events and which displays them. Such a widget must have a construction routine and keyboard and repaint handlers:

class track_widget_rep: public basic_widget_rep {
  string last_key;
public:
  track_widget_rep ();
  operator tree ();
  void handle_keypress (keypress_event ev);
  void handle_repaint (repaint_event ev);
};

The constructor is taken to be empty and places the origin at the center of the widget

track_widget_rep::track_widget_rep (): basic_widget_rep (center) {}

In particular last_key is initialized by the empty string. The conversion to trees is only used for debugging purposes:

track_widget_rep::operator tree () {
  return tree (TUPLE, "track", last_key); }

We also define the function

wk_widget
track_widget () {
  return tm_new<track_widget_rep> ();
}

in order to create an instance of a track_widget.

The event handler for keyboard events should just reset the string last_key and invalidate the entire widget region.

void
track_widget_rep::handle_keypress (keypress_event ev) {
  last_key= ev->key;
  this << emit_invalidate_all ();
}

The event handler for repainting first determines the string to be repainted as a function of last_key, computes its extents and repaints it at the center. The renderer on which the widget should be drawn is part of the repaint event.

void
track_widget_rep::handle_repaint (repaint_event ev) {
  renderer ren= ev->win;
  string s= (last_key == ""? string ("No key pressed"): "Pressed " * last_key);
  font fn= get_default_font ();
  metric ex;
  fn->get_extents (s, ex);
  layout_default (ren, ev->x1, ev->y1, ev->x2, ev->y2);
  ren->set_pencil (black);
  fn->draw (ren, s, -(ex->x1+ex->x2)>>1, -(ex->y1+ex->y2)>>1);
}

Real widgets, such as the text widget in

Plugins/Widkit/Output/text_widget.cpp

, follow this pattern but take additional care of styles, colors and shrinking factors.

2.The abstract window interface

The abstract interface for windows is the class window_rep in

Graphics/Gui/window.hpp

. It provides methods to change the name, the size, the position and the visibility of the window, to invalidate regions (invalidate), to translate regions, to manage the keyboard focus (set_keyboard_focus) and to grab the mouse (set_mouse_grab). Global operations, such as opening and closing the connection with the graphical system, the event loop, selections and default fonts are provided by the functions in

Graphics/Gui/gui.hpp

, such as gui_open, gui_start_loop, gui_close, set_selection and get_selection.

3.Widget principles

3.1.The widget class

Widgets are pointers to instances of the abstract widget representation class wk_widget_rep. Widgets support reference counting, so that a widget is automatically destroyed if it is not used any more (except in the case of circular referencing; see below). As a general rule, the user does not have to worry about the creation and destruction of widgets.

3.1.1.The widget representation class

The definition of the wk_widget_rep class (

Plugins/Widkit/wk_widget.hpp

) goes essentially as follows:

class wk_widget_rep: public widget_rep {
public:
  window   win;              // underlying window
  SI       ox, oy;           // origin of widget in window
  SI       w, h;             // width and height of widget
  gravity  grav;             // position of the origin in the widget
  array<wk_widget>  a;       // children of widget
  array<string>     name;    // names for the children

  wk_widget_rep (array<wk_widget> a, array<string> name, gravity grav);
  virtual operator tree () = 0;
  virtual bool handle (event ev) = 0;

  SI    x1 (); SI y1 (); // lower left window coordinates of widget
  SI    x2 (); SI y2 (); // upper right window coordinates of widget
  bool  attached ();     // tests whether (win != NULL)
  …
};

The win field specifies the window to which the widget is attached (win=NULL, by default). The origin (ox,oy) of the widget is specified with respect to the window's origin. Next come the width w and the height h of the widget. The gravity grav determines where the origin of the widget is located (north_west, north, etc.). The array a specifies the children of the widget. The array name gives names to the children of the widget. This is useful for addressing children by comprehensible names; the names are also useful for designing menu widgets.

The virtual type casting operator for trees is used for debugging purposes; mainly in order to print widgets. The virtual member function handle processes an event which is sent to the widget and returns true if the event could be handled and false if not. The methods send, query, notify, read and write implement the abstract widget interface from

Graphics/Gui/widget.hpp

in terms of Widkit events (see

Plugins/Widkit/Basic/widkit_wrapper.cpp

).

3.1.2.The widget class

The wk_widget class is declared using the macro ABSTRACT_NULL (see the chapter on basic data types), with the following additional methods:

class wk_widget {
public:
ABSTRACT_NULL(wk_widget);
  inline wk_widget operator [] (int i) { return rep->a[i]; }
  wk_widget operator [] (string s);
  inline operator tree () { return (tree) (*rep); }
  inline bool operator == (wk_widget w) { return rep == w.rep; }
  inline bool operator != (wk_widget w) { return rep != w.rep; }
};

Widgets may be constructed in two ways. First, we may construct a symbolic “nil” widget by wk_widget (). The function is_nil is provided in order to test whether a widget is “nil”. Secondly, we may construct a widget from a pointer of type wk_widget_rep*. The functions abstract and concrete convert between wk_widget and the abstract widget type.

The reference counting mechanism ensures widgets to be destroyed when they are no longer pointed to. An important exception is when two widgets point one to each other, which fools the reference counter (for instance a scrollbar and the widget which is scrolled need to point one to each other). In order to deal with such “circular dependencies”, one works directly with wk_widget_rep* pointers if one does not want the pointer to be taken into account in the reference counter.

Child widgets can again be accessed in two ways. First, we have the direct way, using its index in the array a. Secondly, we can access a child via its name. Actually, when using this method, a get_widget event is generated. In the basic widget class, the default action for this event is to search in the name array for the child. However, the user may override this default action and provide another child searching method.

3.2.The event class

Events are pointers to instances of the abstract event_rep class, which supports reference counting. Actually, concrete event representation classes just contain some information. Hence, events actually provide a safe and generic way to store and communicate information.

3.2.1.The event representation class

The definition of the event_rep structure (

Plugins/Widkit/event.hpp

) is as follows:

struct event_rep: public abstract_struct {
  int     type;  // the event type
  inline  event_rep (int type2): type (type2) {}
  inline  virtual ~event_rep () {}
  virtual operator tree () = 0;   // for displaying events (debugging)
};

The type field gives the type of the event. A complete list of the event types is given in the file

Plugins/Widkit/Event/event_codes.hpp

When adding new event types, one should make sure that the numbers of all event types are different. Unfortunately, there is no safe way in order to let this job be done by the compiler.

3.2.2.The event class

The event structure is defined by

struct event {
ABSTRACT(event);
  inline operator tree () { return (tree) (*rep); }
  friend class event_ptr_base;
};
ABSTRACT_CODE(event);

3.2.3.Concrete event classes

Concrete event classes again come into two parts: the class itself and its representation class. For instance, the representation class for get_widget events is defined in

Plugins/Widkit/Event/basic_event.hpp

by

struct get_widget_event_rep: public event_rep {
  string which; wk_widget& w;
  get_widget_event_rep (string which, wk_widget& w);
  operator tree ();
};
EVENT(get_widget_event);

The macro EVENT from

event_codes.hpp

defines the corresponding get_widget_event class as event_ptr<get_widget_event_rep>. The template event_ptr provides the operator -> for accessing the fields of the representation class, as well as conversions from and to the generic event class. Moreover, the generic event class and the specific get_widget_event class are compatible from the reference counting point of view.

The implementation of the get_widget_event_rep class is as follows:

get_widget_event_rep::get_widget_event_rep (string ww, wk_widget& w2):
  event_rep (GET_WIDGET_EVENT), which (ww), w (w2) {}
get_widget_event_rep::operator tree () {
  return tree (TUPLE, "get_widget_event", which); }

The actual events are created by

event get_widget (string which, wk_widget& w) {
  return tm_new<get_widget_event_rep> (which, w); }

3.2.4.Event handlers

Implementations of the generic event handler bool wk_widget_rep::handle (event) usually do the following

For instance, the event handler for composite widgets is as follows:

bool
composite_widget_rep::handle (event ev) {
  switch (ev->type) {
  case CLEAN_EVENT:
    handle_clean (ev);
    return true;
  case INSERT_EVENT:
    handle_insert (ev);
    return true;
  case REMOVE_EVENT:
    handle_remove (ev);
    return true;
  }
  return basic_widget_rep::handle (ev);
}

The member function handle_insert essentially does the following:

void
composite_widget_rep::handle_insert (insert_event ev) {
  a << ev->w;
  name << ev->s;
}

In particular, we can retrieve the fields w and s from insert_event_rep from the insert_event in the member function.

3.2.5.Adding your own event classes

Summarizing, in order to add your own new event classes, you have to take care of the following steps:

3.3.The main event loop

The main event loop (x_gui_rep::event_loop in

Plugins/X11/x_loop.cpp

) does the following

3.4.Coordinates

3.4.1.Coordinates, pixels and rounding

All coordinates and sizes are represented by instances of type SI, which is nothing but another name for int. The SI constant PIXEL (which is equal to 256) denotes the size of a pixel on the screen. Since PIXEL>1, coordinates and sizes are not necessarily integer multiples of the pixel size. However, the coordinates of the origin and the size of a widget should always be such multiples.

In order to achieve this, some rounding functions are provided by the renderers. The member function round (SI& x, SI& y) rounds its arguments to integer multiples of PIXEL. Furthermore, the member functions

void inner_round (SI& x1, SI& y1, SI& x2, SI& y2);
void outer_round (SI& x1, SI& y1, SI& x2, SI& y2);

transform a rectangle into a new one with integer multiple of PIXEL coordinates, which is enclosed resp. encloses the original rectangle. Similar functions abs_round, abs_inner_round etc. are available outside renderers.

3.4.2.Local and global coordinates

Each widget has an origin (ox,oy) with respect to the window to which it has been attached. This is the origin of the “local coordinates”. The origin of the “global coordinates” is the origin of the window. The location of the local origin in the widget is determined by the widget's gravity, which is either one of north_west, north, north_east, west, center, east, south_west, south or south_east.

As a general rule, events are transmitted in global coordinates. Nevertheless, in widgets which are derived from the abstract basic widget class, by default, all computations are done with respect to local coordinates. This is due to two reasons

3.4.3.Screen coordinates

For some very particular purposes, such as popping up windows, one has to perform computations with respect to the screen coordinates. Given a point (x,y) in the coordinates of some window win, the screen coordinates of (x,y) are obtained by adding the window's origin, which is obtained by calling win->get_position (ox,oy).

3.5.Attaching and positioning widgets

3.5.1.Attaching widgets

When a widget is created, the win field of its representation is set to NULL, since it is not yet attached to a window. In order to attach a widget w to a window win, one emits an attach_window_event:

w << emit_attach_window (win);

Notice that taking win==NULL results in detaching the widget. Notice also that a widget may be attached to at most one window: attempts to reattach a widget, which is already attached, to another window, result in an error.

Some events can be handled by widgets which are not yet attached to a window, such as:

For some of these events, such as attribute changes, it may be necessary to emit invalidate events in case when the widget had been attached to some window. In order to test this one uses the member function

bool wk_widget_rep::attached ();

3.5.2.Positioning widgets

When an appropriate size (w,h) has been determined for a widget (using “get size” events) and when a widget has been attached to some window, the widget is positioned in the main window. By default, all children are recursively positioned at the top left of the window at sizes (w,h). But for complex widgets with children, a specific positioning routine usually has to be implemented.

Such a routine involves positioning of the children within the parent. This is done by emitting position events to the children. For instance,

a[i] << emit_position (x[i], y[i], w[i], h[i], center);

positions the i-th child, such that the origin of a[i] is at position (x[i], y[i]) w.r.t. the local coordinates of this and such that the origin is situated in the center of a[i]. The width and height of a[i] are set to w[i] resp. h[i].

3.5.3.Repositioning widgets

During execution, it may happen that a particular widget has changed, so that it obtains a different size and/or position. In this case, one emits an update_event to the closest ancestor, whose position and size did not change.

For instance, consider the case of a footer footer, which consists of a left footer footer["left"], followed by some glue footer["middle"] and a right footer footer["right"]. When the left footer changes:

footer << set_widget ("left", text_wk_widget ("new text"));

the size of footer["left"] changes, and the size and position of the glue should also be changed. Nevertheless, the size and position of footer remain unaltered, whence we update footer:

footer << emit_update ();

Updating an attached widget results in three actions to take place:

3.6.The keyboard

3.6.1.Keyboard focus

Each window win on the screen determines a main widget which is attached to it and a descendant win->kbd_focus of this widget, which handles the keyboard input directed to the window. This latter widget, which is set to the main widget by default, is said to have keyboard focus, if the window win has keyboard focus (i.e. if all keyboard events are sent to this window). Consequently, the widget which has keyboard focus receives all keyboard events.

When the keyboard focus of a window win changes, a keyboard_focus_event is sent to the widget with the keyboard focus. The field ev->flag of this event ev is true if the window got the focus, and false if the window lost focus.

The keyboard focus widget associated to a window can be changed by calling the window_rep member function

void window_rep::set_keyboard_focus (widget wid, bool get_focus= true);

Setting the input focus to another widget than the main widget is useful, for instance, if a particular text input field of some form needs keyboard focus after a mouse click on it.

3.6.2.Keyboard events

When a widget has the keyboard focus, and a key is pressed, it receives a keypress_event. The keypress_event_rep class contains a field key, which contains a comprehensible string corresponding to the key which was pressed, and a field t with the time of the event.

More precisely, key is either a one character string, a universal symbol like "<alpha>", or a symbolic name like "return", "right", "delete", etc. Modified keys are obtained by prefixing the key by "S-" (shift), "C-" (control), "A-" (alt) or "M-" (meta), as in "S-F1", "C-escape" or "A-x". The names of the special keys include:

"F1", "F2", …, "F12", "escape", "tab", "backspace", "delete",
"return", "space", "insert", "home", "end", "pageup", "pagedown",
"left", "up", "down", "right"

The complete translation of the X11 key symbols can be found in

Plugins/X11/x_init.cpp

. The same naming conventions are used by the other user interfaces, and by the keyboard bindings in Scheme.

3.7.The mouse

3.7.1.Mouse events

A mouse event ev occurs on a button change or a mouse movement. The ev->type field contains the type of the event and ev->x and ev->y the corresponding coordinates of the mouse. Finally, the states of the mouse buttons can be questioned using the routine ev->pressed (string).

The possible values of ev->type on button change events are the following:

"press-left", "press-middle", "press-right", "press-up", "press-down",
"release-left", "release-middle", "release-right", "release-up", "release-down"

where "up" and "down" correspond to the mouse wheel. The possible values for mouse movement events are

"move", "enter", "leave"

The "enter" and "leave" events occur when the mouse enters resp. leaves the widget. Finally, the states of the left, middle and right mouse buttons can respectively be obtained using the calls

ev->pressed ("left")
ev->pressed ("middle")
ev->pressed ("right")

3.7.2.Grabbing the mouse

For some applications such as popup menus or scrollbars, it is useful to direct all mouse events to a particular widget w. This is done by grabbing the mouse by

wk_grab_pointer (w);

After such a grab, all mouse events are directed to w. The mouse grab is released by

wk_ungrab_pointer (w);

Actually, the x_gui_rep class keeps track of a list of widgets for which a mouse grab occurred: if the mouse is grabbed by widgets w1 next w2, and again ungrabbed by w2, then all mouse events are again sent to w1. This feature is useful for successive grabs by recursive popup menus. The widgets are informed of the changes by mouse_grab_events.

When a widget w1 grabs the mouse, and a previous mouse grab on a widget w2 is still active, then a "leave" event is sent to w2 and an "enter" event to w1. Similarly, if w1 releases the grab, then a "leave" event is sent to w1 and an "enter" event to w2.

3.8.The screen

Each window keeps track of a list of rectangles to be repainted (moreover, redundant rectangles are eliminated automatically and adjacent rectangles are transformed in larger rectangles). During the repaint stage in the event loop, the widget is requested to repaint these rectangles.

3.8.1.Repainting rectangles

The repaint handler takes on input a repaint_event ev, which determines the renderer ev->win on which to draw and the rectangle to be repainted. Moreover, repaint_event_rep contains a boolean field stop, which can be set in order to indicate that the repaint process was stopped somewhere in the middle.

Indeed, for widgets which take a long time to be repainted, it may be useful to abort repainting if a key is pressed. The arrival of an event which aborts repainting can be checked using the function check_event (INTERRUPT_EVENT) or gui_interrupted () from

Graphics/Gui/gui.hpp

.

If the application decides to abort repainting, it sets ev->stop to true. The rectangle which was being repainted is put back on the invalid rectangles list in the event loop; it will be processed again during the next pass through the repaint phase.

3.8.2.Invalidation of rectangles

When a window is mapped on the screen or when a region is exposed, the window interface automatically invalidates the corresponding rectangle. The user may also invalidate a rectangle by using either one of the routines

event emit_invalidate_all ();
event emit_invalidate (SI x1, SI y1, SI x2, SI y2);

The first routine creates an event to invalidate the entire widget area; the other routine invalidates a specified region.

3.9.The toolkit

The constructors of the standard widgets are declared in

Plugins/Widkit/wk_widget.hpp

; their implementations can be found in the subdirectories of

Plugins/Widkit

(Basic, Composite, Attribute, Output, Button, Input, Scrollable and Misc).

3.9.1.Other standard widget classes

Many widgets from the toolkit are derived from some other standard abstract widget classes, which can handle some other special events.

3.9.2.Composite widgets

These widgets allow to add or remove children to or from a widget. This makes them particularly useful for menu widgets. They respond to clean, insert and remove events (created by emit_clean, emit_insert and emit_remove).

3.9.3.Attribute widgets

These widgets allow to set window attributes of some common types such as integers, strings, commands, points, etc. They can be used for instance to retrieve an input string or in order to set the scroll position in a canvas widget. The corresponding events are created by functions like get_string, set_string, get_integer, set_coord2, etc.

3.9.4.Glue widgets

Glue widgets are created by

wk_widget glue_wk_widget (bool hx=true, bool vx=true, SI w=0, SI h=0);

The first two arguments determine whether the widget is extensible horizontally resp. vertically. The last two elements determine the default and minimal size of the widget.

3.9.5.Text widgets

Text widgets are created using

wk_widget text_wk_widget (string s, int style= 0, bool tsp= false);

They just display the text s.

3.9.6.Buttons

Two types of buttons have been implemented. First, command buttons are created using

wk_widget command_button (wk_widget w, command cmd, int style= 0);

They display the widget w (for instance a text widget) and execute the command cmd when pressed. Secondly, we implemented popup buttons, which popup some window when pressed. Popup buttons are created by one of

wk_widget pulldown_button (wk_widget w, wk_widget m, int style= 0);
wk_widget pullright_button (wk_widget w, wk_widget m, int style= 0);

depending on where the popup window should popup. The main widget attached to the popup window should be created using

wk_widget popup_widget (wk_widget w, gravity quit= center);

The quit argument specifies that the popup window should disappear as soon as the pointer leaves the widget in the quit direction.

3.9.7.Menus

Horizontal and vertical lists of widgets and vertical menus are created using

wk_widget horizontal_list (array<wk_widget> a);
wk_widget vertical_list (array<wk_widget> a);
wk_widget vertical_menu (array<wk_widget> a);

Subsequently, they can be modified as composite widgets. In TeXmacs, menus are not constructed directly in C++, but described in Scheme; see the chapter on the abstract widget system.

3.9.8.Canvas widgets

Canvas widgets are created using

wk_widget canvas_widget (wk_widget w, gravity grav= north_west, bool rf= false);

Canvas widgets consist of a portion of the widget w and scrollbars, which enable to scroll w. The events

event set_scrollable (wk_widget w);
event set_extents    (SI x1, SI y1, SI x2, SI y2);
event set_scroll_pos (SI x, SI y);
event get_extents    (SI& x1, SI& y1, SI& x2, SI& y2);
event get_visible    (SI& x1, SI& y1, SI& x2, SI& y2);

enable to change w, to set the extents of w, to set the scroll position, to get the extents of w and to get the rectangle of w, which is currently visible.

3.9.9.Input widgets

Input widgets enable to type a string and to retrieve it when finished. They are created using

wk_widget input_text_wk_widget (command call_back, int style= 0, string w= "1w", bool pf= true);

Some initial text can be put in it using

event set_input_string (string s);

The command call_back is executed when typing has been finished or aborted (by typing return, escape or C-c). The typed string can then be retrieved using

event get_input_string (string& s);

Usually, the returned s is a string enclosed between quotes. If typing was aborted, s contains the string "#f".

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".