Re: Status von device abfragen [fehler]
- From: Mathieu Lacage <mathieu_lacage myrealbox com>
- To: Robert Schulze <magot666 web de>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Status von device abfragen [fehler]
- Date: Thu, 27 Nov 2003 13:38:18 +0100
hi robert,
On Thu, 2003-11-27 at 13:19, Robert Schulze wrote:
[snip]
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);
sleep(1);
}
}
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
--
Mathieu Lacage <mathieu gnu org>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]