Re: Status von device abfragen [fehler]

hi robert,

On Thu, 2003-11-27 at 13:19, Robert Schulze wrote:


void    bla(void)
        GdkWindow               *gwindow;
        GdkDevice               *device;
        GdkModifierType         state;
        memset(&state, '\0', sizeof(state));
        while(1)        {
                gdk_device_get_state(device, gwindow, NULL, &state);
                printf("mouse state: %d\n", state);

So, where is the gwindow variable initialized ??? the device variable is
not initialized either ??? 

clearly, you should write something like:

static void 
clicked_cb (GtkButton *button, gpointer data)
        GdkWindow *win;
        GdkDevice *dev;
        GdkModifierType state;

        g_assert (data == 0);

        win = GTK_WIDGET (button)->window;
        dev = gdk_device_get_core_pointer();

        /* do stuff. */


Mathieu Lacage <mathieu gnu org>

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