NULL
);
+ XtVaSetValues ((Widget) m_mainWidget,
+ XmNeditable, ((style & wxTE_READONLY) ? False : True),
+ NULL);
+
// TODO: Is this relevant? What does it do?
int noCols = 2;
if (!value.IsNull() && (value.Length() > (unsigned int) noCols))
}
if ( !!value )
+ {
+#if 0
+ // don't do this because it is just linking the text to a source
+ // string which is unsafe. MB
+ //
XmTextSetString ((Widget) m_mainWidget, (char*)value.c_str());
-
+#else
+ // do this instead... MB
+ //
+ XtVaSetValues( (Widget) m_mainWidget,
+ XmNvalue, (char *)value.c_str(),
+ NULL);
+#endif
+ }
+
// install callbacks
XtAddCallback((Widget) m_mainWidget, XmNvalueChangedCallback, (XtCallbackProc)wxTextWindowChangedProc, (XtPointer)this);
{
m_inSetValue = TRUE;
+#if 0
+ // don't do this because it is just linking the text to a source
+ // string which is unsafe. MB
+ //
XmTextSetString ((Widget) m_mainWidget, (char*)value.c_str());
+#else
+ // do this instead... MB
+ //
+ XtVaSetValues( (Widget) m_mainWidget,
+ XmNvalue, (char *)value.c_str(),
+ NULL);
+#endif
m_inSetValue = FALSE;
}
return r+x;
}
-void wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
+bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
{
Position xx, yy;
XmTextPosToXY((Widget) m_mainWidget, pos, &xx, &yy);
- *x = xx; *y = yy;
+ if ( x )
+ *x = xx;
+ if ( y )
+ *y = yy;
+
+ return TRUE;
}
void wxTextCtrl::ShowPosition(long pos)