bathy_window
Description
bathy_window.c is a Motif GUI source file, typically generated by an interface builder tool like X-Designer. Its purpose is to create and manage the primary window for displaying bathymetry data within the “Submetrix 2000 unraveller” application. This module sets up a DrawingArea widget where the bathymetry is visually rendered and integrates event handlers for user interaction (e.g., expose_bathy for redrawing, bathy_events for mouse/keyboard input). It also defines a popup menu that allows users to dynamically change the data compression method applied to the displayed bathymetry (linear, logarithmic, square root, or TVG).
How It Works
This file uses Motif (Xm) and Xt Intrinsics libraries to define and instantiate GUI widgets.
create_BathyShell(Widget parent)function:- Creates a
DialogShellwidget (BathyShell) as the top-level window for the bathymetry display. - Creates an
XmFormwidget (BathyForm) to manage the layout of elements within the shell. - Creates an
XmDrawingAreawidget (DA10.widget), which serves as the canvas for drawing the bathymetry. - Attaches two primary event handlers to the
DrawingArea:expose_bathy: A callback function (executed onXmNexposeCallback) responsible for redrawing the bathymetry whenever the window needs to be refreshed.bathy_events: An event handler (executed on various mouse/keyboard events) that manages user interaction within the drawing area (e.g., rubber-banding, parameter changes via keys).
- Popup Menu (
bathy_popup):- Creates an
XmPopupMenuwidget, which appears whenButton3(right-click) is pressed in the drawing area. - Adds four
XmPushButtonwidgets (“linear”, “log”, “sqrt”, “tvg”) to this popup menu. - Each button is associated with an
activateCallback(change_data_compression), passing a unique identifier (0-3) to specify the desired compression method.
- Creates an
- Manages the children widgets to lay them out within the form. This file primarily sets up the visual interface and connects it to event handling and data compression logic.
- Creates a