Attachment 'gnu.m'
Download 1 #! /usr/bin/octave -q
2 %(C) Feb 2005 Muthiah Annamalai, Octave-GTK & Octave-libGlade
3
4 gx=0
5
6 function on_spin_changed()
7 global gx
8 label=glade_xml_get_widget(gx,"label");
9 b=glade_xml_get_widget(gx,"spin");
10 count=gtk_spin_button_get_value_as_int(b);
11 buffer=sprintf("%3d",count);
12 gtk_label_set_text(label,buffer);
13 end
14
15
16 function main()
17 global gx
18
19 gtk()
20 glade()
21
22 gtk_init()
23
24 gx=glade_xml_new("gnu.glade","window","");
25
26 glade_xml_signal_autoconnect(gx);
27 w=glade_xml_get_widget(gx,"window");
28
29 g_signal_connect(w,"destroy","gtk_main_quit");
30 gtk_widget_show_all(w);
31
32 gtk_main();
33 return
34 end
35
36 main()
37
38 %gcc -o gnu -Wall gnu.c `pkg-config gtk+-2.0 --cflags --libs` -I/usr/include/libglade-2.0 -lxml -lglade-2.0
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.