- if (!GetMainWidget())
- return;
-
- wxStripMenuCodes((char*) (const char*) label, wxBuffer);
-
- XmString text = XmStringCreateSimple (wxBuffer);
- XtVaSetValues ((Widget) GetMainWidget(),
- XmNlabelString, text,
- XmNlabelType, XmSTRING,
- NULL);
- XmStringFree (text);
+ Widget widget = (Widget) GetLabelWidget() ;
+ if (!widget)
+ return;
+
+ wxStripMenuCodes((char*) (const char*) label, wxBuffer);
+
+ XmString text = XmStringCreateSimple (wxBuffer);
+ XtVaSetValues (widget,
+ XmNlabelString, text,
+ XmNlabelType, XmSTRING,
+ NULL);
+ XmStringFree (text);