#! /usr/bin/octave -q
%(C) Feb 2005 Muthiah Annamalai, Octave-GTK & Octave-libGlade

gx=0

function  on_spin_changed()
  global gx
  label=glade_xml_get_widget(gx,"label");
  b=glade_xml_get_widget(gx,"spin");
  count=gtk_spin_button_get_value_as_int(b);
  buffer=sprintf("%3d",count);
  gtk_label_set_text(label,buffer);
end


function main()
     global gx
     
     gtk()
     glade()

     gtk_init()
     
     gx=glade_xml_new("gnu.glade","window","");

     glade_xml_signal_autoconnect(gx);
     w=glade_xml_get_widget(gx,"window");

     g_signal_connect(w,"destroy","gtk_main_quit");
     gtk_widget_show_all(w);

     gtk_main();
     return
end

main()

%gcc -o gnu  -Wall gnu.c `pkg-config gtk+-2.0 --cflags --libs` -I/usr/include/libglade-2.0 -lxml -lglade-2.0

