Lines Matching defs:choice

4 ** choice.c
6 ** All the generic stuff for dealing with choice widgets.
22 ** What a choice widget is: A collection of toggle buttons placed inside
48 ChoiceDesc *choice; /* What we will return. Contains
77 /* Allocate space for the widgets and initialize choice */
78 choice = (ChoiceDesc *) XtMalloc(sizeof(ChoiceDesc));
79 choice->widgets = (WidgetList) XtMalloc(sizeof(Widget) *
80 info->choice.num_toggles);
81 choice->size = info->choice.num_toggles;
82 choice->label = XtCreateManagedWidget(info->choice.name,labelWidgetClass,w,
87 for (i = 0; i < info->choice.num_toggles; ++i) {
91 toggleargs[0].value = (XtArgVal) choice->label;
98 toggleargs[4].value = (XtArgVal) choice->widgets[0];
100 if (info->choice.columns > 0 &&
102 (i % (info->choice.columns) == 0)) {
103 toggleargs[0].value = (XtArgVal) choice->label;
105 toggleargs[1].value = (XtArgVal) choice->widgets[i - info->choice.columns];
111 toggleargs[0].value = (XtArgVal) choice->widgets[i - 1];
117 if (info->choice.columns > 0 &&
118 i >= info->choice.columns) {
120 toggleargs[1].value = (XtArgVal) choice->widgets[i - info->choice.columns];
126 text = (char *) XtMalloc((unsigned) (strlen(info->choice.text) +
128 strcpy(text, info->choice.text);
135 choice->widgets[i] = XtCreateManagedWidget((info->data[i]).name,
146 if (info->choice.columns > 0) {
156 for (i = 0; i < info->choice.num_toggles; ++i) {
157 XtGetValues(choice->widgets[i],args,1);
163 for (i = 0; i < info->choice.num_toggles; ++i)
164 XtSetValues(choice->widgets[i],args,1);
168 return (choice);
173 /* select_button(choice,togglenum)
175 ** "Selects" the togglenumth toggle widget in the choice layout
176 ** represented by choice. It simply turns the widget on, as if the
182 select_button(ChoiceDesc *choice, int togglenum)
188 XtSetValues(choice->widgets[togglenum],toggleargs,XtNumber(toggleargs));
193 ** descs represents a bunch of choice layouts (numdescs is the size of
226 ** descs represents a bunch of choice layouts (numdescs is the size of
238 int i; /* which choice layout */
254 ** choice widget. It sends the string contained in closure (which