RE: problems changing cursor in scribble-simple.c



Gtk-CRITICAL **: file gtkwidget.c: line 3820
(gtk_widget_set_events): assertion `!GTK_WIDGET_REALIZED (widget)' failed.

If you are just working on scribble-simple.c, I suggest you to change the
cursor inside the configure_event func, which is called precisely AFTER the
widget was realized.

So, just add to the configure_event func which looks then like:

static gint
configure_event (GtkWidget *widget, GdkEventConfigure *event)
{
  GdkCursor *newcursor;

  new_cursor=gdk_cursor_new(GDK_CROSS);
  gdk_window_set_cursor(widget->window, new_cursor);

  if (pixmap)
    gdk_pixmap_unref(pixmap);

.../...
}

ciao

Hugues





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