+ model = gtk_list_store_new(CYL_COLUMNS,
+ G_TYPE_STRING, /* CYL_DESC: utf8 */
+ G_TYPE_INT, /* CYL_SIZE: mliter */
+ G_TYPE_INT, /* CYL_WORKP: mbar */
+ G_TYPE_INT, /* CYL_STARTP: mbar */
+ G_TYPE_INT, /* CYL_ENDP: mbar */
+ G_TYPE_INT, /* CYL_O2: permille */
+ G_TYPE_INT /* CYL_HE: permille */
+ );
+ cylinder_list.model = model;
+ tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
+ g_signal_connect(tree_view, "row-activated", G_CALLBACK(row_activated_cb), model);
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
+ gtk_tree_selection_set_mode(GTK_TREE_SELECTION(selection), GTK_SELECTION_BROWSE);
+ g_signal_connect(selection, "changed", G_CALLBACK(selection_cb), model);
+
+ g_object_set(G_OBJECT(tree_view), "headers-visible", TRUE,
+ "enable-grid-lines", GTK_TREE_VIEW_GRID_LINES_BOTH,
+ NULL);
+
+ cylinder_list.desc = tree_view_column(tree_view, CYL_DESC, "Type", NULL, PANGO_ALIGN_LEFT, TRUE);
+ cylinder_list.size = tree_view_column(tree_view, CYL_SIZE, "Size", size_data_func, PANGO_ALIGN_RIGHT, TRUE);
+ cylinder_list.workp = tree_view_column(tree_view, CYL_WORKP, "MaxPress", pressure_data_func, PANGO_ALIGN_RIGHT, TRUE);
+ cylinder_list.startp = tree_view_column(tree_view, CYL_STARTP, "Start", pressure_data_func, PANGO_ALIGN_RIGHT, TRUE);
+ cylinder_list.endp = tree_view_column(tree_view, CYL_ENDP, "End", pressure_data_func, PANGO_ALIGN_RIGHT, TRUE);
+ cylinder_list.o2 = tree_view_column(tree_view, CYL_O2, "O" UTF8_SUBSCRIPT_2 "%", percentage_data_func, PANGO_ALIGN_RIGHT, TRUE);
+ cylinder_list.he = tree_view_column(tree_view, CYL_HE, "He%", percentage_data_func, PANGO_ALIGN_RIGHT, TRUE);
+ return tree_view;
+}
+
+GtkWidget *equipment_widget(void)
+{
+ GtkWidget *vbox, *hbox, *frame, *framebox;
+ GtkWidget *add, *del, *edit;
+