Mercurial > hg > xemacs-beta
comparison lwlib/lwlib-Xaw.c @ 4522:fc7067b7f407
Backout last patch; forgot to specify file.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Wed, 29 Oct 2008 03:37:16 +0900 |
parents | 383ab474a241 |
children | 726060ee587c |
comparison
equal
deleted
inserted
replaced
4521:383ab474a241 | 4522:fc7067b7f407 |
---|---|
86 float widget_shown, widget_topOfThumb; | 86 float widget_shown, widget_topOfThumb; |
87 float new_shown, new_topOfThumb; | 87 float new_shown, new_topOfThumb; |
88 Arg al [10]; | 88 Arg al [10]; |
89 | 89 |
90 /* First size and position the scrollbar widget. */ | 90 /* First size and position the scrollbar widget. */ |
91 Xt_SET_ARG (al [0], XtNx, data->scrollbar_x); | 91 XtSetArg (al [0], XtNx, data->scrollbar_x); |
92 Xt_SET_ARG (al [1], XtNy, data->scrollbar_y); | 92 XtSetArg (al [1], XtNy, data->scrollbar_y); |
93 Xt_SET_ARG (al [2], XtNwidth, data->scrollbar_width); | 93 XtSetArg (al [2], XtNwidth, data->scrollbar_width); |
94 Xt_SET_ARG (al [3], XtNheight, data->scrollbar_height); | 94 XtSetArg (al [3], XtNheight, data->scrollbar_height); |
95 XtSetValues (widget, al, 4); | 95 XtSetValues (widget, al, 4); |
96 | 96 |
97 /* Now size the scrollbar's slider. */ | 97 /* Now size the scrollbar's slider. */ |
98 Xt_SET_ARG (al [0], XtNtopOfThumb, &widget_topOfThumb); | 98 XtSetArg (al [0], XtNtopOfThumb, &widget_topOfThumb); |
99 Xt_SET_ARG (al [1], XtNshown, &widget_shown); | 99 XtSetArg (al [1], XtNshown, &widget_shown); |
100 XtGetValues (widget, al, 2); | 100 XtGetValues (widget, al, 2); |
101 | 101 |
102 new_shown = (double) data->slider_size / | 102 new_shown = (double) data->slider_size / |
103 (double) (data->maximum - data->minimum); | 103 (double) (data->maximum - data->minimum); |
104 | 104 |
140 } | 140 } |
141 #endif | 141 #endif |
142 #endif | 142 #endif |
143 #ifdef LWLIB_DIALOGS_ATHENA | 143 #ifdef LWLIB_DIALOGS_ATHENA |
144 else if (XtIsSubclass (widget, dialogWidgetClass)) | 144 else if (XtIsSubclass (widget, dialogWidgetClass)) |
145 Xt_SET_VALUE (widget, XtNlabel, val->contents->value); | 145 { |
146 Arg al [1]; | |
147 XtSetArg (al [0], XtNlabel, val->contents->value); | |
148 XtSetValues (widget, al, 1); | |
149 } | |
146 #endif /* LWLIB_DIALOGS_ATHENA */ | 150 #endif /* LWLIB_DIALOGS_ATHENA */ |
147 #ifdef LWLIB_WIDGETS_ATHENA | 151 #ifdef LWLIB_WIDGETS_ATHENA |
148 else if (XtClass (widget) == labelWidgetClass) | 152 else if (XtClass (widget) == labelWidgetClass) |
149 Xt_SET_VALUE (widget, XtNlabel, val->value); | 153 { |
154 Arg al [1]; | |
155 XtSetArg (al [0], XtNlabel, val->value); | |
156 XtSetValues (widget, al, 1); | |
157 } | |
150 #endif /* LWLIB_WIDGETS_ATHENA */ | 158 #endif /* LWLIB_WIDGETS_ATHENA */ |
151 #if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA) | 159 #if defined (LWLIB_DIALOGS_ATHENA) || defined (LWLIB_WIDGETS_ATHENA) |
152 else if (XtIsSubclass (widget, commandWidgetClass)) | 160 else if (XtIsSubclass (widget, commandWidgetClass)) |
153 { | 161 { |
162 Dimension bw = 0; | |
154 Arg al [3]; | 163 Arg al [3]; |
164 XtSetArg (al [0], XtNborderWidth, &bw); | |
165 XtGetValues (widget, al, 1); | |
155 | 166 |
156 #ifndef LWLIB_DIALOGS_ATHENA3D | 167 #ifndef LWLIB_DIALOGS_ATHENA3D |
157 { | 168 if (bw == 0) |
158 Dimension bw = 0; | 169 /* Don't let buttons end up with 0 borderwidth, that's ugly... |
159 Xt_GET_VALUE (widget, XtNborderWidth, &bw); | 170 Yeah, all this should really be done through app-defaults files |
160 if (bw == 0) | 171 or fallback resources, but that's a whole different can of worms |
161 /* Don't let buttons end up with 0 borderwidth, that's ugly... | 172 that I don't feel like opening right now. Making Athena widgets |
162 Yeah, all this should really be done through app-defaults files | 173 not look like shit is just entirely too much work. |
163 or fallback resources, but that's a whole different can of worms | 174 */ |
164 that I don't feel like opening right now. Making Athena widgets | 175 { |
165 not look like shit is just entirely too much work. | 176 XtSetArg (al [0], XtNborderWidth, 1); |
166 */ | 177 XtSetValues (widget, al, 1); |
167 Xt_SET_VALUE (widget, XtNborderWidth, 1); | |
168 } | 178 } |
169 #endif /* ! LWLIB_DIALOGS_ATHENA3D */ | 179 #endif /* ! LWLIB_DIALOGS_ATHENA3D */ |
170 | 180 |
171 lw_remove_accelerator_spec (val->value); | 181 lw_remove_accelerator_spec (val->value); |
172 Xt_SET_ARG (al [0], XtNlabel, val->value); | 182 XtSetArg (al [0], XtNlabel, val->value); |
173 Xt_SET_ARG (al [1], XtNsensitive, val->enabled); | 183 XtSetArg (al [1], XtNsensitive, val->enabled); |
174 /* Force centered button text. See above. */ | 184 /* Force centered button text. See above. */ |
175 Xt_SET_ARG (al [2], XtNjustify, XtJustifyCenter); | 185 XtSetArg (al [2], XtNjustify, XtJustifyCenter); |
176 XtSetValues (widget, al, 3); | 186 XtSetValues (widget, al, 3); |
177 | 187 |
178 XtRemoveAllCallbacks (widget, XtNcallback); | 188 XtRemoveAllCallbacks (widget, XtNcallback); |
179 XtAddCallback (widget, XtNcallback, xaw_generic_callback, instance); | 189 XtAddCallback (widget, XtNcallback, xaw_generic_callback, instance); |
180 #ifdef LWLIB_WIDGETS_ATHENA | 190 #ifdef LWLIB_WIDGETS_ATHENA |
181 /* set the selected state */ | 191 /* set the selected state */ |
182 if (XtIsSubclass (widget, toggleWidgetClass)) | 192 if (XtIsSubclass (widget, toggleWidgetClass)) |
183 Xt_SET_VALUE (widget, XtNstate, val->selected); | 193 { |
194 XtSetArg (al [0], XtNstate, val->selected); | |
195 XtSetValues (widget, al, 1); | |
196 } | |
184 #endif /* LWLIB_WIDGETS_ATHENA */ | 197 #endif /* LWLIB_WIDGETS_ATHENA */ |
185 } | 198 } |
186 #endif /* LWLIB_DIALOGS_ATHENA */ | 199 #endif /* LWLIB_DIALOGS_ATHENA */ |
187 /* Lastly update our global arg values. */ | 200 /* Lastly update our global arg values. */ |
188 if (val->args && val->args->nargs) | 201 if (val->args && val->args->nargs) |
204 break; | 217 break; |
205 } | 218 } |
206 | 219 |
207 if (XtIsSubclass (widget, toggleWidgetClass)) | 220 if (XtIsSubclass (widget, toggleWidgetClass)) |
208 { | 221 { |
209 Xt_GET_VALUE (widget, XtNstate, &val->selected); | 222 Arg al [1]; |
223 XtSetArg (al [0], XtNstate, &val->selected); | |
224 XtGetValues (widget, al, 1); | |
210 val->edited = True; | 225 val->edited = True; |
211 } | 226 } |
212 #ifndef NEED_MOTIF | 227 #ifndef NEED_MOTIF |
213 else if (XtIsSubclass (widget, asciiTextWidgetClass)) | 228 else if (XtIsSubclass (widget, asciiTextWidgetClass)) |
214 { | 229 { |
230 Arg al [2]; | |
215 String buf = 0; | 231 String buf = 0; |
216 | 232 XtSetArg (al [0], XtNstring, &buf); |
217 Xt_GET_VALUE (widget, XtNstring, &buf); | 233 XtGetValues (widget, al, 1); |
234 | |
218 if (val->value) | 235 if (val->value) |
219 { | 236 { |
220 free (val->value); | 237 free (val->value); |
221 val->value = 0; | 238 val->value = 0; |
222 } | 239 } |
320 static char overrideTrans[] = | 337 static char overrideTrans[] = |
321 "<Message>WM_PROTOCOLS: lwlib_delete_dialog()"; | 338 "<Message>WM_PROTOCOLS: lwlib_delete_dialog()"; |
322 static XtActionProc wm_delete_window (Widget shell, XtPointer closure, | 339 static XtActionProc wm_delete_window (Widget shell, XtPointer closure, |
323 XtPointer call_data); | 340 XtPointer call_data); |
324 static XtActionsRec xaw_actions [] = { | 341 static XtActionsRec xaw_actions [] = { |
325 { (String) "lwlib_delete_dialog", (XtActionProc) wm_delete_window} | 342 {"lwlib_delete_dialog", (XtActionProc) wm_delete_window} |
326 }; | 343 }; |
327 static Boolean actions_initted = False; | 344 static Boolean actions_initted = False; |
328 | 345 |
329 static Widget | 346 static Widget |
330 make_dialog (const char* name, Widget parent, Boolean pop_up_p, | 347 make_dialog (const char* name, Widget parent, Boolean pop_up_p, |
356 } | 373 } |
357 | 374 |
358 override = XtParseTranslationTable (overrideTrans); | 375 override = XtParseTranslationTable (overrideTrans); |
359 | 376 |
360 ac = 0; | 377 ac = 0; |
361 Xt_SET_ARG (av[ac], XtNtitle, shell_title); ac++; | 378 XtSetArg (av[ac], XtNtitle, shell_title); ac++; |
362 Xt_SET_ARG (av[ac], XtNallowShellResize, True); ac++; | 379 XtSetArg (av[ac], XtNallowShellResize, True); ac++; |
363 Xt_SET_ARG (av[ac], XtNtransientFor, parent); ac++; | 380 XtSetArg (av[ac], XtNtransientFor, parent); ac++; |
364 shell = XtCreatePopupShell ("dialog", transientShellWidgetClass, | 381 shell = XtCreatePopupShell ("dialog", transientShellWidgetClass, |
365 parent, av, ac); | 382 parent, av, ac); |
366 XtOverrideTranslations (shell, override); | 383 XtOverrideTranslations (shell, override); |
367 | 384 |
368 ac = 0; | 385 ac = 0; |
371 bc = 0; | 388 bc = 0; |
372 button = 0; | 389 button = 0; |
373 for (i = 0; i < left_buttons; i++) | 390 for (i = 0; i < left_buttons; i++) |
374 { | 391 { |
375 ac = 0; | 392 ac = 0; |
376 Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++; | 393 XtSetArg (av [ac], XtNfromHoriz, button); ac++; |
377 Xt_SET_ARG (av [ac], XtNleft, XtChainLeft); ac++; | 394 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++; |
378 Xt_SET_ARG (av [ac], XtNright, XtChainLeft); ac++; | 395 XtSetArg (av [ac], XtNright, XtChainLeft); ac++; |
379 Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++; | 396 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; |
380 Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++; | 397 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; |
381 Xt_SET_ARG (av [ac], XtNresizable, True); ac++; | 398 XtSetArg (av [ac], XtNresizable, True); ac++; |
382 sprintf (button_name, "button%d", ++bc); | 399 sprintf (button_name, "button%d", ++bc); |
383 button = XtCreateManagedWidget (button_name, commandWidgetClass, | 400 button = XtCreateManagedWidget (button_name, commandWidgetClass, |
384 dialog, av, ac); | 401 dialog, av, ac); |
385 } | 402 } |
386 if (right_buttons) | 403 if (right_buttons) |
391 the right and the buttons on the left (that is I want the buttons | 408 the right and the buttons on the left (that is I want the buttons |
392 after the separator to be packed against the right edge of the | 409 after the separator to be packed against the right edge of the |
393 window) but I can't seem to make it do it. | 410 window) but I can't seem to make it do it. |
394 */ | 411 */ |
395 ac = 0; | 412 ac = 0; |
396 Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++; | 413 XtSetArg (av [ac], XtNfromHoriz, button); ac++; |
397 /* Xt_SET_ARG (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */ | 414 /* XtSetArg (av [ac], XtNfromVert, XtNameToWidget (dialog, "label")); ac++; */ |
398 Xt_SET_ARG (av [ac], XtNleft, XtChainLeft); ac++; | 415 XtSetArg (av [ac], XtNleft, XtChainLeft); ac++; |
399 Xt_SET_ARG (av [ac], XtNright, XtChainRight); ac++; | 416 XtSetArg (av [ac], XtNright, XtChainRight); ac++; |
400 Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++; | 417 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; |
401 Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++; | 418 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; |
402 Xt_SET_ARG (av [ac], XtNlabel, ""); ac++; | 419 XtSetArg (av [ac], XtNlabel, ""); ac++; |
403 Xt_SET_ARG (av [ac], XtNwidth, 30); /* #### aaack!! */ ac++; | 420 XtSetArg (av [ac], XtNwidth, 30); ac++; /* #### aaack!! */ |
404 Xt_SET_ARG (av [ac], XtNborderWidth, 0); ac++; | 421 XtSetArg (av [ac], XtNborderWidth, 0); ac++; |
405 Xt_SET_ARG (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++; | 422 XtSetArg (av [ac], XtNshapeStyle, XmuShapeRectangle); ac++; |
406 Xt_SET_ARG (av [ac], XtNresizable, False); ac++; | 423 XtSetArg (av [ac], XtNresizable, False); ac++; |
407 Xt_SET_ARG (av [ac], XtNsensitive, False); ac++; | 424 XtSetArg (av [ac], XtNsensitive, False); ac++; |
408 button = XtCreateManagedWidget ("separator", | 425 button = XtCreateManagedWidget ("separator", |
409 /* labelWidgetClass, */ | 426 /* labelWidgetClass, */ |
410 /* This has to be Command to fake out | 427 /* This has to be Command to fake out |
411 the Dialog widget... */ | 428 the Dialog widget... */ |
412 commandWidgetClass, | 429 commandWidgetClass, |
413 dialog, av, ac); | 430 dialog, av, ac); |
414 } | 431 } |
415 for (i = 0; i < right_buttons; i++) | 432 for (i = 0; i < right_buttons; i++) |
416 { | 433 { |
417 ac = 0; | 434 ac = 0; |
418 Xt_SET_ARG (av [ac], XtNfromHoriz, button); ac++; | 435 XtSetArg (av [ac], XtNfromHoriz, button); ac++; |
419 Xt_SET_ARG (av [ac], XtNleft, XtChainRight); ac++; | 436 XtSetArg (av [ac], XtNleft, XtChainRight); ac++; |
420 Xt_SET_ARG (av [ac], XtNright, XtChainRight); ac++; | 437 XtSetArg (av [ac], XtNright, XtChainRight); ac++; |
421 Xt_SET_ARG (av [ac], XtNtop, XtChainBottom); ac++; | 438 XtSetArg (av [ac], XtNtop, XtChainBottom); ac++; |
422 Xt_SET_ARG (av [ac], XtNbottom, XtChainBottom); ac++; | 439 XtSetArg (av [ac], XtNbottom, XtChainBottom); ac++; |
423 Xt_SET_ARG (av [ac], XtNresizable, True); ac++; | 440 XtSetArg (av [ac], XtNresizable, True); ac++; |
424 sprintf (button_name, "button%d", ++bc); | 441 sprintf (button_name, "button%d", ++bc); |
425 button = XtCreateManagedWidget (button_name, commandWidgetClass, | 442 button = XtCreateManagedWidget (button_name, commandWidgetClass, |
426 dialog, av, ac); | 443 dialog, av, ac); |
427 } | 444 } |
428 | 445 |
506 /* We want the selected status to change only when we decide it | 523 /* We want the selected status to change only when we decide it |
507 should change. Yuck but correct. */ | 524 should change. Yuck but correct. */ |
508 if (XtIsSubclass (widget, toggleWidgetClass)) | 525 if (XtIsSubclass (widget, toggleWidgetClass)) |
509 { | 526 { |
510 Boolean check; | 527 Boolean check; |
511 | 528 Arg al [1]; |
512 Xt_GET_VALUE (widget, XtNstate, &check); | 529 |
513 | 530 XtSetArg (al [0], XtNstate, &check); |
514 Xt_SET_VALUE (widget, XtNstate, !check); | 531 XtGetValues (widget, al, 1); |
532 | |
533 XtSetArg (al [0], XtNstate, !check); | |
534 XtSetValues (widget, al, 1); | |
515 } | 535 } |
516 #endif /* LWLIB_WIDGETS_ATHENA */ | 536 #endif /* LWLIB_WIDGETS_ATHENA */ |
517 lw_internal_update_other_instances (widget, closure, call_data); | 537 lw_internal_update_other_instances (widget, closure, call_data); |
518 | 538 |
519 if (! instance) | 539 if (! instance) |
527 | 547 |
528 id = instance->info->id; | 548 id = instance->info->id; |
529 | 549 |
530 #if 0 | 550 #if 0 |
531 user_data = NULL; | 551 user_data = NULL; |
532 Xt_GET_VALUE (widget, XtNuserData, &user_data); | 552 { |
553 Arg al [1]; | |
554 XtSetArg (al [0], XtNuserData, &user_data); | |
555 XtGetValues (widget, al, 1); | |
556 } | |
533 #else | 557 #else |
534 /* Damn! Athena doesn't give us a way to hang our own data on the | 558 /* Damn! Athena doesn't give us a way to hang our own data on the |
535 buttons, so we have to go find it... I guess this assumes that | 559 buttons, so we have to go find it... I guess this assumes that |
536 all instances of a button have the same call data. | 560 all instances of a button have the same call data. |
537 | 561 |
568 XtPointer UNUSED (call_data)) | 592 XtPointer UNUSED (call_data)) |
569 { | 593 { |
570 LWLIB_ID id; | 594 LWLIB_ID id; |
571 Widget *kids = 0; | 595 Widget *kids = 0; |
572 Widget widget; | 596 Widget widget; |
573 | 597 Arg al [1]; |
574 if (! XtIsSubclass (shell, shellWidgetClass)) | 598 if (! XtIsSubclass (shell, shellWidgetClass)) |
575 abort (); | 599 abort (); |
576 Xt_GET_VALUE (shell, XtNchildren, &kids); | 600 XtSetArg (al [0], XtNchildren, &kids); |
601 XtGetValues (shell, al, 1); | |
577 if (!kids || !*kids) abort (); | 602 if (!kids || !*kids) abort (); |
578 | 603 |
579 for (widget = *kids; | 604 for (widget = *kids; |
580 widget && ! XtIsSubclass (widget, dialogWidgetClass); | 605 widget && ! XtIsSubclass (widget, dialogWidgetClass); |
581 widget = *++kids) | 606 widget = *++kids) |
670 /* #### This is tacked onto the with and height and completely | 695 /* #### This is tacked onto the with and height and completely |
671 screws our geometry management. We should probably make the | 696 screws our geometry management. We should probably make the |
672 top-level aware of this so that people could have a border but so | 697 top-level aware of this so that people could have a border but so |
673 few people use the Athena scrollbar now that it really isn't | 698 few people use the Athena scrollbar now that it really isn't |
674 worth the effort, at least not at the moment. */ | 699 worth the effort, at least not at the moment. */ |
675 Xt_SET_ARG (av [ac], XtNborderWidth, 0); ac++; | 700 XtSetArg (av [ac], XtNborderWidth, 0); ac++; |
676 Xt_SET_ARG (av [ac], XtNorientation, | 701 XtSetArg (av [ac], XtNorientation, |
677 vertical ? XtorientVertical : XtorientHorizontal); ac++; | 702 vertical ? XtorientVertical : XtorientHorizontal); ac++; |
678 Xt_SET_ARG (av [ac], "jumpProc", jumpCallbacks); ac++; | 703 XtSetArg (av [ac], "jumpProc", jumpCallbacks); ac++; |
679 Xt_SET_ARG (av [ac], "scrollProc", scrollCallbacks); ac++; | 704 XtSetArg (av [ac], "scrollProc", scrollCallbacks); ac++; |
680 | 705 |
681 return XtCreateWidget (instance->info->name, scrollbarWidgetClass, | 706 return XtCreateWidget (instance->info->name, scrollbarWidgetClass, |
682 instance->parent, av, ac); | 707 instance->parent, av, ac); |
683 } | 708 } |
684 | 709 |
703 Arg al[20]; | 728 Arg al[20]; |
704 int ac = 0; | 729 int ac = 0; |
705 Widget button = 0; | 730 Widget button = 0; |
706 widget_value* val = instance->info->val; | 731 widget_value* val = instance->info->val; |
707 | 732 |
708 Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; | 733 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; |
709 Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++; | 734 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; |
710 Xt_SET_ARG (al [ac], XtNjustify, XtJustifyCenter); ac++; | 735 XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++; |
711 /* The highlight doesn't appear to be dynamically set which makes it | 736 /* The highlight doesn't appear to be dynamically set which makes it |
712 look ugly. I think this may be a LessTif bug but for now we just | 737 look ugly. I think this may be a LessTif bug but for now we just |
713 get rid of it. */ | 738 get rid of it. */ |
714 Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++; | 739 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++; |
715 | 740 |
716 /* add any args the user supplied for creation time */ | 741 /* add any args the user supplied for creation time */ |
717 lw_add_value_args_to_args (val, al, &ac); | 742 lw_add_value_args_to_args (val, al, &ac); |
718 | 743 |
719 if (!val->call_data) | 744 if (!val->call_data) |
722 | 747 |
723 else | 748 else |
724 { | 749 { |
725 if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE) | 750 if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE) |
726 { | 751 { |
727 Xt_SET_ARG (al [ac], XtNstate, val->selected); ac++; | 752 XtSetArg (al [ac], XtNstate, val->selected); ac++; |
728 button = XtCreateWidget | 753 button = XtCreateWidget |
729 (val->name, | 754 (val->name, |
730 val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass, | 755 val->type == TOGGLE_TYPE ? checkboxWidgetClass : radioWidgetClass, |
731 instance->parent, al, ac); | 756 instance->parent, al, ac); |
732 } | 757 } |
756 { | 781 { |
757 Arg al[20]; | 782 Arg al[20]; |
758 int ac = 0; | 783 int ac = 0; |
759 Widget label = 0; | 784 Widget label = 0; |
760 | 785 |
761 Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; | 786 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; |
762 Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++; | 787 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; |
763 Xt_SET_ARG (al [ac], XtNjustify, XtJustifyCenter); ac++; | 788 XtSetArg (al [ac], XtNjustify, XtJustifyCenter); ac++; |
764 | 789 |
765 /* add any args the user supplied for creation time */ | 790 /* add any args the user supplied for creation time */ |
766 lw_add_value_args_to_args (val, al, &ac); | 791 lw_add_value_args_to_args (val, al, &ac); |
767 | 792 |
768 label = XtCreateManagedWidget (val->name, labelWidgetClass, | 793 label = XtCreateManagedWidget (val->name, labelWidgetClass, |
841 Widget scale = 0; | 866 Widget scale = 0; |
842 widget_value* val = instance->info->val; | 867 widget_value* val = instance->info->val; |
843 #if 0 /* This looks too awful, although more correct. */ | 868 #if 0 /* This looks too awful, although more correct. */ |
844 if (!val->call_data) | 869 if (!val->call_data) |
845 { | 870 { |
846 Xt_SET_ARG (al [ac], XtNsensitive, False); ac++; | 871 XtSetArg (al [ac], XtNsensitive, False); ac++; |
847 } | 872 } |
848 else | 873 else |
849 { | 874 { |
850 Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; | 875 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; |
851 } | 876 } |
852 #else | 877 #else |
853 Xt_SET_ARG (al [ac], XtNsensitive, True); ac++; | 878 XtSetArg (al [ac], XtNsensitive, True); ac++; |
854 #endif | 879 #endif |
855 | 880 |
856 Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++; | 881 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; |
857 Xt_SET_ARG (al [ac], XtNorientation, XtorientHorizontal); ac++; | 882 XtSetArg (al [ac], XtNorientation, XtorientHorizontal); ac++; |
858 Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++; | 883 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0);ac++; |
859 Xt_SET_ARG (al [ac], XtNntics, (Cardinal)10); ac++; | 884 XtSetArg (al [ac], XtNntics, (Cardinal)10);ac++; |
860 | 885 |
861 /* add any args the user supplied for creation time */ | 886 /* add any args the user supplied for creation time */ |
862 lw_add_value_args_to_args (val, al, &ac); | 887 lw_add_value_args_to_args (val, al, &ac); |
863 | 888 |
864 if (debug_gauge > 1) | 889 if (debug_gauge > 1) |
888 Arg al[20]; | 913 Arg al[20]; |
889 int ac = 0; | 914 int ac = 0; |
890 Widget text = 0; | 915 Widget text = 0; |
891 widget_value* val = instance->info->val; | 916 widget_value* val = instance->info->val; |
892 | 917 |
893 Xt_SET_ARG (al [ac], XtNsensitive, val->enabled); ac++; | 918 XtSetArg (al [ac], XtNsensitive, val->enabled); ac++; |
894 Xt_SET_ARG (al [ac], XtNmappedWhenManaged, FALSE); ac++; | 919 XtSetArg (al [ac], XtNmappedWhenManaged, FALSE); ac++; |
895 Xt_SET_ARG (al [ac], XtNhighlightThickness, (Dimension)0); ac++; | 920 XtSetArg (al [ac], XtNhighlightThickness, (Dimension)0); ac++; |
896 Xt_SET_ARG (al [ac], XtNtype, XawAsciiString); ac++; | 921 XtSetArg (al [ac], XtNtype, XawAsciiString); ac++; |
897 Xt_SET_ARG (al [ac], XtNeditType, XawtextEdit); ac++; | 922 XtSetArg (al [ac], XtNeditType, XawtextEdit); ac++; |
898 Xt_SET_ARG (al [ac], XtNuseStringInPlace, False); ac++; | 923 XtSetArg (al [ac], XtNuseStringInPlace, False); ac++; |
899 #if 0 | 924 #if 0 |
900 Xt_SET_ARG (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++; | 925 XtSetArg (al [ac], XtNlength, TEXT_BUFFER_SIZE); ac++; |
901 #endif | 926 #endif |
902 if (val->value) | 927 if (val->value) |
903 { | 928 { |
904 Xt_SET_ARG (al [ac], XtNstring, val->value); ac++; | 929 XtSetArg (al [ac], XtNstring, val->value); ac++; |
905 } | 930 } |
906 | 931 |
907 /* add any args the user supplied for creation time */ | 932 /* add any args the user supplied for creation time */ |
908 lw_add_value_args_to_args (val, al, &ac); | 933 lw_add_value_args_to_args (val, al, &ac); |
909 | 934 |
929 {"vertical-scrollbar", xaw_create_vertical_scrollbar }, | 954 {"vertical-scrollbar", xaw_create_vertical_scrollbar }, |
930 {"horizontal-scrollbar", xaw_create_horizontal_scrollbar }, | 955 {"horizontal-scrollbar", xaw_create_horizontal_scrollbar }, |
931 #endif | 956 #endif |
932 #ifdef LWLIB_WIDGETS_ATHENA | 957 #ifdef LWLIB_WIDGETS_ATHENA |
933 {"button", xaw_create_button }, | 958 {"button", xaw_create_button }, |
934 {"label", xaw_create_label_field }, | 959 { "label", xaw_create_label_field }, |
935 {"text-field", xaw_create_text_field }, | 960 {"text-field", xaw_create_text_field }, |
936 {"progress", xaw_create_progress }, | 961 {"progress", xaw_create_progress }, |
937 #endif | 962 #endif |
938 {NULL, NULL} | 963 {NULL, NULL} |
939 }; | 964 }; |
940 | 965 |