X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02e8b2f9fbdfcd25080c42082d637da257c20094..06cfab17389f4bbd38560dd86ee39931e979bb1e:/src/motif/control.cpp diff --git a/src/motif/control.cpp b/src/motif/control.cpp index 4e708a5c14..64369b26d2 100644 --- a/src/motif/control.cpp +++ b/src/motif/control.cpp @@ -31,6 +31,7 @@ wxControl::wxControl() m_backgroundColour = *wxWHITE; m_foregroundColour = *wxBLACK; m_callback = 0; + m_inSetValue = FALSE; } wxControl::~wxControl() @@ -47,41 +48,43 @@ wxControl::~wxControl() void wxControl::SetLabel(const wxString& label) { - if (!GetMainWidget()) - return; + Widget widget = (Widget) GetLabelWidget() ; + if (!widget) + return; - wxStripMenuCodes((char*) (const char*) label, wxBuffer); + wxStripMenuCodes((char*) (const char*) label, wxBuffer); - XmString text = XmStringCreateSimple (wxBuffer); - XtVaSetValues ((Widget) GetMainWidget(), - XmNlabelString, text, - XmNlabelType, XmSTRING, + XmString text = XmStringCreateSimple (wxBuffer); + XtVaSetValues (widget, + XmNlabelString, text, + XmNlabelType, XmSTRING, NULL); - XmStringFree (text); + XmStringFree (text); } wxString wxControl::GetLabel() const { - if (!GetMainWidget()) - return wxEmptyString; + Widget widget = (Widget) GetLabelWidget() ; + if (!widget) + return wxEmptyString; - XmString text; - char *s; - XtVaGetValues ((Widget) GetMainWidget(), + XmString text; + char *s; + XtVaGetValues (widget, XmNlabelString, &text, NULL); - if (XmStringGetLtoR (text, XmSTRING_DEFAULT_CHARSET, &s)) + if (XmStringGetLtoR (text, XmSTRING_DEFAULT_CHARSET, &s)) { - wxString str(s); - XtFree (s); - XmStringFree(text); - return str; + wxString str(s); + XtFree (s); + XmStringFree(text); + return str; } - else + else { - XmStringFree(text); - return wxEmptyString; + XmStringFree(text); + return wxEmptyString; } }