+// ----------------------------------------------------------------------------
+// wxXmSizeKeeper
+// ----------------------------------------------------------------------------
+
+// helper class to reduce code duplication
+class wxXmSizeKeeper
+{
+ Dimension m_x, m_y;
+ Widget m_widget;
+public:
+ wxXmSizeKeeper( Widget w )
+ : m_widget( w )
+ {
+ XtVaGetValues( m_widget,
+ XmNwidth, &m_x,
+ XmNheight, &m_y,
+ NULL );
+ }
+
+ void Restore()
+ {
+ int x, y;
+
+ XtVaGetValues( m_widget,
+ XmNwidth, &x,
+ XmNheight, &y,
+ NULL );
+ if( x != m_x || y != m_y )
+ XtVaSetValues( m_widget,
+ XmNwidth, m_x,
+ XmNheight, m_y,
+ NULL );
+ }
+};