void toggle_statusline(void) { #ifdef MOTIF if ((resource.expert_mode & XPRT_SHOW_STATUSLINE) == 0) XtUnmanageChild(statusline); else XtManageChild(statusline); set_menu(&resource.expert_mode, Act_set_expert_mode, check_resource_expert); #else static Boolean initialized = False; static Boolean statusline_mapped = False; Boolean make_statusline_visible = False; Boolean make_statusline_invisible = False; if (!initialized) { statusline_mapped = (resource.expert_mode & XPRT_SHOW_STATUSLINE) != 0; initialized = True; } if ((resource.expert_mode & XPRT_SHOW_STATUSLINE) == 0) { if (statusline_mapped) make_statusline_invisible = True; } else { if (!statusline_mapped) make_statusline_visible = True; } if (make_statusline_invisible) { XtDestroyWidget(statusline); statusline_mapped = False; } if (make_statusline_visible) { static Dimension window_w, window_h; static Arg arg_wh[] = { {XtNwidth, (XtArgVal) &window_w}, {XtNheight, (XtArgVal) &window_h}, }; #ifdef MOTIF XtGetValues(globals.widgets.main_window, arg_wh, XtNumber(arg_wh)); #else XtGetValues(globals.widgets.vport_widget, arg_wh, XtNumber(arg_wh)); #endif XtVaSetValues(globals.widgets.vport_widget, XtNresizable, (XtArgVal)True, NULL); TRACE_GUI((stderr, "statusline: w %d, h %d", window_w, window_h)); XtVaSetValues(globals.widgets.vport_widget, XtNwidth, (XtArgVal)window_w, XtNheight, (XtArgVal)window_h, NULL); TRACE_GUI((stderr, "after statusline")); create_statusline(); statusline_mapped = True; } #endif /* MOTIF */ }
void handle_statusline_resize(void) { #ifndef MOTIF if ((resource.expert_mode & XPRT_SHOW_STATUSLINE) == 0) { return; } if (!statusline) return; /* apparently the x,y values of a widget can only be set at creation time, so * the following won't work: */ #if 0 /* BROKEN Position vport_h, clip_x, clip_w; BROKEN static Position my_h = 0; BROKEN BROKEN XtVaGetValues(globals.widgets.clip_widget, BROKEN XtNx, &clip_x, BROKEN XtNwidth, &clip_w, BROKEN NULL); BROKEN XtVaGetValues(globals.widgets.vport_widget, BROKEN XtNheight, &vport_h, BROKEN NULL); BROKEN BROKEN XtUnmanageChild(statusline); BROKEN XtVaSetValues(statusline, BROKEN XtNlabel, (XtArgVal) "", BROKEN XtNwidth, clip_w, BROKEN XtNx, clip_x - 1, BROKEN XtNy, vport_h - my_h, BROKEN XtNborderWidth, 1, BROKEN XtNjustify, XtJustifyLeft, BROKEN XtNborder, (XtArgVal) resource.fore_Pixel, BROKEN NULL); BROKEN XtManageChild(statusline); BROKEN XFlush(DISP); */ #endif /* only this will: */ XtDestroyWidget(statusline); create_statusline(); #endif }
void handle_statusline_resize(void) { if (!resource.statusline) { return; } /* apparently the x,y values of a widget can only be set at creation time, so * the following won't work: */ #if 0 // BROKEN Position vport_h, clip_x, clip_w; // BROKEN static Position my_h = 0; // BROKEN // BROKEN XtVaGetValues(clip_widget, // BROKEN XtNx, &clip_x, // BROKEN XtNwidth, &clip_w, // BROKEN NULL); // BROKEN XtVaGetValues(vport_widget, // BROKEN XtNheight, &vport_h, // BROKEN NULL); // BROKEN // BROKEN XtUnmanageChild(statusline); // BROKEN XtVaSetValues(statusline, // BROKEN // XtNlabel, (XtArgVal) "", // BROKEN XtNwidth, clip_w, // BROKEN XtNx, clip_x - 1, // BROKEN XtNy, vport_h - my_h, // BROKEN XtNborderWidth, 1, // BROKEN XtNjustify, XtJustifyLeft, // BROKEN XtNborder, (XtArgVal) resource._fore_Pixel, // BROKEN NULL); // BROKEN XtManageChild(statusline); // BROKEN XFlush(DISP); #endif /* only this will: */ XtDestroyWidget(statusline); create_statusline(); }