Museum

Started by newdep, July 23, 2004, 05:58:05 AM

Previous topic - Next topic

pjot

#30
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:



#!/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">http://www.gtk-server.org



Regards

Peter