Lines Matching defs:button
49 * Create a new button box. The widget for it will be a child of the given
72 buttonbox->button = (Button *) NULL;
86 /* Create a new button, and add it to a buttonbox. */
95 Button button;
101 buttonbox->button = XtReallocArray(buttonbox->button,
102 buttonbox->numbuttons, sizeof(Button));
103 button = buttonbox->button[buttonbox->numbuttons - 1] = XtNew(ButtonRec);
104 button->buttonbox = buttonbox;
105 button->name = XtNewString(name);
106 button->menu = (Widget) NULL;
115 radio_group = (button == buttonbox->button[0])
116 ? (buttonbox->button[1]->widget)
117 : (buttonbox->button[0]->widget);
120 XtSetArg(args[i], XtNradioData, button->name); i++;
126 XtSetArg(args[i], XtNlabel, button->name); i++;
129 button->widget =
133 XtOverrideTranslations(button->widget, RadioButtonTranslations);
156 /* Set the current button in a radio buttonbox. */
159 Button button)
161 XawToggleSetCurrent(button->widget, button->name);
165 /* Get the name of the current button in a radio buttonbox. */
170 return ((char *) XawToggleGetCurrent(buttonbox->button[0]->widget));
174 /* Remove the given button from its buttonbox, and free all resources
175 * used in association with the button. If the button was the current
176 * button in a radio buttonbox, the current button becomes the first
177 * button in the box.
181 Button button)
186 if (button == NULL) return;
187 buttonbox = button->buttonbox;
192 buttonbox->button[i-1] = buttonbox->button[i];
193 else if (buttonbox->button[i] == button) {
196 /* Free the resources used by the given button. */
198 if (button->menu != NULL && button->menu != NoMenuForButton)
199 XtDestroyWidget(button->menu);
200 XtDestroyWidget(button->widget);
201 XtFree(button->name);
202 XtFree((char *) button);
211 Button button)
217 if (button == NULL) return;
218 buttonbox = button->buttonbox;
220 if (current) reradio = ! strcmp(current, button->name);
221 BBoxDeleteButton(button);
224 RadioBBoxSet(buttonbox->button[0]);
228 /* Enable or disable the given button widget. */
240 /* Enable the given button (if it's not already). */
243 Button button)
245 SendEnableMsg(button->widget, True);
249 /* Disable the given button (if it's not already). */
252 Button button)
254 SendEnableMsg(button->widget, False);
258 /* Given a buttonbox and a button name, find the button in the box with that
261 Button BBoxFindButtonNamed(
267 if (strcmp(name, buttonbox->button[i]->name) == 0)
268 return buttonbox->button[i];
269 return (Button) NULL;
273 /* Given a buttonbox and a widget, find the button which is that widget. */
275 Button BBoxFindButton(
281 if (buttonbox->button[i]->widget == w)
282 return buttonbox->button[i];
283 return (Button) NULL;
287 /* Return the nth button in the given buttonbox. */
289 Button BBoxButtonNumber(
293 return buttonbox->button[n];
306 /* Given a button, return its name. */
309 Button button)
311 return button->name;
315 /* Given a button, return its menu. */
318 Button button)
320 return button->menu;
357 Button button = BBoxFindButtonNamed(buttonbox, name);
359 if (button) {
362 XtGetValues(button->widget, args, (Cardinal)1);
365 XtSetValues(button->widget, args, (Cardinal)1);
369 XtSetValues(button->widget, args, (Cardinal)1);