OK, now gtk_signal_emit_by_name() is confusing me!!!



Hi folks,

Now, I'm *REALLY* curious. First I have this bit of code, which breaks:

  gtk_signal_emit_by_name(GTK_OBJECT(w_layout[current].drawing_area),
"expose_event");

static void expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer
current_ptr)
{
  gint current=GPOINTER_TO_INT(current_ptr);
  gdk_draw_pixmap(widget->window,
widget->style->fg_gc[GTK_WIDGET_STATE(widget)],
                  w_layout[current].drawing_pixmap, 0, 0, 0, 0,
                  w_layout[current].width, w_layout[current].height);
}
  gtk_signal_connect(GTK_OBJECT(w_layout[current].drawing_area),
"expose_event", GTK_SIGNAL_FUNC(expose_event), GINT_TO_POINTER(current));

Which doesn't work at all, and gives me this:

Gtk-WARNING **: gtk_signal_collect_params(): invalid NULL pointer for return
argument type `gboolean'

.. and doesn't do the event.

I also have this:
static void clist_size(GtkWidget *clist, GtkAllocation *allocation, gpointer
current_ptr)
{
 // does stuff
}

gtk_signal_emit_by_name(GTK_OBJECT(wl->signal_lists), "size_allocate");

gtk_signal_connect(GTK_OBJECT(w_layout[i].signal_lists), "size_allocate",
GTK_SIGNAL_FUNC(clist_size), GINT_TO_POINTER(i));

Works without a problem!!!

Ideas?

Also, does anyone know why putting a clist into a scrolled window blocks the
size_allocate signal and neither the clist nor the window recieves it until
I resize the whole window?

Ta,

Rich





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]