1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
4 // Copyright(C) 2006 Simon Howard
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34 * A button is a widget that can be selected to perform some action.
35 * When a button is pressed, it emits the "pressed" signal.
38 typedef struct txt_button_s txt_button_t
;
40 #include "txt_widget.h"
49 * Create a new button widget.
51 * @param label The label to use on the new button.
52 * @return Pointer to the new button widget.
55 txt_button_t
*TXT_NewButton(char *label
);
58 * Create a new button widget, binding the "pressed" signal to a
59 * specified callback function.
61 * @param label The label to use on the new button.
62 * @param func The callback function to invoke.
63 * @param user_data User-specified pointer to pass to the callback.
64 * @return Pointer to the new button widget.
67 txt_button_t
*TXT_NewButton2(char *label
, TxtWidgetSignalFunc func
,
71 * Change the label used on a button.
73 * @param button The button.
74 * @param label The new label.
77 void TXT_SetButtonLabel(txt_button_t
*button
, char *label
);
79 #endif /* #ifndef TXT_BUTTON_H */