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

Topics - HPW

#41
From my newLISP loading on WIN/SketchUp 7 here:



http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2710">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2710



There comes the next question:



Sketchup runs also on the MAC.

So it is possible to load the newLISP modul under ruby?
#42
I tried to load newLISP.dll on Google SketchUp 7 in the Ruby console.



I do:

I copy "Win32API.so" and the newLISP.dll to the Sketchup Plugins folder

(The library can be found in ruby distribution: rubylibruby1.8i386-mswin32Win32API.so)



In the ruby console in SketchUp:



require 'Win32API'
true
newLISP = Win32API.new("newlisp.dll", "newlispEvalStr", ['P'], 'V')
Error: #<RuntimeError: (eval):131:in `initialize': LoadLibrary: newlisp.dll
>
(eval):131


Some doku here:

http://phrogz.net/ProgrammingRuby/lib_windows.html#Win32API">http://phrogz.net/ProgrammingRuby/lib_w ... l#Win32API">http://phrogz.net/ProgrammingRuby/lib_windows.html#Win32API

See: class Win32API < Object



This is a working code example:



findWindow = Win32API.new("user32.dll", "FindWindow", ['P','P'], 'N')
window_id = findWindow.call(0, sketchup_title)
sendMessage = Win32API.new("user32.dll", "SendMessage", ['N','N','N','P'], 'N')
sendMessage.call(window_id, 0x0010, 0, "")


