1st Edition

Programming Graphical User Interfaces in R

By Michael Lawrence, John Verzani Copyright 2012
    480 Pages 94 B/W Illustrations
    by Chapman & Hall

    479 Pages 94 B/W Illustrations
    by Chapman & Hall

    Programming Graphical User Interfaces with R introduces each of the major R packages for GUI programming: RGtk2, qtbase, Tcl/Tk, and gWidgets. With examples woven through the text as well as stand-alone demonstrations of simple yet reasonably complete applications, the book features topics especially relevant to statisticians who aim to provide a practical interface to functionality implemented in R. The book offers:

    • A how-to guide for developing GUIs within R
    • The fundamentals for users with limited knowledge of programming within R and other languages
    • GUI design for specific functions or as learning tools

    The accompanying package, ProgGUIinR, includes the complete code for all examples as well as functions for browsing the examples from the respective chapters. Accessible to seasoned, novice, and occasional R users, this book shows that for many purposes, adding a graphical interface to one’s work is not terribly sophisticated or time consuming.

    The Fundamentals of Graphical User Interfaces
    A simple GUI in R
    GUI design principles
    Controls
    Containers

    I The gWidgets Package
    gWidgets: Overview
    Constructors
    Methods
    Event handlers
    Dialogs
    Installation

    gWidgets: Container Widgets
    Top-level windows
    Box containers
    Grid layout: the glayout container
    Paned containers: the gpanedgroup container
    Tabbed notebooks: the gnotebook container

    gWidgets: Control Widgets
    Buttons
    Labels
    Text-editing controls
    Selection controls
    Display of tabular data
    Display of hierarchical data
    Actions, menus, and toolbars

    gWidgets: R-specific Widgets
    A graphics device
    A data frame editor
    Workspace browser
    Help browser
    Command line widget
    Simplifying creation of dialogs

    II The RGtkPackage
    RGtk2: Overview
    Synopsis of the RGtk2R Package!RGtkAPI
    Objects and classes
    Constructors
    Methods
    Properties
    Events and signals
    Enumerated types and flags
    The event loop
    Importing a GUI from Glade

    RGtk2: Windows, Containers, and Dialogs
    Top-level windows
    Layout containers
    Dialogs
    Special-purpose containers

    RGtk2: Basic Components
    Buttons
    Static text and images
    Input controls
    Progress reporting
    Wizards
    Embedding R graphics
    Drag-and-drop

    RGtk2: Widgets Using Data Models
    Displaying tabular data
    Displaying hierarchical data
    Model-based combo boxes
    Text-entry widgets with completion
    Sharing buffers between text entries
    Text views
    Text buffers

    RGtk2: Application Windows
    Actions
    Menus
    Toolbars
    Status reporting
    Managing a complex user interface

    Extending GObject Classes

    III The qtbase Package
    Qt: Overview
    The Qt library
    An introductory example
    Classes and objects
    Methods and dispatch
    Properties
    Signals
    Enumerations and flags
    Extending Qt classes from R
    QWidget basics
    Importing a GUI from QtDesigner

    Qt: Layout Managers and Containers
    Layout basics
    Box layouts
    Grid layouts
    Form layouts
    Frames
    Separators
    Notebooks
    Scroll areas
    Paned windows

    Qt: Widgets
    Dialogs
    Labels
    Buttons
    Checkboxes
    Radio groups
    Combo boxes
    Sliders and spin boxes
    Single-line text
    QWebView widget
    Embedding R graphics
    Drag-and-drop

    Qt: Widgets Using Data Models
    Displaying tabular data
    Displaying lists
    Model-based combo boxes
    Accessing item models
    Item selection
    Sorting and filtering
    Decorating items
    Displaying hierarchical data
    User editing of data models
    Drag-and-drop in item views
    Widgets with internal models
    Implementing custom models
    Implementing custom views
    Viewing and editing text documents

    Qt: Application Windows
    Actions
    Menu bars
    Context menus
    Toolbars
    Status bars
    Dockable widgets

    IV The tcltk Package
    Tcl/Tk: Overview
    A first example
    Interacting with Tcl
    Constructors
    Events and callbacks

    Tcl/Tk: Layout and Containers
    Top-level windows
    Frames
    Geometry managers
    Other containers

    Tcl/Tk: Dialogs and Widgets
    Dialogs
    Selection widgets

    Tcl/Tk: Text, Tree, and Canvas Widgets
    Scroll bars
    Multiline text widgets
    Menus
    Treeview widget
    Canvas widget

    Concept index
    Class and method index


    Biography

    Michael Lawrence, John Verzani