RE: A problem about changing the cursor when the system is busy

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

 



From: gtk-list-bounces@xxxxxxxxx [mailto:gtk-list-bounces@xxxxxxxxx] On Behalf Of ???
Sent: Friday, December 12, 2008 5:54 AM

Dear  gnome.

           I  want to use the different kind of the cursor when the system is busy.then the users will   know  what happen to the program.But my program can not do that.I can  not see what is wrong about my program.I  email  three files to you. Could you check them for me?Then  tell me what is wrong and what to do.thank you.

                                                                                                                                                                       Gordon

 

Hi Gordon,

 

It looks like your files got stripped off, but below is an example of a mouse-over event handler function that changes the cursor to a “help” cursor or mousing-over a clickable help icon which may give you what you want:

                    

 static gboolean itemHelpMouseHandler(GtkWidget *eventBox, GdkEventCrossing *event,

                                     gpointer data)

{

    GdkWindow *win = gtk_widget_get_parent_window(eventBox);

    GdkCursor *cursor;

 

    if (event->type == GDK_ENTER_NOTIFY)

    {

        cursor = gdk_cursor_new(GDK_QUESTION_ARROW);

        gdk_window_set_cursor(win, cursor);

        gdk_cursor_destroy(cursor);

    }

    else

    {

        cursor = gdk_cursor_new(GDK_LEFT_PTR);

        gdk_window_set_cursor(win, cursor);

    }

 

    /* Returning TRUE means we handled the event, so the signal emission should

     * be stopped (don't call any further callbacks that may be connected). */

    return TRUE;

}

 

Hmmm - I notice that I seem to be missing a gdk_cursor_destroy() call in the mouse-out case L

 

Ian

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux