comparison lwlib/lwlib-Xlw.c @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents 6b37e6ddd302
children 5a88923fcbfe
comparison
equal deleted inserted replaced
162:4de2936b4e77 163:0132846995bd
108 { 108 {
109 Widget widget = 109 Widget widget =
110 XtVaCreateWidget (instance->info->name, xlwMenuWidgetClass, 110 XtVaCreateWidget (instance->info->name, xlwMenuWidgetClass,
111 instance->parent, 111 instance->parent,
112 XtNmenu, instance->info->val, 112 XtNmenu, instance->info->val,
113 0); 113 NULL);
114 XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance); 114 XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance);
115 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); 115 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
116 return widget; 116 return widget;
117 } 117 }
118 118
126 Widget widget = 126 Widget widget =
127 XtVaCreateManagedWidget ("popup", xlwMenuWidgetClass, 127 XtVaCreateManagedWidget ("popup", xlwMenuWidgetClass,
128 popup_shell, 128 popup_shell,
129 XtNmenu, instance->info->val, 129 XtNmenu, instance->info->val,
130 XtNhorizontal, False, 130 XtNhorizontal, False,
131 0); 131 NULL);
132 132
133 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); 133 XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
134 134
135 return popup_shell; 135 return popup_shell;
136 } 136 }
267 XtVaSetValues (widget, 267 XtVaSetValues (widget,
268 XtNx, data->scrollbar_x, 268 XtNx, data->scrollbar_x,
269 XtNy, data->scrollbar_y, 269 XtNy, data->scrollbar_y,
270 XtNwidth, data->scrollbar_width, 270 XtNwidth, data->scrollbar_width,
271 XtNheight, data->scrollbar_height, 271 XtNheight, data->scrollbar_height,
272 0); 272 NULL);
273 273
274 /* Now size the scrollbar's slider. */ 274 /* Now size the scrollbar's slider. */
275 XtVaGetValues (widget, 275 XtVaGetValues (widget,
276 XmNsliderSize, &widget_sliderSize, 276 XmNsliderSize, &widget_sliderSize,
277 XmNvalue, &widget_val, 277 XmNvalue, &widget_val,
278 0); 278 NULL);
279 279
280 percent = (double) data->slider_size / 280 percent = (double) data->slider_size /
281 (double) (data->maximum - data->minimum); 281 (double) (data->maximum - data->minimum);
282 percent = (percent > 1.0 ? 1.0 : percent); 282 percent = (percent > 1.0 ? 1.0 : percent);
283 new_sliderSize = (int) ((double) (INT_MAX - 1) * percent); 283 new_sliderSize = (int) ((double) (INT_MAX - 1) * percent);
355 XlwMenuWidget mw; 355 XlwMenuWidget mw;
356 if (XtIsShell (widget)) 356 if (XtIsShell (widget))
357 mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0]; 357 mw = (XlwMenuWidget)((CompositeWidget)widget)->composite.children [0];
358 else 358 else
359 mw = (XlwMenuWidget)widget; 359 mw = (XlwMenuWidget)widget;
360 XtVaSetValues (widget, XtNmenu, val, 0); 360 XtVaSetValues (widget, XtNmenu, val, NULL);
361 } 361 }
362 #endif 362 #endif
363 #ifdef SCROLLBARS_LUCID 363 #ifdef SCROLLBARS_LUCID
364 else if (class == xlwScrollBarWidgetClass) 364 else if (class == xlwScrollBarWidgetClass)
365 { 365 {