Reset a popup menu list
J-E Petit
In a panel, I have 2 popup menu controls to do seasonal filtering of a wave. See image attached.
The "Season" list is predefined ({"all";"DJF";"MAM";"JJA";"SON"}), and is related to a global string (Season2Use). The "Date Wave" lists the wave present in a data folder and is also related to a global string (DateWave2Use), with a default value "select" (
PopupMenu NWRDateWave2Use_list, fSize=14, pos={162,257}, size={100,20}, value = "select;" + Input_Concwaveselection(), title="Date Wave", proc = NWRDateWave2Use_proc, disable = 0, win=ZeFir
, where Input_concwaveselection() function returns the list of waves in the specific folder)Also, when Season2Use="all", DateWave2Use is automatically set to "select".
So let's say I choose "MAM" as the season to use, and "utctime" as the date wave; everything is fine. But then, if I go back to Season2use="all", the actual value of DateWave2Use is "select", but the popup menu still displays "utctime" !! And a DoUpdate doesn't solve this.
Any ideas?
Thanks!
J-E
ControlUpdate is a little bit like a DoUpdate but for controls instead of windows.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
April 27, 2015 at 08:35 am - Permalink
PopupMenu NWRDateWave2Use_list, popmatch="select" , win=ZeFir<\igor>
April 27, 2015 at 10:13 pm - Permalink
I indeed changed the "season" function, so that it controls the display of the "date wave" popup menu, using the KillControl function. Not exactly what I expected at first, but it works very well!
I'm fairly new to panels and controls, and i'm discovering everyday new functions that are very useful! :)
J-E
April 28, 2015 at 02:26 pm - Permalink
disable=1
parameter if you want to let the popup disappear (saves code for recreating the whole thing).April 29, 2015 at 06:21 pm - Permalink