RE: problems changing cursor in scribble-simple.c



Alas it doesn't work. Here's the latest state of affairs:

/* Create the drawing area*/
 drawing_area = gtk_drawing_area_new ();
 gtk_drawing_area_size (GTK_DRAWING_AREA (drawing_area),Xlength,Ylength);
 gtk_container_add( GTK_CONTAINER(vbox), drawing_area );
 gtk_widget_show (drawing_area);


/*set new cursor*/
 gtk_widget_realize(drawing_area);
 new_cursor=gdk_cursor_new(GDK_CROSS);
 gdk_window_set_cursor(drawing_area->window, new_cursor);
 gdk_cursor_destroy (new_cursor); /*why do I need this anyway? */

This time I get the cursor all right, but can't plot! The error message
is:

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


Cevat Ustun. 



On Mon, 26 Feb 2001, Dugas, Alan wrote:

It sounds like the gdkwindow hasn't been realized yet.  Try inserting
gtk_widget_realize() before gdk_window_set_cursor().  Hope this helps.



                              -- Stupid Genius

----------
From:       Cevat Ustun[SMTP:ustun Glue umd edu]
Sent:       Monday, February 26, 2001 12:18 PM
To:         gtk-app-devel-list gnome org
Subject:    problems changing cursor in scribble-simple.c

In an attempt to change the cursor in scribble-simple.c, 
I added the following declaration

GdkCursor *cursor;

and the following lines after the drawing_area declaration:

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

but I get the error

Gdk-CRITICAL **: file gdkwindow.c: line 1274
(gdk_window_set_cursor): assertion `window != NULL' failed.

and the cursor is not changed. Why? 

Cevat



_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list







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