/** \file control.c * Control Utilities */ /* * Copyright 2016 Martin Fischer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * */ #include #include #define GTK_DISABLE_SINGLE_INCLUDES #define GDK_DISABLE_DEPRECATED #define GTK_DISABLE_DEPRECATED #define GSEAL_ENABLE #include #include #include "gtkint.h" #define GTKCONTROLHILITEWIDTH (4) /** * Cause the control to be displayed or hidden. * Used to hide control (such as a list) while it is being updated. * * \param b IN Control * \param show IN TRUE for visible */ void wControlShow( wControl_p b, wBool_t show) { if (b->type == B_LINES) { wlibLineShow((wLine_p)b, show); return; } if (b->widget == NULL) { abort(); } if (show) { gtk_widget_show(b->widget); if (b->label) { gtk_widget_show(b->label); } } else { gtk_widget_hide(b->widget); if (b->label) { gtk_widget_hide(b->label); } } } /** * Cause the control to be marked active or inactive. * Inactive controls donot respond to actions. * * \param b IN Control * \param active IN TRUE for active */ void wControlActive( wControl_p b, int active) { if (b->widget == NULL) { abort(); } gtk_widget_set_sensitive(GTK_WIDGET(b->widget), active); } /** * Returns the width of