comparison lwlib/lwlib-Xm.c @ 60670:68d57432d36d

(xm_update_label, xm_update_list): Use the recommended XmStringCreateLocalized function. Add missing copyright.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 17 Mar 2005 19:03:03 +0000
parents 609ef1718642
children 23a17af379b1 30ad2795fdab
comparison
equal deleted inserted replaced
60669:cffa9a821286 60670:68d57432d36d
1 /* The lwlib interface to Motif widgets. 1 /* The lwlib interface to Motif widgets.
2 Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2004, 2005
3 Free Software Foundation, Inc.
2 Copyright (C) 1992 Lucid, Inc. 4 Copyright (C) 1992 Lucid, Inc.
3 5
4 This file is part of the Lucid Widget Library. 6 This file is part of the Lucid Widget Library.
5 7
6 The Lucid Widget Library is free software; you can redistribute it and/or 8 The Lucid Widget Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as published by 9 modify it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 1, or (at your option) 10 the Free Software Foundation; either version 2, or (at your option)
9 any later version. 11 any later version.
10 12
11 The Lucid Widget Library is distributed in the hope that it will be useful, 13 The Lucid Widget Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
366 XtSetArg (al [ac], XmNlabelString, res_string); ac++; 368 XtSetArg (al [ac], XmNlabelString, res_string); ac++;
367 } 369 }
368 else 370 else
369 { 371 {
370 built_string = 372 built_string =
371 XmStringCreateLtoR (val->value, XmSTRING_DEFAULT_CHARSET); 373 XmStringCreateLocalized (val->value);
372 XtSetArg (al [ac], XmNlabelString, built_string); ac++; 374 XtSetArg (al [ac], XmNlabelString, built_string); ac++;
373 } 375 }
374 376
375 XtSetArg (al [ac], XmNlabelType, XmSTRING); ac++; 377 XtSetArg (al [ac], XmNlabelType, XmSTRING); ac++;
376 } 378 }
377 379
378 if (val->key) 380 if (val->key)
379 { 381 {
380 key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET); 382 key_string = XmStringCreateLocalized (val->key);
381 XtSetArg (al [ac], XmNacceleratorText, key_string); ac++; 383 XtSetArg (al [ac], XmNacceleratorText, key_string); ac++;
382 } 384 }
383 385
384 if (ac) 386 if (ac)
385 XtSetValues (widget, al, ac); 387 XtSetValues (widget, al, ac);
404 XtAddCallback (widget, XmNsingleSelectionCallback, xm_generic_callback, 406 XtAddCallback (widget, XmNsingleSelectionCallback, xm_generic_callback,
405 instance); 407 instance);
406 for (cur = val->contents, i = 0; cur; cur = cur->next) 408 for (cur = val->contents, i = 0; cur; cur = cur->next)
407 if (cur->value) 409 if (cur->value)
408 { 410 {
409 XmString xmstr = XmStringCreate (cur->value, XmSTRING_DEFAULT_CHARSET); 411 XmString xmstr = XmStringCreateLocalized (cur->value);
410 i += 1; 412 i += 1;
411 XmListAddItem (widget, xmstr, 0); 413 XmListAddItem (widget, xmstr, 0);
412 if (cur->selected) 414 if (cur->selected)
413 XmListSelectPos (widget, i, False); 415 XmListSelectPos (widget, i, False);
414 XmStringFree (xmstr); 416 XmStringFree (xmstr);