g_signal_connect seems not to work on Alpha
- From: Rob Clack <rnc sanger ac uk>
- To: gtk-app-devel-list gnome org
- Subject: g_signal_connect seems not to work on Alpha
- Date: Fri, 17 Sep 2004 16:12:15 +0100
I have an application which seems to work fine on a Compaq deskpro
running Red Hat 9, but which is less fine on an HP Alpha running OSF1
(not sure which version).
Specifically I have a foocanvas (stripped down gnome canvas, courtesy of
Jodi Goldberg) on which I draw various canvas items which I then connect
to my callback function like this:
boundingBox =
foo_canvas_item_new(FOO_CANVAS_GROUP(params->columnGroup),
foo_canvas_rect_get_type(),
"x1", (double)0.0,
"y1", (double)5.0,
"x2", (double)params->thisType->width,
"y2", (double)params->height,
"fill_color", "white",
NULL);
g_signal_connect(G_OBJECT(boundingBox), "event",
G_CALLBACK(handleCanvasEvent), params) ;
On the deskpro/Linux box, this works fine, but on the Alpha/OSF1 the
event handler never gets called when I click on the canvas item.
I don't see anything in the archives that seems relevant to this, so I
hope someone has seen this before and can point me in the right direction.
And if someone can point me at some documentation listing the events a
canvas item responds to, that would be really handy, too. Just having
"event" is painful when debugging, but I can't find anything to tell me
what else I can use.
Thanks
Rob Clack
The event handler function is here:
static gboolean handleCanvasEvent(GtkWidget *widget, GdkEventButton
*event, gpointer data)
{
ParamStruct *params = (ParamStruct*)data;
ZMapFeatureContext feature_context;
ZMapFeatureSet feature_set;
ZMapFeature feature;
const gchar *itemDataKey = "feature";
FeatureKeys featureKeys;
gboolean result = FALSE; // if not a BUTTON_PRESS, leave for any
other event handlers.
if (event->type == GDK_BUTTON_PRESS) // GDK_BUTTON_PRESS is 4
{
featureKeys = g_object_get_data(G_OBJECT(widget), itemDataKey);
if (featureKeys && featureKeys->feature_key)
{
feature_set =
g_datalist_id_get_data(&(params->feature_context->feature_sets),
featureKeys->context_key);
feature = g_datalist_id_get_data(&(feature_set->features),
featureKeys->feature_key);
featureClickCB(params, feature);
result = TRUE;
}
if (event->button == 3)
{
itemDataKey = "feature_set";
featureKeys = g_object_get_data(G_OBJECT(widget), itemDataKey);
if (featureKeys)
{
feature_set =
g_datalist_id_get_data(&(params->feature_context->feature_sets),
featureKeys->context_key);
params->feature = feature;
columnClickCB(params, feature_set);
result = TRUE;
}
}
}
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]