Intermediate X and Motif Programming (5 days)

What you should be able to say before taking this course:

  • I know what a Makefile does and how to use one
  • I know how pointers and structures work in C
  • I know how to write basic Xt, and Motif Programs

What you will be able to say following the course:

  • I understand the different levels of programming with the X Window System, Motif, Xt and Xlib
  • I understand the client-server model
  • I can draw lines, arc, rectangles and points using Xlib
  • I understand the X color model and how it works
  • I can write an Xt or Xlib based program
  • I know about the following: event, window, display, screen, window manager
  • I can integrate Xlib calls into Xt-based programs
  • I know what a compound string is and how it is used
  • I know how to rubber-band lines for interactive graphics applications
  • I can create and use my own application resources, images and error handling routines
  • I can use actions and translations
  • I can run X in synchronous mode to debug programs
  • I can effectively use a text widgets verification callbacks
  • I can effectively use a form widget
  • I understand the ICCCM and can implement Inter-client communication
  • I can use new Motif 1.2 features like tear-off menus, and Drag-and-Drop
  • I understand timers, work-procs, input sources
  • I can create multi-display applications

Course Outline:

Lecture One — Overview and Introduction to Xt

  • Writing Xt-Based Applications
  • Basic Xt-Programming
  • XExamining Widget Resources
  • Setting Widget Resources
  • Getting Widget Resources
  • The Widget Class Hierarchy and Resource Inheritance

Lab One — Xt Programming and Working with Resources

  • Building an Xt program
  • Adding Widgets, Customizing Widgets and Interfaces Using Resources

Lecture Two — Overview and Introduction to Xlib

  • Client-Server Model
  • X Application Architecture
  • The Toolkit and Xlib
  • The X Server
  • Processing Events
  • Input Event Types
  • XEvent Structure
  • Keyboard Events
  • Resizing and Gravity
  • Expose Events

Lab Two — Xlib Programming and Event Handling

  • Building an Xlib Program
  • Selecting & Acting on Events in Xlib [Button Events, Key Events, etc.]

Lecture Three — Graphics in X

  • Graphics Vocabulary
  • Graphics Contexts
  • Draw Operations
  • Fills
  • Pixmaps
  • Xt Program Flow
  • Xlib and Xt Together

Lab Three — Drawing in X and Mixing Xlib and Xt

  • Drawing with X
  • Using Events in Xt

Lecture Four — Text, Fonts, Cursors and Color

  • Fonts
  • Text
  • Creating and Changing the Cursor
  • Color
  • Shared and Private Colors
  • Private Colormaps

Lab Four — Xlib Programming

  • Working with Strings
  • Building a Graphics Editor

Lecture Five — Advanced X

  • Rubber Banding
  • Application Resources
  • Destroying Widgets and Windows
  • Synchronicity
  • Translation Management
  • Fallback Resources
  • Error Handling
  • Images

Lab Five — Graphics with Xt

  • Adding Event Handlers to Widgets
  • Using Application Resources

Lecture Six — Advanced Motif

  • Compound Strings
  • Text Widgets
  • XmForm

Lab Six — Advanced Motif

  • Add a Form to the Graphics Editor
  • Add a textField to the Editor
  • Use Modify Verify

Lecture Seven — Inter-Client Communications Conventions Manual

  • Atoms
  • Properties
  • Client and Window Manager Communication
  • Shared Resources
  • Talking To Other Clients
  • Selections

Lab Seven — Inter-Process Communication

  • Iconify Multiple Shells Together
  • Position a Shell to Override WM
  • Implement Simple Message Passing Between Two Windows
  • Implement Cut and Paste

Lecture Eight — Drag and Drop

  • Motif 1.2 Overview
  • Basic Drag-N-Drop
  • XmDropTransfer Widget
  • Review — Drag Sources and Drop Sites
  • Advanced Drag and Drop

Lab Eight

  • Using Drag and Drop

Lecture Nine — Advanced X

  • Var Args Interface
  • Timers
  • Work Procedures
  • Additional Input Sources
  • Multi Display Applications
  • Performance Issues in X
  • Useful Tools

Lab Nine — Advanced X

  • Using Freeware Tools to Debug X Applications

Lecture Nine Addendum (if there is time for it) — X11R6 and Motif 2.0, CDE

  • X11R6
  • Motif 2.0
  • CDE