How do I determine the current tab selected on a panel when it is (re)activated?
Sun, 01/20/2019 - 04:01 pm
I am trying to do something akin to this ...
// panel frame
NewPanel/W=(0,0,100,100)/N=MyPanel as "My Panel"
SetWindow MyPanel hook(mPH)=myPanelHook
// set up four different tabs
// use a TabProcedure to control them
Function myPanelHook(ipH) // WindowHookFunction
STRUCT WMWinHookStruct &ipH
variable hookResult = 0, tn
tn = V_value
// --> set debugger at this point
print "active at tab", tn
What this _should_ do is to print the currently active tab when the panel window is re-activated. It does not. In the debugger, at the point marked // --> set debugger at this point, I see v_flag = 0 (it should be 3), and v_value = 0 regardless of tab selected (it should be 0 - 3 depending on the tab selected).
I have a TabProcedure that runs when the tab is switched. The TabProcedure prints the tab number properly when the tab is switched while the panel is active. For example ...
initializing tab 2
So, tab 2 is initialized, I move off to a different window (the Browser), move back to the Panel, and get
active at tab 0
??? What am I missing here ???
Do I have to pay attention within the hook function to something else to have the ControlInfo call work properly?
Igor 7.09B01 on macOS 10.13.6