If you expect errors than you should also write a proper error handler,
e.g. wrapping the codes inside event with try catch control structure and
stop timer inside the catch block.  you can remove try/catch when you have
full confidence with your code.

On 14 Feb, 2017 1:37 am, "Louis de Forcrand" <[email protected]> wrote:

Thanks for your replies.

I looked at the pendulum example, and at first thought that isigraph is
better, but it doesn't support window size changes, and so settled with
isidraw. In addition it seems that ptimer is easier to use locale-wise than
sys_timer.

One thing that was annoying was that if an error ever occured in the verb
called by the timer, I had to restart J (with the task manager) as I
couldn't change the focus off of the error pop-up window. JBRK didn't work
either. Do you know if there is any way to stop the timer without having
access to the JQT session?

Thanks,
Louis

PS: I noticed that there's no automatic shortcut creation for JBRK. I
suggest that it be added in the "shortcut" verb in installer.ijs, or that
it be mentioned on the wiki installation page for newcomers.

> On 09 Feb 2017, at 01:02, bill lam <[email protected]> wrote:
>
> that depends on using isigraph or isidraw. isidraw is backup by bitmap so
> that you need to erase the previous scene. isigraph (in j8) is different,
> since it is not double buffered, it loses previous content in each paint
> event, so you need not erase the previous ball.
>
> opengl also works for 2d.
>
>
>
> On 9 Feb, 2017 12:42 am, "Louis de Forcrand" <[email protected]> wrote:
>
> Hi everyone,
>
> I've been looking into the Qt facilities available in J recently, and I
> read that 2D graphics are best done with gl2.
>
> I hacked together a simple program that displays a ball which bounces
> around the isidraw container. Having never really done any
graphics-related
> programming, I used the window driver's timer function to call sys_timer
at
> regular intervals, which erases the previous circle, draws the new one,
and
> updates speed and position global vars.
> The advantage of using the wd timer is that I can create a button which
> calls "wd 'timer 0; pclose'" in order to exit the program in a clean
> fashion without having to break.
>
> I suspect there is a better way to do this; how would the seasoned J
> programmers on this forum go about creating such an animation?
>
> All help appreciated!
> Louis
>
> PS: I hardly have any web-related (html, css, php, etc.) programming
> skills, but any info about doing this in JHS is welcome as well.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to