[NTG-context] How to display JavaScript's values in ConTeXt

Zhichu Chen zhichu.chen at gmail.com
Tue Sep 5 06:56:24 CEST 2006

Hello everybody,

    I want to add a clock which shows the system time to a pdf file.
And I have read the ``art-calc.pdf'' and ``mwidget-p.pdf'' to find
some approaches but failed shamely. I am indeed new at ConTeXt and
JavaScript. Before I'm shocked by ConTeXt, I used LaTeX for about 2
years, so I'm confused with the conventions between ConTeXt and LaTeX.
My code is here:


\startJSpreamble functions used now
  function do_digit(d)
    { Stack[Level] += String(d);
      do_refresh(Level) }




\setupbuttons [background=infobutton]


Click \button{7}[JS(digit{7})] will get


I only copied these codes from "art-calc.pdf" so there must be some
other critical concepts that I haven't realized. Please point them to
me. Thanks

More information about the ntg-context mailing list