/* The lwlib interface to Motif widgets.
- Copyright (C) 1994-1997, 1999-2011
- Free Software Foundation, Inc.
- Copyright (C) 1992 Lucid, Inc.
+
+Copyright (C) 1994-1997, 1999-2012 Free Software Foundation, Inc.
+Copyright (C) 1992 Lucid, Inc.
This file is part of the Lucid Widget Library.
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include <unistd.h>
#include <stdio.h>
#include <X11/CoreP.h>
#include <X11/CompositeP.h>
-#include "../src/lisp.h"
+#include <lisp.h>
#include "lwlib-Xm.h"
#include "lwlib-utils.h"
Boolean pop_up_p)
{
destroyed_instance* instance =
- (destroyed_instance*)malloc (sizeof (destroyed_instance));
+ (destroyed_instance*) xmalloc (sizeof (destroyed_instance));
instance->name = safe_strdup (name);
instance->type = safe_strdup (type);
instance->widget = widget;
static void
free_destroyed_instance (destroyed_instance* instance)
{
- free (instance->name);
- free (instance->type);
- free (instance);
+ xfree (instance->name);
+ xfree (instance->type);
+ xfree (instance);
}
\f/* motif utility functions */
int child_index;
widget_value* cur;
Widget button = 0;
- Widget title = 0;
Widget menu;
Arg al [256];
int ac;
/* Allocate the children array */
for (num_children = 0, cur = val; cur; num_children++, cur = cur->next)
;
- children = (Widget*)XtMalloc (num_children * sizeof (Widget));
+ children = (Widget*)(void*)XtMalloc (num_children * sizeof (Widget));
/* WIDGET should be a RowColumn. */
if (!XmIsRowColumn (widget))
{
ac = 0;
XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
- title = button = XmCreateLabel (widget, cur->name, al, ac);
+ button = XmCreateLabel (widget, cur->name, al, ac);
}
else if (lw_separator_p (cur->name, &separator, 1))
{
}
else if (class == xmTextWidgetClass)
{
- free (val->value);
+ xfree (val->value);
val->value = XmTextGetString (widget);
val->edited = True;
}
else if (class == xmTextFieldWidgetClass)
{
- free (val->value);
+ xfree (val->value);
val->value = XmTextFieldGetString (widget);
val->edited = True;
}
XtVaGetValues (toggle, XmNset, &set, NULL);
if (set)
{
- free (val->value);
+ xfree (val->value);
val->value = safe_strdup (XtName (toggle));
}
}
{
KeySym sym = 0;
Modifiers modif_ret;
-
+
XtTranslateKeycode (event->xkey.display, event->xkey.keycode, 0,
&modif_ret, &sym);
-
+
if (sym == osfXK_Cancel)
{
Widget w = *((Widget *) closure);
Widget row;
Widget icon;
Widget icon_separator;
- Widget message;
+ Widget message_label;
Widget value = 0;
Widget separator;
Widget button = 0;
XtSetArg(al[ac], XmNleftWidget, icon); ac++;
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
XtSetArg(al[ac], XmNrightOffset, 13); ac++;
- message = XmCreateLabel (form, "message", al, ac);
+ message_label = XmCreateLabel (form, "message", al, ac);
if (list)
XtManageChild (value);
{
children [i] = value; i++;
}
- children [i] = message; i++;
+ children [i] = message_label; i++;
children [i] = icon; i++;
children [i] = icon_separator; i++;
XtManageChildren (children, i);
{
XtVaSetValues (w, XtNallowShellResize, flag, NULL);
}
-