if (wv->name) free (wv->name);
if (wv->value) free (wv->value);
if (wv->key) free (wv->key);
+ if (wv->help) free (wv->help);
- wv->name = wv->value = wv->key = (char *) 0xDEADBEEF;
+ wv->name = wv->value = wv->key = wv->help = (char *) 0xDEADBEEF;
if (wv->toolkit_data && wv->free_toolkit_data)
{
copy->name = safe_strdup (val->name);
copy->value = safe_strdup (val->value);
copy->key = safe_strdup (val->key);
+ copy->help = safe_strdup (val->help);
copy->enabled = val->enabled;
copy->button_type = val->button_type;
copy->selected = val->selected;
}
static widget_info *
-allocate_widget_info (type, name, id, val, pre_activate_cb, selection_cb, post_activate_cb)
+allocate_widget_info (type, name, id, val, pre_activate_cb,
+ selection_cb, post_activate_cb, highlight_cb)
char* type;
char* name;
LWLIB_ID id;
lw_callback pre_activate_cb;
lw_callback selection_cb;
lw_callback post_activate_cb;
+ lw_callback highlight_cb;
{
widget_info* info = (widget_info*)malloc (sizeof (widget_info));
info->type = safe_strdup (type);
info->pre_activate_cb = pre_activate_cb;
info->selection_cb = selection_cb;
info->post_activate_cb = post_activate_cb;
+ info->highlight_cb = highlight_cb;
info->instances = NULL;
info->next = all_widget_info;
{
widget_instance* instance =
(widget_instance*)malloc (sizeof (widget_instance));
+ bzero (instance, sizeof *instance);
instance->parent = parent;
instance->pop_up_p = pop_up_p;
instance->info = info;
return (widget_instance *) 0;
}
+/* Value is a pointer to the widget_instance corresponding to
+ WIDGET, or null if WIDGET is not a lwlib widget. */
+
+widget_instance *
+lw_get_widget_instance (widget)
+ Widget widget;
+{
+ return get_widget_instance (widget, False);
+}
+
static widget_instance*
find_instance (id, parent, pop_up_p)
LWLIB_ID id;
safe_free_str (val1->key);
val1->key = safe_strdup (val2->key);
}
+ if (safe_strcmp (val1->help, val2->help))
+ {
+ EXPLAIN (val1->name, change, VISIBLE_CHANGE, "help change",
+ val1->help, val2->help);
+ change = max (change, VISIBLE_CHANGE);
+ safe_free_str (val1->help);
+ val1->key = safe_strdup (val2->help);
+ }
if (val1->enabled != val2->enabled)
{
EXPLAIN (val1->name, change, VISIBLE_CHANGE, "enablement change",
}
void
-lw_register_widget (type, name, id, val, pre_activate_cb, selection_cb, post_activate_cb)
+lw_register_widget (type, name, id, val, pre_activate_cb,
+ selection_cb, post_activate_cb, highlight_cb)
char* type;
char* name;
LWLIB_ID id;
lw_callback pre_activate_cb;
lw_callback selection_cb;
lw_callback post_activate_cb;
+ lw_callback highlight_cb;
{
if (!get_widget_info (id, False))
allocate_widget_info (type, name, id, val, pre_activate_cb, selection_cb,
- post_activate_cb);
+ post_activate_cb, highlight_cb);
}
Widget
}
Widget
-lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb, selection_cb, post_activate_cb)
+lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb,
+ selection_cb, post_activate_cb, highlight_cb)
char* type;
char* name;
LWLIB_ID id;
lw_callback pre_activate_cb;
lw_callback selection_cb;
lw_callback post_activate_cb;
+ lw_callback highlight_cb;
{
lw_register_widget (type, name, id, val, pre_activate_cb, selection_cb,
- post_activate_cb);
+ post_activate_cb, highlight_cb);
return lw_make_widget (id, parent, pop_up_p);
}