02-07-2018 04:50 AM
Hello all,
I have 2 observations about this: http://zone.ni.com/reference/en-XX/help/370051AC-01/cvi/uiref/cviprecedence_of_callback_functions/
First, how come the chained callbacks are not represented ? They should happen before anything, right ?
Second, how come the main callback isn't called for timer events ? Is there a reason for that ?
Solved! Go to Solution.
02-08-2018 08:24 AM
Hi gdargaud
I don't have a lot of insight into the callback order at a low level to answer this accurately at the moment, but I'd like to know from where are you getting the idea that the chained callbacks should happen before the other calls, is that from NI documentation or some other source? I may be able to look more into this with a bit more context.
Applications Engineer
National Instruments
02-08-2018 09:59 AM
It's the paradigm of the chained callbacks; see the documentation for ChainCtrlCallback:
This function adds a new callback function to a control. This function will be called first for every event the control receives. If this new callback function returns zero (0), then the control's original callback function, if any, will be called with the same event.
I'd be interested too in the answer to this question.
02-12-2018 09:01 AM
Hi All,
Looking into the information provided and consulting with our R&D colleagues it seems like this may be an error in our current documentation, we will be looking into this to see what corrections need to be made to properly describe the precedence of the callback functions.
02-28-2018 10:22 AM
Hello Roberto and Guillaume,
The help topic that you are referring to is part of the UI Library help. The callback chaining functions are part of the Programmer's Toolbox, which is an open-source add-on to the UI Library, but not really part of that library. More than likely, this is the reason why that topic doesn't mention callback chaining.
From the point of view of the UI Library, a chained callback is just a control callback like any other. You can see how chained callbacks are implemented by browsing toolbox.c.
But, yes, a chained callback does get called before the original control callback is called.