Yes, actually, b/c I had already copied over lab lines from jijx.ijs, all I had to add was the first HBS line. What I am struggling with is labs are triggered by a menu in jijx, and will be triggered by a button in jijxipad.
On Fri, Dec 9, 2011 at 3:02 PM, Eric Iverson <[email protected]> wrote: > The following assumes you have used jijx to open a lab. To add an advance > button to jijxipad you need to do something like. > > add following line in HBS=: section to create the button > 'advance'jhb'adv' > > add following J def to handle the button event in J > ev_advance_click=: 3 : 'labnext_jlab_ 0' > > towards the end in the javascript definition add the js handler > function ev_advance_click(){jdoajax([],"");} > > > > > > On Fri, Dec 9, 2011 at 9:55 AM, Brian Schott <[email protected]> wrote: > >> Eric, >> >> I have successfully only added the button "L" in jijxipad (in line 24 >> in the diff). When I click that new button, all that apparently >> happens is the line "</div>". Other than that I have mostly just >> copied from jijx into jijxipad definitions which relate to labs, >> including the verb "labopen". Can you look at the diff below and >> suggest how I can proceed, please? >> >> [9:42am brian~]% diff /Users/brian/j701/addons/ide/jhs/jijxipad.ijs >> /Users/brian/j701/addons/ide/jhs/jijxipad.ijs.orig >> 24d23 >> < 'labs' jhb ' L ' >> 28,88d26 >> < ev_labs_click=: 3 : 0 >> < 'labsdlg' jhdivadlg'' >> < 'labrun' jhb'run' >> < labsel'' >> < 'labsclose'jhb'X' >> < '</div>' >> < ) >> < >> < labopen=: 3 : 0 >> < require__'~addons/labs/labs/lab.ijs' >> < smselout_jijs_=: smfocus_jijs_=: [ NB.! allow introcourse to run >> < labinit_jlab_ y{LABFILES >> < ) >> < >> < getlabs=: 3 : 0 >> < LABTITLES=: LABCATS=: LABFILES=: '' >> < d=. dirpath t=. jpath'~addons/labs/labs' >> < try. >> < for_p. d do. >> < for_q. 1 dir '/*.ijt',~>p do. >> < LABFILES=: LABFILES,q >> < cat=. (>:#t)}.>q >> < cat=. (cat i.'/'){.cat >> < LABCATS=: LABCATS,<cat >> < title=. toJ fread q >> < title=. (title i.LF){.title >> < title=. (>:title i.'''')}.title >> < title=. (title i:''''){.title >> < LABTITLES=: LABTITLES,<cat,': ',title >> < end. >> < end. >> < catch. >> < end. >> < s=. /:LABTITLES >> < LABFILES=: s{LABFILES >> < LABCATS=: s{LABCATS >> < LABTITLES=: s{LABTITLES >> < ) >> < >> < labsel=: 3 : 0 >> < getlabs'' >> < >(0~:#LABTITLES){'';'labsel'jhselect LABTITLES;1;0 >> < ) >> < >> < labopen=: 3 : 0 >> < require__'~addons/labs/labs/lab.ijs' >> < smselout_jijs_=: smfocus_jijs_=: [ NB.! allow introcourse to run >> < labinit_jlab_ y{LABFILES >> < ) >> < >> < ev_lab_click=: 3 : 'smoutput labmsg' NB. no labs to select >> < >> < ev_dot_ctrl =: ev_advance_click >> < ev_advance_click=: 3 : 0 >> < if. (<'jlab')e.conl 0 do. labnext_jlab_'' else. smoutput 'No lab >> open. Do studio|labs...' end. >> < ) >> < >> < ev_labrun_click=: 3 : 0 >> < labopen ".getv'jsid' >> < ) >> < >> 228,246d165 >> < function ev_advance_click(){jdoajax([]);} >> < >> < function ev_lab_click() >> < { >> < if(null==jbyid("labsel")) >> < jdoajax([],""); >> < else >> < jdlgshow("labsdlg","labsel"); >> < } >> < >> < function ev_labsclose_click(){jhide("labsdlg");ev_2_shortcut();} >> < >> < function ev_labrun_click() >> < { >> < jhide("labsdlg"); >> < jform.jsid.value= jbyid("labsel").selectedIndex; >> < jdoajax([],""); >> < } >> < >> [9:43am brian~]% >> >> On Wed, Dec 7, 2011 at 11:08 AM, Eric Iverson <[email protected]> >> wrote: >> > For ipad labs I'd be inclined for now to forgo the gui complications. >> > Provide a verb that list all the labs in the jijx window with numbers. >> The >> > a labopen verb that opens a lab by number. I'd leave the advance button >> on >> > the screen all the time. >> > >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- (B=) <-----my sig Brian Schott ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