Not sure if I make a mistake with the calling parameters or what else cause the error.
#43
newLISP newS / net-read-line ??
November 03, 2008, 12:30:27 AM
I ran into problem with the tk-macro:
(define-macro (tk , _result)
(set '_result (append (apply string (map eval (args))) ";##EOT##"))
(net-send SYS:tk-sock '_result)
;; on Unix's we could just use 'read-line', but doesn't work on sockets in win32
(while (starts-with (net-read-line SYS:tk-sock '_result) "VOID-TK:"))
(if (starts-with _result "ERR-TK:") (reset) _result))


It seems that net-read-line is the problem.
Quote
> setq

setq <408002>

> net-read-line

nil


Seems not to be defined.

But in the list of (symbols) it appears.

Also in the doc it is not documented.

But in the V10 release doc it is not abandoned.



??
#44
newLISP Graphics & Sound / javaw.exe + 2 x newlisp.exe?
October 21, 2008, 02:48:51 AM
I noticed when I run the newLISP-GS editor that I get 3 processes.



1 x javaw.exe + 2 x newlisp.exe



Why are there 2 newlisp.exe? Did I miss something?
#45
newLISP newS / read-key help additon
October 06, 2008, 05:35:49 AM
Maybe it would be usefull to add to:
QuoteNote that read-key will not work from the newLISP-GS front-end or any other application running newLISP over a TCP/IP port connection.

Like this:
QuoteNote that read-key will not work from the newLISP-GS front-end or any other application running newLISP over a TCP/IP port connection.

Also the use of this command (like all other console-input-commands) in the DLL-version makes no sense.
#46
I ran across this interesting project:



Repl:

http://www.solve-et-coagula.com/As3Lisp.html">http://www.solve-et-coagula.com/As3Lisp.html



Story:

http://www.solve-et-coagula.com/?p=8">http://www.solve-et-coagula.com/?p=8



Not a newLISP but very interesting!



And there is also a sheme REPL:

http://www.solve-et-coagula.com/Ouija/REPL.html">http://www.solve-et-coagula.com/Ouija/REPL.html
#47
newLISP newS / TclTk 8.5 with newlisp-tk.tcl 1.39
December 23, 2007, 05:46:12 AM
To answer my question from here:



http://www.alh.net/newlisp/phpbb/viewtopic.php?t=634">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=634



I did a uninstall of my TCL 8.4.X installation.



After a fresh install of current activestate 8.5 newlisp-tk.tcl does not work because of the missing bwidget lib.

I downloaded the latest bwidget 1.8 zip and installed it to C:Tcllib.



Then newlisp-tk.tcl 1.39 (last from 9.1.5) does work again.



The only visual difference is the new TCL icon:



http://hpwsoft.de/anmeldung/html1/newLISP/tcl85.png">
#48
Since 9.2.1 we have (env "NEWLISPDIR").

But this is only a valid variable in the running newlisp-process.



So it would be usefull to let the newlisp installer set a system-wide user enviroment variable,

so other applikation could know where newlisp is stored.



On my german WIN it would be:



NEWLISPDIR = C:Programmenewlisp



The installer defaults to this path, but what happens when the user put it elsewhere?



Other systems does similar, so I have a Tcl_DLL and a Tk_DLL in HKEY_CURRENT_USEREnvironment.
#49
I am trying to use set-locale with german umlauts and decimal point.



Is it possible to set newLISP up this way with set-locale.



From locale.h from MINGW:
Quote
#define   LC_ALL      0

#define LC_COLLATE   1

#define LC_CTYPE   2

#define   LC_MONETARY   3

#define   LC_NUMERIC   4

#define   LC_TIME      5
#50
This works from the doc:

> (set 'aList '((a 1 2 3)(b 4 5 6)(c 7 8 9)))
((a 1 2 3) (b 4 5 6) (c 7 8 9))
> (replace-assoc 'b aList '(q "I am the replacement"))
((a 1 2 3) (q "I am the replacement") (c 7 8 9))
> aList
((a 1 2 3) (q "I am the replacement") (c 7 8 9))

This do not work (as I hoped)

newLISP v.9.2.0 on Win32.

> (set 'aList '(((a 1 2 3)(b 4 5 6)(c 7 8 9))))
(((a 1 2 3) (b 4 5 6) (c 7 8 9)))
> (replace-assoc 'b (aList 0) '(q "I am the replacement"))
((a 1 2 3) (q "I am the replacement") (c 7 8 9))
> aList
(((a 1 2 3) (b 4 5 6) (c 7 8 9)))
>

It seems not to be destructive on the nested list.

So whats the best way?
#51
newLISP and the O.S. / newLISP doc starter tool
August 17, 2007, 09:08:51 AM
I made a tiny windows-tool called 'nlIEStarter' to launch the newLISP doc from external editors like UltraEdit.



http://hpwsoft.de/anmeldung/html1/newLISP/newLISP.html">http://hpwsoft.de/anmeldung/html1/newLISP/newLISP.html



Sample call:

nlIEstarter "C:Programmenewlispnewlisp_manual.html#setq" "C:Programmenewlispmanual_frame.html"


The first parameter is the doc-file with the jump-taget.

The second parameter is the doc-file with the frame-support.

When the first file does not have a jump-target or an empty one, the second file will be used.

The tool has a IE detection so that different technics are used to launch the jump-target call.

For IE7 an internetlink in the Temp-Dir is created.

The replacement of the '?' to 'p' for commands like 'symbol?' is supported.



Ultraedit's tool config line looks like this:

"C:hpwtoolsnlIEstarter.EXE" "C:Programmenewlispnewlisp_manual.html#%sel%" "C:Programmenewlispmanual_frame.html"

(The call is on one line)
#52
Playing around with implicit indexing I tried this:



(length (someList 0 0))


Since everything gets shorter in newlisp lately, how about:



(length someList 0 0)


Just an idea, I can live with the first form.

;-)
#53
newLISP Graphics & Sound / GUI server about window
July 23, 2007, 10:33:38 PM
Can the GUI server about window also report the newlisp and java version number?
#54
The 'save settings' code for pos and size seems to save the pos and size of the client area of the editor and not the complete window.



When I setup up a good placing manually I get


Quote
(set 'currentAppHeight 834)



(set 'currentAppWidth 1152)



(set 'currentAppX 0)



(set 'currentAppY 0)


When I then do 'save settings' I get:


Quote
(set 'currentAppHeight 786)



(set 'currentAppWidth 1144)



(set 'currentAppX 4)



(set 'currentAppY 44)
#55
newLISP Graphics & Sound / Drag logic on circles
July 12, 2007, 11:56:35 PM
Playing with the drag-demo, I noticed that a circle can get grapped outside the circle in the surrounding rectangle.

This is also true for each circle of the grouped shape.
#56
newLISP Graphics & Sound / GUI server java sources?
July 11, 2007, 11:47:47 PM
Do I remember it right, that the java-sources of the GUI-Server will be published with the final release of 1.0 ?
#57
The last screenshot of the MAC version shows the toolbar pretty nice:



http://newlisp.org/downloads/development/newlisp-edit.png">http://newlisp.org/downloads/developmen ... p-edit.png">http://newlisp.org/downloads/development/newlisp-edit.png



But on my WinXP it shows a different color than the buttons:



http://www.hpwsoft.de/anmeldung/html1/newLISP/newlisp_edit.png">http://www.hpwsoft.de/anmeldung/html1/n ... p_edit.png">http://www.hpwsoft.de/anmeldung/html1/newLISP/newlisp_edit.png
#58
It would be nice to have a Multiplatform hidden splash-loader.

(For the newLISP supported platforms)

This would inform the user about the ongoing load-process (of the java-RE) so he does not think that it hang etc.



Similar to Pjot's run wrapper or the solution from the code snippets.


Quote
MySplashRun.exe


MySplashRun.ini
Quote
Start=Pathname/newLISP.exe MyNewLISP.lsp

Splash=Pathname/MySplashBitmap.png

TimeToShow=5


When started it should show first the bitmap in a borderless, centered window and launch newlisp without concole window. After timeout it should exit.
#59
Without text the selected flag would not work.



Instead of:

(define (radio-button id action text selected)
(if text
(net-send out (string "radio-button " id " " action " " (base64-enc text) " " selected "n"))
(net-send out (string "radio-button " id " " action "n")))
)

(define (check-box id action text selected)
(if text
(net-send out (string "check-box " id " " action " " (base64-enc text) " " selected "n"))
(net-send out (string "check-box " id " " action "n")))
)

it should read:

(define (radio-button id action text selected)
(if text
(net-send out (string "radio-button " id " " action " " (base64-enc text) " " selected "n"))
(net-send out (string "radio-button " id " " action " nil " selected "n")))
)

(define (check-box id action text selected)
(if text
(net-send out (string "check-box " id " " action " " (base64-enc text) " " selected "n"))
(net-send out (string "check-box " id " " action " nil " selected "n")))
)
#60
newLISP Graphics & Sound / Combined demo
June 16, 2007, 10:52:17 AM
I put some of the current demos together:



(load "http://hpwsoft.de/anmeldung/html1/newLISP/gui-demo.lsp">//http://hpwsoft.de/anmeldung/html1/newLISP/gui-demo.lsp")



Also Combo and listbox echos right text in textearea:

(define (action-handler)
(if (= "MAIN:TheToggleButton" (args 0))
(if (true? (args 1))
(gs:disable 'TheButton 'TheImageButton 'TheRadioButton 'TheCheckBox 'TheMessage)
(gs:enable 'TheButton 'TheImageButton 'TheRadioButton 'TheCheckBox 'TheMessage)
))

(if (= "MAIN:TheImageButton" (args 0))
(gs:color-dialog 'TheFrame 'action-handler "Choose a color" 1 1 1))

(if (= "MAIN:TheMessage" (args 0))
(gs:confirm-dialog 'TheFrame 'action-handler
"A Message" "Enjoy GUI server"
"yes-no"
;(amb "error" "informaton" "warning" "question" "plain")
))

(let (s "")
(doargs (item)
(write-buffer s (string item " ")))

(if (or
(= "MAIN:TheComboBox" (args 0))
(= "MAIN:TheListBox" (args 0)))
(write-buffer s (string (base64-dec (args 2)) " "))
)

(write-buffer s "n")
(gs:append-text 'MonitorArea s)
)
)