Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -3,8 +3,9 @@
|
|||
(define libc (or
|
||||
(load-dynamic-library "libc.so") ; General Posix
|
||||
(load-dynamic-library "libc.so.6") ; Linux
|
||||
(load-dynamic-library "libc.so.6.1") ; Linux (DEC Alpha)
|
||||
(load-dynamic-library "libc.so.7") ; Latest *BSD
|
||||
(load-dynamic-library "libSystem.B.dylib") ; Mac
|
||||
(load-dynamic-library "libSystem.B.dylib") ; macOS / Darwin
|
||||
(load-dynamic-library "shlwapi.dll") )) ; Windows
|
||||
|
||||
(define strdup (or
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@
|
|||
(define libc (or
|
||||
(load-dynamic-library "libc.so") ; General Posix
|
||||
(load-dynamic-library "libc.so.6") ; Linux
|
||||
(load-dynamic-library "libc.so.6.1") ; Linux (DEC Alpha)
|
||||
(load-dynamic-library "libc.so.7") ; Latest *BSD
|
||||
(load-dynamic-library "libSystem.B.dylib") ; Mac
|
||||
(load-dynamic-library "libSystem.B.dylib") ; macOS / Darwin
|
||||
(load-dynamic-library "shlwapi.dll") )) ; Windows
|
||||
|
||||
(define lib2
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
; The sample usage of GTK3+ library
|
||||
(import (otus ffi)
|
||||
(lib glib-2)
|
||||
(lib gtk-3))
|
||||
|
||||
(define print_hello (vm:pin (cons
|
||||
(cons gint (list GtkWidget* gpointer))
|
||||
(lambda (widget userdata)
|
||||
(print "hello, world")
|
||||
TRUE
|
||||
))))
|
||||
|
||||
(define activate (vm:pin (cons
|
||||
(cons gint (list GtkApplication* gpointer))
|
||||
(lambda (app userdata)
|
||||
(define window (gtk_application_window_new app))
|
||||
(print "window created.")
|
||||
(gtk_window_set_title window "Window")
|
||||
(gtk_window_set_default_size window 200 200)
|
||||
|
||||
(define button_box (gtk_button_box_new GTK_ORIENTATION_HORIZONTAL))
|
||||
(gtk_container_add window button_box)
|
||||
|
||||
(define button (gtk_button_new_with_label "Press me!"))
|
||||
(g_signal_connect button "clicked" (G_CALLBACK print_hello) NULL)
|
||||
(gtk_container_add button_box button)
|
||||
|
||||
(gtk_widget_show_all window)
|
||||
))))
|
||||
|
||||
(define app (gtk_application_new (c-string "org.gtk.example") G_APPLICATION_FLAGS_NONE))
|
||||
(g_signal_connect app (c-string "activate") (G_CALLBACK activate) NULL)
|
||||
|
||||
(g_application_run app 0 #false)
|
||||
Loading…
Add table
Add a link
Reference in a new issue