Re: Accuracy of motion events

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

 



On Sat, 2014-08-30 at 02:18 +0200, Stefan Salewski wrote:
> Sounds great, thanks. Can not test with Ruby currently, it is 3.12,
> which is not available yet for Ruby bindings.

Just for fun I have tested with GTK 3.12 for Nimrod, but I can not see
an effect of event compression... (It was necessary to put
set_event_compression() after window.show_all(), seem that Ruby bindings
ensure that a Gdk window is always available, while plain Nimrod
bindings needs realize before.)  I may try plain C tomorrow, or in
winter.

stefan@AMD64X2 ~/fups $ ./test 
34 299
81 297
130 297
181 297
232 297
281 299
328 299
375 299
422 299
467 302
510 304
549 304
588 307
623 309
660 311

import gtk3, gdk3, glib2, math

proc destroy(widget: pWidget, data: pgpointer) {.cdecl.} = main_quit()

proc process_event(widget: pWidget, event: TEventMotion, data:
pgpointer) {.cdecl.} =
  echo round(event.x), " ", round(event.y)

var window = window_new()
window.set_default_size(800, 800)

discard g_signal_connect(window, "destroy", G_CALLBACK(test.destroy),
nil)

discard g_signal_connect(window, "motion_notify_event",
G_CALLBACK(test.process_event), nil)

window.show_all

window.get_window.set_event_compression(gfalse)
window.get_window.set_events(TEventMask.POINTER_MOTION_MASK)

main()



_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://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