Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Maurizio

#1
The following program shows a frame with only 4 columns instead of 5.

Is this a bug ?

I'm trying with the last NewLisp version and java (jdk) 1.8.0_74.



Best regards.

Maurizio.


(set-locale "C")
(load (append (env "NEWLISPDIR") "/guiserver.lsp"))

(gs:init)

(gs:frame 'window 100 100 400 300 "my test")
(gs:set-grid-layout 'window 3 5)

(dolist (btn '("one" "two" "three" "four" "five" "six" "seven" "height" "nine" "ten"  "eleven"))
  (gs:button (sym btn) 'gs:no-action btn 75 25)
  (gs:add-to 'window (sym btn)))
   
(gs:set-visible 'window true)

(gs:listen)
#2
I'd like very very very much if newlisp were portable.

I mean :

it should not depends on any environment variable. (why newlispdir ?)

it should not have the need of a work directory (tmp directory in http mode)

or, if really needed, a subdir of the starting directory,

or, at least, a directory specified on the command line.

I'd like to have newlisp.exe and all my files in a directory (with subdirs) that i can

freely move aroud my disk, or zip and send to my friends, or copy in a stick and carry around.



Best regards.

Maurizio.
#3
newLISP Graphics & Sound /
October 31, 2007, 03:13:53 AM
I didn't understand why the (gs:listen) call was needed in the signale-erreur procedure.

After a little investigation I found what I think is a little problem :



if you completely comment the body of  signale-erreur, leaving only :

(define (signale-erreur)),

and then you enter an invalid value, the program complains,

showing in the log area of the developement environment the following message :

value expected in function log : v



This is what happens :

the signale-erreur returns, but the program is unable to cope with the

erroneous value, and when (set 'logv (int (log v 10)))  is called

it exit abnormally from the change-couleurs procedure and from the message loop.



The call (gs:listen) you put in signale-erreur make the program re-enter a message loop while it is still in the processing of a current call.

The signale-erreur is not actually terminated, but remains in a suspended state, so is the change-couleurs and the evalue-entree.



So there are now two gs:listen in progress.

if you now enter another error you get a third level of processing.

If you continue to enter errors eventually (after several hundredths of calls) the program should crash on stack overflow.

I suppose the cure is to remove the gs:listen from signale-erreur, to assemble the statements after the call to signale-erreur in a new procedure (e.g calc-and-show), to modify the change-couleurs as follows :



(define (change-couleurs id text)
   ; Displays the colors which correspond to the input values
   ;   -> getting and evaluating entries

   (set 'vlch  (base64-dec text))  
   (set 'v (float vlch))  
   (if (or (= v 0) (<v> v 1e+011))
      (signale-erreur)
      (calc-and-show v))


in this way, if signale-erreur is called, the calc-and-show it is not, and vice-versa.



Apart this little problem I found it is a nice program.

Regards

Maurizio





when

[/code]
#4
newLISP Graphics & Sound /
October 30, 2007, 04:43:18 AM
why it is needed the last line (gs:listen) of the procedure

signale-erreur ?



if I type a correct value the program flows out of

change-couleurs wihout calling gs:listen, and it continue to work.

Why it is needed in case of error ?



Regards



Maurizio
#5
newLISP Graphics & Sound /
September 24, 2007, 08:57:34 AM
(sorry for the delay)

sure, Javascript is enabled.

Maurizio
#6
newLISP Graphics & Sound /
September 20, 2007, 01:19:19 AM
Thank you very much.

Maurizio
#7
newLISP Graphics & Sound / Suggestion about form layouts
September 19, 2007, 07:19:53 AM
Would be fine to have a chapter about laying out forms, better if with some example. I find the topic a little difficult.

I'd like to build forms having a similar layout :





    Please enter your information:

   first name: XXXXXXXXXXXXXXX
    last name: XXXXXXXXXXXXXXX
          age: XXX
       
          OK   CANCEL  

Please note he following:

The labels should be right aligned, while the input fields left aligned.

The two buttons OK and Cancel should have equal size.

Resizing the form should mantain the alignment of the labels/fields

and they should be orizontally centered in the form.

The space betweeen the labels and the input field should grow as the form is enlarged, but it should have a minimun size.

The form should have a fixed empty vertical space both at the top and at the bottom, and a minimun space should exist between the last row and the buttons.

The other rows should be vertically proportionally spaced.

Any suggestion ?

Regards

Maurizio
#8
newLISP Graphics & Sound /
September 13, 2007, 02:19:35 AM
I don't know if it is a related problem, but I've just noticed the following :



I start the newlisp server, clicking on the desktop link,

then I open Ie 6.0 and I call the initial page :

http://127.0.0.1:8080">http://127.0.0.1:8080

The first page appears, but IE shows a warning icon on the status bar.

Double clicking on that icon shows an error box with the following text:



riga: 38

carattere: 1

Errore: 'parent.frames.1.document.forms.0.dir' è nullo o non è un oggetto

codice: 0

url: http://127.0.0.1:8080/file-frame.cgi">http://127.0.0.1:8080/file-frame.cgi



Regards

Maurizio
#9
newLISP in the real world /
September 11, 2007, 02:45:36 AM
Thank you very much

Maurizio
#10
I've installed newLisp Ide in c:programminewlisp

(that is, I have a directory c:programminewlispide containing

index.html, editor-frame.html, etc...



I made a desktop link to start the server as the following :

C:Programminewlispnewlisp.exe  -httpd -d 8080 -w C:Programminewlispide



I made a c:tmp directory.



If I start the server, I open a browser (IE 6.0) and then ask for:

http://127.0.0.1:8080">http://127.0.0.1:8080



the main editor page appears correctly.

from this page I can navigate using the left directory tree and I can inspect the distribuition files.



However, As I click on a button (even NEW):

the editor page does not change,

the browser shows on the status line:

Apertura pagina http://127.0.0.1:8080/content-frame.cgi">http://127.0.0.1:8080/content-frame.cgi,

it keeps running the upper right icon , but it is not really waiting.



If now I click on another file name, it is correctly displayed in the edit window.

If I manually clear the edit window and I enter a simple expression

like (println "hello") and I click on the eval button, the above behaviour

repeats exactly as described.



This happens only using IE 6.0.

Using Mozilla Firefox all works perfectly

Any suggestion ?



Regards

Maurizio
#11
newLISP in the real world / Problems with Dump ?
September 10, 2007, 02:31:45 AM
Just experimenting...

Seems that Dump interrupts dotimes evaluation



D:Temp>newlisp

newLISP v.9.2.0 on Win32, execute 'newlisp -h' for more info.



> (dotimes (x 5) (dump 'a))

(4150824 69 4145160 4145160 4177016)

>



Regards

Maurizio
#12
newLISP and the O.S. /
September 07, 2007, 08:32:49 AM
I too am unable to compile NewLisp under win 2k

this is what happens :

any suggestions ?

Regards

Maurizio





$ make mingw

make -f makefile_mingw

make[1]: Entering directory `/d/temp/newlisp-9.2.0'

/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 newlisp.c

/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 nl-symbol.c

/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 nl-math.c

/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 nl-list.c

/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 nl-liststr.c

/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 nl-string.c

/MinGW/bin/gcc -Wall -pedantic -Wno-long-long -c -O1 -g -DWIN_32 nl-filesys.c

nl-filesys.c:62: error: redefinition of `struct timezone'

nl-filesys.c:67: error: conflicting types for 'gettimeofday'

c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/time.h:40: error: previous declaration of 'gettimeofday' was here

nl-filesys.c:67: error: conflicting types for 'gettimeofday'

c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sys/time.h:40: error: previous declaration of 'gettimeofday' was here

nl-filesys.c: In function `mySleep':

nl-filesys.c:1824: warning: `_sleep' is deprecated (declared at c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:395)

make[1]: *** [nl-filesys.o] Error 1

make[1]: Leaving directory `/d/temp/newlisp-9.2.0'

make: *** [mingw] Error 2
#13
newLISP and the O.S. /
August 28, 2007, 12:27:15 AM
Thanks, this works,

but it would be better to have a system function that works

on all supported platforms, and upgrade all the examples

to work with such a function.



Regards.

Maurizio.
#14
newLISP and the O.S. /
August 27, 2007, 08:02:37 AM
it seems to return only "newlisp"



D:Temp>newlisp

newLISP v.9.2.0 on Win32, execute 'newlisp -h' for more info.



> (main-args)

("newlisp")

> (main-args 0)

"newlisp"



Regards

Maurizio
#15
newLISP and the O.S. / Installation/starting directory
August 27, 2007, 01:17:27 AM
Would be fine to have a NewLisp function to get the running executable directory of newlisp.exe.



The trick to query the environment variable PROGRAMFILES to get the installation directory, as shown in newlisp-edit.lsp, does not work if I install

(for example) on another disk.



Then it would be fine to update all the gs examples to use

such a new function.



Regards

Maurizio