How does the call stack look like when mouse callback function is fired?

asked 2016-06-27 11:22:08 -0600

The situation here specifically is that if the mouse callback takes very long to finish, and the user keeps clicking and triggering the callback, will the old, unfinished function be preempted? Or will the old one keep executing and the new callback is placed on a separate thread (or some other way)?

Thanks!

edit retag flag offensive close merge delete

Comments

unfortunately, this depends on the combination of os/gui toolkit used

berak gravatar imageberak ( 2016-06-27 23:10:25 -0600 )edit

Thanks berak. Can you provide some examples? For example, what is it like on your os/toolkit configuration? I am using Ubuntu 14.04 and OpenCV 2.4.8. I don't know what you refer to as toolkit actually.

zkytony gravatar imagezkytony ( 2016-06-27 23:37:54 -0600 )edit

gtk, qt on linux (which one are you using ?)

berak gravatar imageberak ( 2016-06-27 23:43:35 -0600 )edit

What's the call stack of mouse callback like on your setting? I am not sure if I'm using gtk or not. I'm not using Qt if you mean QtCreator. I'm just using emacs for editing, no IDE.

zkytony gravatar imagezkytony ( 2016-06-27 23:46:59 -0600 )edit

well, you are for sure using something to show a window..

this box is on win, and it uses the win32 eventloop (which is not threaded, there's some other magic)

imho, you should not dig into your os, but just do "less" in your event handler. make it trigger some value, do the work in your main thread, and control it from there.

berak gravatar imageberak ( 2016-06-27 23:52:18 -0600 )edit