Update of /cvsroot/pure-data/externals/bbogart/entry In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29491
Modified Files: entry-help.pd entry.c Log Message: created [add( message to append text to the existing text
Index: entry.c =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** entry.c 25 Oct 2007 17:07:35 -0000 1.13 --- entry.c 26 Oct 2007 04:49:50 -0000 1.14 *************** *** 24,27 **** --- 24,28 ---- /* TODO: make focus option only accept regular and shifted chars, not Cmd, Alt, Ctrl */ /* TODO: make entry_save include whole classname, including namespace prefix */ + /* TODO: make [size( message redraw object */ /* TODO: set message doesnt work with a loadbang */ /* TODO: add [append( message to add contents after existing contents, just *************** *** 39,43 **** #define BACKGROUNDCOLOR "grey70"
! #define DEBUG(x)
typedef struct _entry --- 40,44 ---- #define BACKGROUNDCOLOR "grey70"
! #define DEBUG(x) x
typedef struct _entry *************** *** 378,391 **** }
! /* Function to reset the contents of the entry box */ ! static void entry_set(t_entry* x, t_symbol *s, int argc, t_atom *argv) { ! DEBUG(post("entry_set");); int i; ! t_symbol *tmp;
- tmp = s; /* <-- this gets rid of the unused variable warning */ - DEBUG(post("%s delete 0.0 end \n", x->x_widget_name);); - sys_vgui("%s delete 0.0 end \n", x->x_widget_name); for(i=0; i<argc ; i++) { --- 379,388 ---- }
! static void entry_add(t_entry* x, t_symbol *s, int argc, t_atom *argv) { ! DEBUG(post("entry_add");); int i; ! t_symbol *tmp = s; /* <-- this gets rid of the unused variable warning */
for(i=0; i<argc ; i++) { *************** *** 400,403 **** --- 397,411 ---- }
+ /* Function to reset the contents of the entry box */ + static void entry_set(t_entry* x, t_symbol *s, int argc, t_atom *argv) + { + DEBUG(post("entry_set");); + int i; + + DEBUG(post("%s delete 0.0 end \n", x->x_widget_name);); + sys_vgui("%s delete 0.0 end \n", x->x_widget_name); + entry_add(x, s, argc, argv); + } + /* Clear the contents of the text widget */ static void entry_clear(t_entry* x) *************** *** 586,589 **** --- 594,602 ---- 0); + class_addmethod(entry_class, (t_method)entry_add, + gensym("add"), + A_GIMME, + 0); + class_addmethod(entry_class, (t_method)entry_clear, gensym("clear"),
Index: entry-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry-help.pd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** entry-help.pd 25 Oct 2007 17:07:35 -0000 1.3 --- entry-help.pd 26 Oct 2007 04:49:49 -0000 1.4 *************** *** 1,9 **** ! #N canvas 200 48 472 591 10; #X obj 73 212 entry 150 100 grey black; #X obj 11 84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 32 346 print; ! #X msg 150 95 clear; ! #X msg 159 117 set one two three four five six; #X msg 72 50 fgcolour yellow; #X msg 50 23 bgcolour purple; --- 1,9 ---- ! #N canvas 200 48 476 595 10; #X obj 73 212 entry 150 100 grey black; #X obj 11 84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 32 346 print; ! #X msg 100 95 clear; ! #X msg 157 99 set one two three four five six; #X msg 72 50 fgcolour yellow; #X msg 50 23 bgcolour purple; *************** *** 13,18 **** #X obj 261 234 select return; #X obj 79 347 pddp/print; ! #X obj 176 143 trigger bang bang; ! #X msg 176 164 clear; #X symbolatom 216 319 10 0 0 1 last_key_typed - -; #X text 266 262 ^-- hit return to output; --- 13,18 ---- #X obj 261 234 select return; #X obj 79 347 pddp/print; ! #X obj 176 163 trigger bang bang; ! #X msg 176 184 clear; #X symbolatom 216 319 10 0 0 1 last_key_typed - -; #X text 266 262 ^-- hit return to output; *************** *** 23,26 **** --- 23,27 ---- #X text 13 404 The size message currently only takes affect after a save and reopen.; + #X msg 169 127 add seven eight nine; #X connect 0 0 2 0; #X connect 0 0 10 0; *************** *** 40,41 **** --- 41,43 ---- #X connect 17 0 0 0; #X connect 18 0 0 0; + #X connect 20 0 0 0;