It seems like the new "focus" and "focuslost" events
have limited scope. In particular they work 
 - when the focus shifts with the keyboard
 - when other control get focus with a mouse

and do not react
 - on mouse clicking to get focus
 - or when focus is set programmatically (wd 'setfocus ...')


NB. =========================================================
F=: 0 : 0
pc f;
xywh 6 6 50 50;cc g isigraph;
xywh 64 7 34 11;cc ok button;cn "OK";
pas 6 6;pcenter;
rem form end;
)

f_run=: 3 : 0
  wd F
  FOC=: 0
  wd 'pshow;'
)

f_close=: 3 : 0
  wd'pclose'
)

f_g_focus=: 3 : 0
  FOC=: 1
  f_g_paint''
)

f_g_focuslost=: 3 : 0
  FOC=: 0
  f_g_paint''
)

f_g_paint=: 3 : 0
  glclear''
  gltextxy 10 10
  gltext 'Focus ',":FOC
  glpaint ''
)

f_run''

f_g_mbldown=: 3 : 0
  smoutput 'setting focus'
  wd 'setfocus g'  NB. change to "ok" to see how
                   NB. it does receive focuslost
)


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to