// Destroy menubar, but keep data structures intact so we can recreate it. bool wxMenuBar::DestroyMenuBar() { if (!m_mainWidget) { SetMenuBarFrame(NULL); return false; } XtUnmanageChild ((Widget) m_mainWidget); XtUnrealizeWidget ((Widget) m_mainWidget); size_t menuCount = GetMenuCount(); #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ for (size_t i = 0; i < menuCount; i++) { wxMenu *menu = GetMenu(i); menu->DestroyMenu(true); } XtDestroyWidget((Widget) m_mainWidget); m_mainWidget = (WXWidget) 0; SetMenuBarFrame(NULL); return true; }
// Destroy menubar, but keep data structures intact so we can recreate it. bool wxMenuBar::DestroyMenuBar() { if (!m_mainWidget) { SetMenuBarFrame(NULL); return false; } XtUnmanageChild ((Widget) m_mainWidget); XtUnrealizeWidget ((Widget) m_mainWidget); size_t menuCount = GetMenuCount(); for (size_t i = 0; i < menuCount; i++) { wxMenu *menu = GetMenu(i); menu->DestroyMenu(true); } XtDestroyWidget((Widget) m_mainWidget); m_mainWidget = (WXWidget) 0; SetMenuBarFrame(NULL); return true; }
void XFE_AttachmentMenu::update() { Widget *kids; int nkids; XtVaGetValues (m_submenu, XmNchildren, &kids, XmNnumChildren, &nkids, 0); XtUnrealizeWidget(m_submenu); if (nkids) { kids = &(kids[m_firstslot]); nkids -= m_firstslot; XtUnmanageChildren (kids, nkids); fe_DestroyWidgetTree(kids, nkids); } add_attachment_menu_items(m_submenu); XtRealizeWidget(m_submenu); XtRemoveCallback(m_cascade, XmNcascadingCallback, update_cb, this); }
void iupdrvBaseUnMapMethod(Ihandle* ih) { Widget widget = (Widget)iupAttribGet(ih, "_IUP_EXTRAPARENT"); if (!widget) widget = ih->handle; XtUnrealizeWidget(widget); /* To match the call to XtRealizeWidget */ XtDestroyWidget(widget); /* To match the call to XtCreateManagedWidget */ }
void xtbin::xtbin_destroy() { sync(); XtUnregisterDrawable(xtdisplay, xtwindow); sync(); xtwidget->core.window = oldwindow; XtUnrealizeWidget(xtwidget); initialized = False; }
int main( int argc, char ** argv ) { XtAppContext app_context; Widget TheWindow = XtVaAppInitialize( &app_context, "Full Screen Test", NULL, 0, &argc, argv, NULL, NULL ); if (TheWindow == NULL) exit(1); Display *display=XOpenDisplay(NULL); int screen = DefaultScreen(display); // Destroy the window asociated to the widget XtUnrealizeWidget( TheWindow ); // Put some values in the size, otherwise the window creation will complain XtConfigureWidget( TheWindow, 0, 0, 10, 10, 0 ); // Now set the attributes for the new window XSetWindowAttributes attr; // We'll handle it; make the Window manager leave us alone attr.override_redirect = true; Visual *visual = DefaultVisual(display,screen); // Create a window with our attributes XtCreateWindow( TheWindow, InputOutput, visual, CWOverrideRedirect, &attr ); SoXt::init( TheWindow ); SoXtExaminerViewer *Viewer = new SoXtExaminerViewer(TheWindow, "My Examiner Viewer"); Viewer->setDecoration(FALSE); Viewer->setBorder(FALSE); SoXt::show(TheWindow); // Set size and position; no border XtConfigureWidget( TheWindow, 0, 0, DisplayWidth( display, DefaultScreen( display ) ), DisplayHeight( display, DefaultScreen( display ) ), 0 ); SoXt::mainLoop(); }
Window::~Window() { // Delete deleteWindowAtom contentPanel.reset(NULL); XtPopdown(widget); XtUnrealizeWidget(widget); XtDestroyWidget(widget); }
GLXConfigurator::~GLXConfigurator() { if(mBackDrop) XFreePixmap(mDisplay, mBackDrop); if(toplevel) { XtUnrealizeWidget(toplevel); XtDestroyWidget(toplevel); } if(mDisplay) { XCloseDisplay(mDisplay); } }
void xt_client_unrealize ( XtClient* xtclient ) { /* Explicitly destroy the child_widget window because this is actually a child of the socket window. It is not a child of top_widget's window when that is destroyed. */ XtUnrealizeWidget(xtclient->child_widget); #if XlibSpecificationRelease >= 6 XtUnregisterDrawable(xtclient->xtdisplay, xtclient->top_widget->core.window); #else _XtUnregisterWindow(xtclient->top_widget->core.window, xtclient->top_widget); #endif /* flush the queue before we returning origin top_widget->core.window or we can get X error since the window is gone */ XSync(xtclient->xtdisplay, False); xtclient->top_widget->core.window = xtclient->oldwindow; XtUnrealizeWidget(xtclient->top_widget); }
static void xt_client_unrealize ( XtClient* xtclient ) { #if XlibSpecificationRelease >= 6 XtUnregisterDrawable(xtclient->xtdisplay, xtclient->top_widget->core.window); #else _XtUnregisterWindow(xtclient->top_widget->core.window, xtclient->top_widget); #endif /* flush the queue before we returning origin top_widget->core.window or we can get X error since the window is gone */ XSync(xtclient->xtdisplay, False); xtclient->top_widget->core.window = xtclient->oldwindow; XtUnrealizeWidget(xtclient->top_widget); }
static Boolean Test6(Widget W) { WidgetList kids; Cardinal numkids; XtWidgetGeometry Form; XtWidgetGeometry Kid1; XtWidgetGeometry Kid2; fprintf(stderr, "Test 6 Starting...\n"); XtVaGetValues(W, XmNchildren, &kids, XmNnumChildren, &numkids, XmNx, &Form.x, XmNy, &Form.y, XmNwidth, &Form.width, XmNheight, &Form.height, NULL); XtVaGetValues(kids[TOPLABEL], XmNx, &Kid1.x, XmNy, &Kid1.y, XmNwidth, &Kid1.width, XmNheight, &Kid1.height, XmNborderWidth, &Kid1.border_width, NULL); XtVaGetValues(kids[BOTLABEL], XmNx, &Kid2.x, XmNy, &Kid2.y, XmNwidth, &Kid2.width, XmNheight, &Kid2.height, XmNborderWidth, &Kid2.border_width, NULL); XtUnrealizeWidget(XtParent(W)); XtUnrealizeWidget(W); XtUnrealizeWidget(kids[TOPLABEL]); XtUnrealizeWidget(kids[BOTLABEL]); XtUnmanageChild(kids[BOTLABEL]); XtVaSetValues(W, XmNwidth, 215, XmNheight, 0, NULL); XtVaSetValues(kids[TOPLABEL], XmNwidth, 0, XmNheight, 0, NULL); XtVaSetValues(kids[BOTLABEL], XmNwidth, 0, XmNheight, 0, NULL); XtVaSetValues(kids[0], XmNtopAttachment, XmATTACH_NONE, NULL); XtVaSetValues(kids[0], XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_NONE, XmNleftAttachment, XmATTACH_WIDGET, XmNleftWidget, kids[1], XmNleftOffset, 10, XmNrightAttachment, XmATTACH_FORM, XmNrightOffset, 10, XmNwidth, 90, XmNheight, 0, NULL); XtVaSetValues(kids[1], XmNbottomAttachment, XmATTACH_FORM, NULL); XtVaSetValues(kids[1], XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_NONE, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_NONE, XmNleftOffset, 10, XmNwidth, 100, XmNheight, 0, NULL); XtManageChild(kids[0]); XtManageChild(kids[1]); XtManageChild(W); XtRealizeWidget(XtParent(W)); ExpectedResults[0].request_mode = CWWidth | CWHeight; ExpectedResults[0].x = Form.x; ExpectedResults[0].y = Form.y; ExpectedResults[0].width = Form.width; ExpectedResults[0].height = Form.height; ExpectedResults[1].request_mode = CWX | CWY | CWWidth | CWHeight; ExpectedResults[1].x = Kid1.x; ExpectedResults[1].y = Kid1.x; ExpectedResults[1].width = Kid1.width; ExpectedResults[1].height = Kid1.height; ExpectedResults[2].request_mode = CWX | CWY | CWWidth | CWHeight; ExpectedResults[2].x = Kid2.x; ExpectedResults[2].y = Kid2.y; ExpectedResults[2].width = Kid2.width; ExpectedResults[2].height = Kid2.height; printf("Test 6\n"); FinishTest(W); return(True); }
// Documented in superclass. void SoXtExaminerViewer::setCamera(SoCamera * camera) { #if SOXT_DEBUG && 0 SoDebugError::postInfo("SoXtExaminerViewer::setCamera", "[enter]"); #endif // SOXT_DEBUG Pixmap pixmap, pixmap_ins; if (camera == NULL) { // find better pixmaps for this... pixmap = PRIVATE(this)->camerapixmaps.ortho; pixmap_ins = PRIVATE(this)->camerapixmaps.ortho_ins; } else if (camera->isOfType(SoPerspectiveCamera::getClassTypeId())) { pixmap = PRIVATE(this)->camerapixmaps.perspective; pixmap_ins = PRIVATE(this)->camerapixmaps.perspective_ins; SoXtResource rsc(this->getRightWheelLabelWidget()); char * dollyString = NULL; char * zoomString = NULL; if ( (rsc.getResource("dollyString", XmRString, dollyString) && dollyString != NULL) && (rsc.getResource("zoomString", XmRString, zoomString) && zoomString != NULL) && strcmp(zoomString,this->getRightWheelString())== 0 ) this->setRightWheelString(dollyString); } else if (camera->isOfType(SoOrthographicCamera::getClassTypeId())) { pixmap = PRIVATE(this)->camerapixmaps.ortho; pixmap_ins = PRIVATE(this)->camerapixmaps.ortho_ins; SoXtResource rsc(this->getRightWheelLabelWidget()); char * dollyString = NULL; char * zoomString = NULL; if ( (rsc.getResource("dollyString", XmRString, dollyString) && dollyString != NULL) && (rsc.getResource("zoomString", XmRString, zoomString) && zoomString != NULL) && strcmp(dollyString,this->getRightWheelString())== 0 ) this->setRightWheelString(zoomString); } else { SoDebugError::postWarning("SoXtExaminerViewer::setCamera", "unknown camera type - got no pixmap"); // find better pixmaps for this... pixmap = PRIVATE(this)->camerapixmaps.ortho; pixmap_ins = PRIVATE(this)->camerapixmaps.ortho_ins; } #if HAVE_LIBXPM SbBool extra = XtIsRealized(PRIVATE(this)->camerabutton) ? TRUE : FALSE; if (extra) { XtUnmapWidget(PRIVATE(this)->camerabutton); XtUnrealizeWidget(PRIVATE(this)->camerabutton); } if (pixmap) { XtVaSetValues(PRIVATE(this)->camerabutton, XmNlabelType, XmPIXMAP, XmNlabelPixmap, pixmap, XmNselectPixmap, pixmap, XmNlabelInsensitivePixmap, pixmap_ins, XmNselectInsensitivePixmap, pixmap_ins, NULL); XtVaSetValues(PRIVATE(this)->camerabutton, XmNwidth, 30, XmNheight, 30, NULL); } if (extra) { XtRealizeWidget(PRIVATE(this)->camerabutton); XtMapWidget(PRIVATE(this)->camerabutton); } #endif // HAVE_LIBXPM inherited::setCamera(camera); #if SOXT_DEBUG && 0 SoDebugError::postInfo("SoXtExaminerViewer::setCamera", "[exit]"); #endif // SOXT_DEBUG }
void PopupPopup(Widget parent, Widget popup, Bool transient, Bool first_time, int offset_x, int offset_y, String delAction) { if (!transient && !first_time) { /* * For non-transient windows, if this isn't the first time * it's being popped up, just pop it up in the old position. */ XtPopup (popup, XtGrabNone); return; } else { Position parent_x, parent_y; Position root_x, root_y; Position popup_x, popup_y; Dimension parent_width, parent_height, parent_border; Dimension popup_width, popup_height, popup_border; char geom[16]; Bool repos = 0; /* * The window we pop up must be visible on the screen. We first * try to position it at the desired location (relative to the * parent widget). Once we are able to compute the popup's * geometry (after it's realized), we can determine if we need * to reposition it. */ XtVaGetValues (parent, XtNx, &parent_x, XtNy, &parent_y, XtNwidth, &parent_width, XtNheight, &parent_height, XtNborderWidth, &parent_border, NULL); XtTranslateCoords (parent, parent_x, parent_y, &root_x, &root_y); popup_x = root_x + offset_x; popup_y = root_y + offset_y; if (transient) { XtVaSetValues (popup, XtNx, popup_x, XtNy, popup_y, NULL); } else { sprintf (geom, "+%d+%d", popup_x, popup_y); XtVaSetValues (popup, XtNgeometry, geom, NULL); } if (first_time) { /* * Realize it for the first time */ XtRealizeWidget (popup); /* * Set support for WM_DELETE_WINDOW */ (void) SetWM_DELETE_WINDOW (popup, delAction); } /* * Now make sure it's visible. */ XtVaGetValues (popup, XtNwidth, &popup_width, XtNheight, &popup_height, XtNborderWidth, &popup_border, NULL); popup_border <<= 1; if ((int) (popup_x + popup_width + popup_border) > WidthOfScreen (XtScreen (topLevel))) { popup_x = WidthOfScreen (XtScreen (topLevel)) - popup_width - popup_border - parent_width - parent_border; repos = 1; } if ((int) (popup_y + popup_height + popup_border) > HeightOfScreen (XtScreen (topLevel))) { popup_y = HeightOfScreen (XtScreen (topLevel)) - popup_height - popup_border - parent_height - parent_border; repos = 1; } if (repos) { if (transient) { XtVaSetValues (popup, XtNx, popup_x, XtNy, popup_y, NULL); } else { /* * The only way we can reposition a non-transient * is by unrealizing it, setting the position, then * doing a realize. */ XtUnrealizeWidget (popup); sprintf (geom, "+%d+%d", popup_x, popup_y); XtVaSetValues (popup, XtNgeometry, geom, NULL); XtRealizeWidget (popup); (void) SetWM_DELETE_WINDOW (popup, delAction); } } XtPopup (popup, XtGrabNone); } }
/*<----------------------------------------------------------------------------------------->*/ void DesactiverPanneauEdition() { XtUnrealizeWidget(peTopLevel); }