rebol [ title: "Rebol/pro::GtkServer" Description: "Small exmaple on how to call gtk-server library with rebol/pro (commercial)" Author: "Norman" ] gtk-lib: load/library %libgtk-server.so gtks: make routine! [ instring [string!] "gtk function" return: [string!] "returned string from gtk-server" ] gtk-lib "gtk" io: reform [ {gtk_server_echo } 1234 {"hello string word"} ] gtks io gtks {gtk_server_cfg log} gtks {gtk_init null null} win: gtks {gtk_window_new 0} io: reform [ {gtk_window_set_title } :win { RebolGtk-Server } ] gtks io io: reform [ {gtk_window_set_default_size } :win { 200 100} ] gtks io io: reform [ {gtk_window_set_position } :win { 1} ] gtks io tbl: gtks {gtk_table_new 30 30 1} io: reform [ {gtk_container_add } :win { } tbl ] gtks io bt1: gtks {gtk_button_new_with_label Exit} io: reform [ {gtk_table_attach_defaults } :tbl { } :bt1 {17 28 20 25} ] gtks io bt2: gtks {gtk_button_new_with_label text} io: reform [ {gtk_table_attach_defaults } :tbl { } :bt2 {2 13 20 25} ] gtks io ent: gtks {gtk_entry_new} io: reform [ {gtk_table_attach_defaults } :tbl { } :ent {2 28 5 15} ] gtks io io: reform [{gtk_widget_show_all } :win ] gtks io event: "" while [ all [ (not-equal? to-string event bt1) (not-equal? to-string event win) ]] [ event: gtks {gtk_server_callback wait} if any [ equal? to-string event bt2 equal? to-string event ent ] [ io: reform [ {gtk_entry_get_text } :ent ] alert tmp: gtks io ] ] quit