2006-01-13, 15:42
hi,
i encountered a little problem when i have two controllists, where i let list2 be updated in the onaction() function depending on the active item in list1. i use getselectedposition() to determine the selected item in list1, and update list2 accordingly (naturally, this is only done if list1 actually has focus). however, it seems that in the onaction() function, list1 has not always been updated yet, resulting in an old return value of getselectedposition(). i worked around this by calling a little function in onaction() that starts a new thread, waits a bunch of milliseconds, and then calls getselectedposition() and updates list2. although that solves the problem, i still think this is strange behaviour for a gui callback. i mean, what's the point of a gui callback if the gui sometimes has been updated in the callback, while at other times it hasn't been?
i encountered a little problem when i have two controllists, where i let list2 be updated in the onaction() function depending on the active item in list1. i use getselectedposition() to determine the selected item in list1, and update list2 accordingly (naturally, this is only done if list1 actually has focus). however, it seems that in the onaction() function, list1 has not always been updated yet, resulting in an old return value of getselectedposition(). i worked around this by calling a little function in onaction() that starts a new thread, waits a bunch of milliseconds, and then calls getselectedposition() and updates list2. although that solves the problem, i still think this is strange behaviour for a gui callback. i mean, what's the point of a gui callback if the gui sometimes has been updated in the callback, while at other times it hasn't been?