Hello,

While testing Jess during my "initiation", I have
noticed what might be a bug.

When I tried the example (below) given in the user
manual
(http://herzberg.ca.sandia.gov/jess/README.html),
it worked fine under Windows NT, but with Linux
(RedHat 5.1), I got the window but not the button.

Does anyone know why?

Regards,

T. LEBARBE

-----------------------------------------------

Here's a complete program in Jess:

  (defglobal ?*f* = (new java.awt.Frame "Button
Demo"))
  (defglobal ?*b* = (new java.awt.Button "Hello"))


  (deffunction say-hello (?evt)
    (printout t "Hello, World!" crlf))

  (?*b* addActionListener
    (new jess.reflect.ActionListener say-hello
(engine)))

  (?*f* add ?*b*)
  (?*f* pack)
  (set ?*f* visible TRUE)

The Jess engine function returns the jess.Rete
object in which it is executed, as an external
address. You'll have to quit using ^C. To fix
this, you can add a
WindowListener which handles WINDOW_CLOSING events
to the above program:

  (deffunction frame-handler (?evt)
    (if (= (?evt getID) (get-member ?evt
WINDOW_CLOSING)) then
        (call (get ?evt source) dispose)
        (exit)))

  (?*f* addWindowListener
    (new jess.reflect.WindowListener frame-handler
(engine)))

Now when you close the window Jess will exit.
Notice how we can examine the ?evt parameter for
event information.


--
---------------- Thomas LEBARBE -----------------

Departement Informatique
Universite de Caen, Campus II
Tel: 02-31-56-73-77
Email: [EMAIL PROTECTED]

------ Traitement Automatique des Langues -------
Courteline : Si on devait tol�rer des autres ce que l'on se permet � soi-m�me, cela 
deviendrait invivable !



---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to