- m_frameWidget = (WXWidget) XtVaCreateManagedWidget("main_window",
- xmMainWindowWidgetClass, (Widget) m_frameShell,
- XmNresizePolicy, XmRESIZE_NONE,
- NULL);
-
- m_workArea = (WXWidget) XtVaCreateWidget("form",
- xmFormWidgetClass, (Widget) m_frameWidget,
- XmNresizePolicy, XmRESIZE_NONE,
- NULL);
-
- m_clientArea = (WXWidget) XtVaCreateWidget("client",
- xmBulletinBoardWidgetClass, (Widget) m_workArea,
- XmNmarginWidth, 0,
- XmNmarginHeight, 0,
- XmNrightAttachment, XmATTACH_FORM,
- XmNleftAttachment, XmATTACH_FORM,
- XmNtopAttachment, XmATTACH_FORM,
- XmNbottomAttachment, XmATTACH_FORM,
-// XmNresizePolicy, XmRESIZE_ANY,
- NULL);
-
- XtVaSetValues((Widget) m_frameWidget,
- XmNworkWindow, (Widget) m_workArea,
- NULL);
-
-
- XtManageChild((Widget) m_clientArea);
- XtManageChild((Widget) m_workArea);
-
- wxASSERT_MSG ((wxWidgetHashTable->Get((long)m_workArea) == (wxObject*) NULL), "Widget table clash in frame.cpp") ;
-
- wxAddWindowToTable((Widget) m_workArea, this);
-
- XtTranslations ptr ;
-
- XtOverrideTranslations((Widget) m_workArea,
- ptr = XtParseTranslationTable("<Configure>: resize()"));
-
- XtFree((char *)ptr);
-
- XtAddCallback((Widget) m_workArea, XmNfocusCallback,
- (XtCallbackProc)wxFrameFocusProc, (XtPointer)this);
-
- /* Part of show-&-hide fix */
- XtAddEventHandler((Widget) m_frameShell, StructureNotifyMask,
- False, (XtEventHandler)wxFrameMapProc,
- (XtPointer)m_workArea);
-
- if (x > -1)
- XtVaSetValues((Widget) m_frameShell, XmNx, x, NULL);
- if (y > -1)
- XtVaSetValues((Widget) m_frameShell, XmNy, y, NULL);
- if (width > -1)
- XtVaSetValues((Widget) m_frameShell, XmNwidth, width, NULL);
- if (height > -1)
- XtVaSetValues((Widget) m_frameShell, XmNheight, height, NULL);
-
- m_mainWidget = m_frameWidget;
-
- ChangeFont(FALSE);
-
- // This patch comes from Torsten Liermann lier@lier1.muc.de
- if (XmIsMotifWMRunning( (Widget) m_frameShell ))
- {
- int decor = 0 ;
- if (style & wxRESIZE_BORDER)
- decor |= MWM_DECOR_RESIZEH ;
- if (style & wxSYSTEM_MENU)
- decor |= MWM_DECOR_MENU;
- if ((style & wxCAPTION) ||
- (style & wxTINY_CAPTION_HORIZ) ||
- (style & wxTINY_CAPTION_VERT))
- decor |= MWM_DECOR_TITLE;
- if (style & wxTHICK_FRAME)
- decor |= MWM_DECOR_BORDER;
- if (style & wxTHICK_FRAME)
- decor |= MWM_DECOR_BORDER;
- if (style & wxMINIMIZE_BOX)
- decor |= MWM_DECOR_MINIMIZE;
- if (style & wxMAXIMIZE_BOX)
- decor |= MWM_DECOR_MAXIMIZE;
- XtVaSetValues((Widget) m_frameShell,XmNmwmDecorations,decor,NULL) ;
- }
- // This allows non-Motif window managers to support at least the
- // no-decorations case.
- else
- {
- if (style == 0)
- XtVaSetValues((Widget) m_frameShell,XmNoverrideRedirect,TRUE,NULL);
- }
- XtRealizeWidget((Widget) m_frameShell);
-
- // Intercept CLOSE messages from the window manager
- Atom WM_DELETE_WINDOW = XmInternAtom(XtDisplay((Widget) m_frameShell), "WM_DELETE_WINDOW", False);
-#if (XmREVISION > 1 || XmVERSION > 1)
- XmAddWMProtocolCallback((Widget) m_frameShell, WM_DELETE_WINDOW, (XtCallbackProc) wxCloseFrameCallback, (XtPointer)this);
-#else
-#if XmREVISION == 1
- XmAddWMProtocolCallback((Widget) m_frameShell, WM_DELETE_WINDOW, (XtCallbackProc) wxCloseFrameCallback, (caddr_t)this);
-#else
- XmAddWMProtocolCallback((Widget) m_frameShell, WM_DELETE_WINDOW, (void (*)())wxCloseFrameCallback, (caddr_t)this);
-#endif
-#endif
+ SetTitle( title );
+
+ wxLogTrace(wxTRACE_Messages,
+ "Created frame (0x%p) with work area 0x%p and client "
+ "area 0x%p", m_mainWidget, m_workArea, m_clientArea);
+
+ XtAddEventHandler((Widget) m_clientArea, ExposureMask,FALSE,
+ wxUniversalRepaintProc, (XtPointer) this);
+
+ if (x > -1)
+ XtVaSetValues((Widget) m_frameShell, XmNx, x, NULL);
+ if (y > -1)
+ XtVaSetValues((Widget) m_frameShell, XmNy, y, NULL);
+ if (width > -1)
+ XtVaSetValues((Widget) m_frameShell, XmNwidth, width, NULL);
+ if (height > -1)
+ XtVaSetValues((Widget) m_frameShell, XmNheight, height, NULL);