Skip to content

Module 2 — Building Blocks

Every wxRuby3 application is assembled from the same set of pieces: a frame to hold the window, a panel to host the controls, sizers to manage the layout, widgets for user interaction, menus for commands, and dialogs for focused tasks. These are the building blocks — and once you know them, you can build almost anything.

This module works through each piece in turn. The early lessons are deliberately focused: one concept, explained thoroughly, with working code you can run. By the time you reach the capstone, combining them will feel natural rather than overwhelming.

Lessons in this module

  1. Frames and panels — The skeleton of every app: top-level windows, panels, status bars, and the close event
  2. Core widgets — The controls users interact with: buttons, text fields, checkboxes, radio buttons, sliders, and more
  3. Layout with sizers — How wxRuby3 positions controls: box sizers, grid sizers, and the flags that control spacing and alignment
  4. Menus and toolbars — Adding menu bars, submenus, keyboard shortcuts, and toolbar buttons
  5. Dialogs — Standard dialogs for common tasks, and how to build your own
  6. Capstone: preferences panel — A tabbed preferences dialog that brings every concept in this module together

What you will have by the end

A solid working knowledge of the wxRuby3 widget set and a complete tabbed preferences panel — the kind of polished UI component that appears in almost every real application. You will understand not just how to create widgets, but how to compose them into a layout that works correctly across platforms and responds cleanly to user interaction.