; called by fdmg_widget
 ;========================================================
 $fdmgwidget = xmtoplevel_form(0,0,'MDI Full-Disk Magnetograms',5,5,5,5)
 ; dismiss and help buttons
 wq = topbuttonsetupsanslink_tl('$fdmg')
 ;add another button to the board wq
 bq=xmbutton(wq,'selection tool','fdmg_selectortool', $f4,'gray')
 xmposition, bq, 00, 36, 0, 30
 ; list per month
 $fdmg_base = getenv('ANA_MDI_FDMG')
 dirs = sort(getdirects($fdmg_base, 5000))
 nd = num_elem(dirs)
 l = xmlabel($fdmgwidget,'MDI Full-Disk\nMagnetograms\nby month',$f5)
 list = xmlist($fdmgwidget,'fdmg_list_entry_cb',10,$f8,'white',1)
 xmposition,xtparent(list),0,0,150,100
 sep = xmseparator($fdmgwidget,0,10,0)
 xmposition,sep,0,0,10,10
 formvstack,wq,sep,l,xtparent(list)
 xmattach,xtparent(list),0,1,1,0,1
 $fdmgwidget = list    ; use for global
 xtpopdown,list
 xmlistdeleteall,list
 zeroifundefined, $fdcontFlag
 for i = 0, nd - 1 {
   h = dirs(i)
   ;only use directories that start with 'm' or 'c'
   if $fdcontFlag then {
   	if h(0) eq 'c' then xmlistadditem,list,h(1:6)
   } else {
     if h(0) eq 'm' then xmlistadditem,list,h(1:6)
   }
 }
 add_to_hideables,$fdmgwidget
