Museum

For the Compleat Fan
Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Having the language and GUI app separated and communicating via TCP has a lot going for it. You can have a distributed situation where newLISP lives on some super computer and the GUI frontend is on your desktop PC. It also separates two computing and software development tasks in a natural way. On one side the language-machine on the other the GUI. UNIX made a good decision when they built their OS the same way. The X windows system and the Os are loosely coupled via TCP and can live on different computers.

Unfortunately when they invented the browser they never thought of dynamic graphics and there are still only proprietary solutions (i.e. Macromedia Flash). I think the W3C has something in the works but the SW Industry seems not to be interested in standardized open solutions / protocols. Perhaps if Mozilla gains enough penetration, things will change. Proprietary GUI systems are one of the last borders to overcome for open protocols computing systems and tools.

Lutz

adamss3
Posts: 14
Joined: Mon Oct 14, 2002 11:53 am

callbacks

Post by adamss3 »

It might be worth considering adding callbacks, which opens the door to "native" GUI support as well as having other processes call into newLISP. It could be used for things other than GUI support.

But, the mechanism that was added should be general purpose and not tied specifically to GUI construction or to any specific OS.

nigelbrown
Posts: 429
Joined: Tue Nov 11, 2003 2:11 am
Location: Brisbane, Australia

Post by nigelbrown »

On the question of guis, perhaps rather than spend time on coding,
working on promoting the TCP interfacing with
more examples and beginner tutorials +/- an easy-peazy tcp-gui module
may be the better use of time?

Any thoughts?

Nigel

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

But the MacIntosh platform still has no access to GTK2 as far as I know.
It might be of interest to know that the GTK-server works on MacOSX. (I had to remove the URL from this posting since the author is not ready with publishing his site.)

Also today I learned that GTK-server can be compiled on Solaris, with some adjustments on the configure script. These adjustments will be available in the next release. The Linux, Windows and BSD platforms already were supported. Next to this I have received reports about successfull compilation on AMDx64 architectures.

So in case somebody wants to create multiplatform user interfaces with GTK and newLisp, it is possible now. ;-)

Peter

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Hi,

Today GTK-server 2.0.6 has been released. The interesting thing for newLisp is that the GTK-server now can be compiled as a shared object or DLL. A newLisp script now can import the gtk function like this:

Code: Select all

(import "gtk-server.so" "gtk")

(gtk "gtk_init NULL NULL")
(gtk "gtk_window 0")
...etc...
A complete demoscript with newLisp can be found in the sourcepackage.

Lutz: I also received instructions on how to compile with GTK2 on MacOSX, you can find these on my website at the documentation section. A screenshot with MacOSX can be found at http://leonardoce.interfree.it/gtkserver/index.html (posted earlier but the site is ready now).

Br,
Peter

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Today GTK-server 2.0.8 was released with support for Glade files. Glade support has been requested many times by many newLisp people, that's why I mention it here explicitely. :-)

To give an impression how it works:

Code: Select all

#!/usr/bin/newlisp
#
# Demonstration on how to use the GTK-server with GLADE and NEWLISP. 
# Tested with newLISP 8.7.1 on Slackware Linux 10 and Windows2000
#
# January 4, 2006 - PvE.
#------------------------------------------------------------------

# Setup gtk-server
(import "/usr/lib/libgtk-server.so" "gtk")

# Optionally enable GTK logging
(gtk "gtk_server_logging 1")

# Get GLADE definition
(gtk "gtk_server_glade_file file.glade")

# Get main window ID
(set 'win (get-string (gtk "gtk_server_glade_widget MainWindow")))

# Connect signal to window
(gtk (append "gtk_server_connect " win " delete-event delwindow"))

# Mainloop starts here
(while (!= event "delwindow")

	# Get event
	(set 'event (get-string (gtk "gtk_server_callback wait")))
)

# Exit GTK
(gtk "gtk_exit 0")
(exit)
This also works on the Win32 platform with the 'gtk-server.dll' or 'gtk-server.exe'. Get it at:

http://www.gtk-server.org

Regards
Peter

Locked