|
|
@@ -25,6 +25,8 @@ FROM GtkFrame IMPORT gtk_frame_new, gtk_frame_set_child;
|
|
|
FROM GtkLabel IMPORT gtk_label_new;
|
|
|
FROM GtkDropDown IMPORT gtk_drop_down_new;
|
|
|
FROM GtkStringList IMPORT gtk_string_list_new, gtk_string_list_append;
|
|
|
+FROM GtkSizeGroup IMPORT gtk_size_group_new, gtk_size_group_add_widget,
|
|
|
+ GtkSizeGroupHorizontal;
|
|
|
FROM GtkCheckButton IMPORT gtk_check_button_new_with_label,
|
|
|
gtk_check_button_set_active;
|
|
|
FROM GtkScrolledWindow IMPORT gtk_scrolled_window_new,
|
|
|
@@ -59,7 +61,7 @@ END MakeDropDown;
|
|
|
SIMPLIFIED: gtk_label_new_with_mnemonic() and
|
|
|
gtk_label_set_mnemonic_widget() are not bound, so a plain label is
|
|
|
used (the underscores are dropped rather than shown literally). *)
|
|
|
-PROCEDURE AddRow (table: ADDRESS; row: INTEGER;
|
|
|
+PROCEDURE AddRow (group, table: ADDRESS; row: INTEGER;
|
|
|
labelText, a, b, c: ARRAY OF CHAR);
|
|
|
VAR
|
|
|
label, dropdown: ADDRESS;
|
|
|
@@ -68,6 +70,7 @@ BEGIN
|
|
|
gtk_widget_set_halign(label, GtkAlignStart);
|
|
|
gtk_widget_set_valign(label, GtkAlignBaseline);
|
|
|
gtk_widget_set_hexpand(label, 1);
|
|
|
+ IF group # NIL THEN gtk_size_group_add_widget(group, label) END;
|
|
|
gtk_grid_attach(table, label, 0, row, 1, 1);
|
|
|
|
|
|
dropdown := MakeDropDown(a, b, c);
|
|
|
@@ -78,7 +81,7 @@ END AddRow;
|
|
|
|
|
|
PROCEDURE DoSizeGroup (doWidget: ADDRESS) : ADDRESS;
|
|
|
VAR
|
|
|
- vbox, frame, table, checkButton: ADDRESS;
|
|
|
+ vbox, frame, table, checkButton, group: ADDRESS;
|
|
|
BEGIN
|
|
|
IF sizeGroupWindow = NIL THEN
|
|
|
sizeGroupWindow := gtk_window_new();
|
|
|
@@ -92,10 +95,8 @@ BEGIN
|
|
|
gtk_widget_set_margin_bottom(vbox, 5);
|
|
|
gtk_window_set_child(sizeGroupWindow, vbox);
|
|
|
|
|
|
- (* SIMPLIFIED: GtkSizeGroup is not bound under src/, so the
|
|
|
- gtk_size_group_new()/add_widget()/set_mode() machinery and the
|
|
|
- "toggled" callback that switches it on and off are omitted.
|
|
|
- The two grids below are otherwise identical to the C demo. *)
|
|
|
+ (* the labels in both grids share one horizontal size group *)
|
|
|
+ group := gtk_size_group_new(GtkSizeGroupHorizontal);
|
|
|
|
|
|
(* Color options *)
|
|
|
frame := gtk_frame_new("Color Options");
|
|
|
@@ -108,8 +109,8 @@ BEGIN
|
|
|
gtk_grid_set_row_spacing(table, 5);
|
|
|
gtk_grid_set_column_spacing(table, 10);
|
|
|
gtk_frame_set_child(frame, table);
|
|
|
- AddRow(table, 0, "Foreground", "Red", "Green", "Blue");
|
|
|
- AddRow(table, 1, "Background", "Red", "Green", "Blue");
|
|
|
+ AddRow(group, table, 0, "Foreground", "Red", "Green", "Blue");
|
|
|
+ AddRow(group, table, 1, "Background", "Red", "Green", "Blue");
|
|
|
|
|
|
(* Line options *)
|
|
|
frame := gtk_frame_new("Line Options");
|
|
|
@@ -122,8 +123,8 @@ BEGIN
|
|
|
gtk_grid_set_row_spacing(table, 5);
|
|
|
gtk_grid_set_column_spacing(table, 10);
|
|
|
gtk_frame_set_child(frame, table);
|
|
|
- AddRow(table, 0, "Dashing", "Solid", "Dashed", "Dotted");
|
|
|
- AddRow(table, 1, "Line ends", "Square", "Round", "Double Arrow");
|
|
|
+ AddRow(group, table, 0, "Dashing", "Solid", "Dashed", "Dotted");
|
|
|
+ AddRow(group, table, 1, "Line ends", "Square", "Round", "Double Arrow");
|
|
|
|
|
|
checkButton := gtk_check_button_new_with_label("Enable grouping");
|
|
|
gtk_box_append(vbox, checkButton);
|