Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14198
Modified Files: Tag: desiredata desire.c desire.tk Log Message: new method "object_help" in server canvas; and part 1 of find_last_error.
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.102 retrieving revision 1.1.2.600.2.103 diff -C2 -d -r1.1.2.600.2.102 -r1.1.2.600.2.103 *** desire.tk 18 Dec 2006 23:54:39 -0000 1.1.2.600.2.102 --- desire.tk 19 Dec 2006 00:31:56 -0000 1.1.2.600.2.103 *************** *** 1964,1968 **** set m $name.m menu $m ! foreach x {file edit view put window help} {menu $m.$x -tearoff $::pd_tearoff} $self populate_menu file { new_file open_file {} --- 1964,1968 ---- set m $name.m menu $m ! foreach x {file edit find view put window help} {menu $m.$x -tearoff $::pd_tearoff} $self populate_menu file { new_file open_file {} *************** *** 1974,1977 **** --- 1974,1979 ---- cut copy paste duplicate select_all {} text_editor tidy_up {}} + $self populate_menu find { + find find_again find_last_error} $self populate_menu view { reload redraw} *************** *** 1988,1992 **** $m.window configure -postcommand "$self fix_window_menu" foreach x {file edit view find put window help} { ! if {$x=="find" || $x=="help"} { # help menu is in the wrong place in patch windows because it's taken from .mbar ??? $m add cascade -label [say $x] -menu .mbar.$x --- 1990,1994 ---- $m.window configure -postcommand "$self fix_window_menu" foreach x {file edit view find put window help} { ! if {$x=="help"} { # help menu is in the wrong place in patch windows because it's taken from .mbar ??? $m add cascade -label [say $x] -menu .mbar.$x *************** *** 4141,4145 **** }
! def Box popup_help {} {netsend [list pd help $@pdclass]}
#-----------------------------------------------------------------------------------# --- 4143,4148 ---- }
! #def Box popup_help {} {netsend [list pd help $@pdclass]} ! def Box popup_help {} {netsend [list .$@canvas object_help $self]}
#-----------------------------------------------------------------------------------#
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.75 retrieving revision 1.1.2.217.2.76 diff -C2 -d -r1.1.2.217.2.75 -r1.1.2.217.2.76 *** desire.c 18 Dec 2006 23:13:20 -0000 1.1.2.217.2.75 --- desire.c 19 Dec 2006 00:31:54 -0000 1.1.2.217.2.76 *************** *** 6207,6210 **** --- 6207,6222 ---- }
+ extern "C" char *class_gethelpdir(t_class *c); + extern "C" void open_via_helppath(const char *name, const char *dir); + static void canvas_object_help(t_canvas *x, t_symbol *name) { + t_text *o = symbol2opointer(name); if (!o) return; + char namebuf[MAXPDSTRING], *dir; + t_class *c = o->_class; + strcpy(namebuf, class_gethelpname(c)); + dir = class_gethelpdir(c); + if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd"); + open_via_helppath(namebuf, dir); + } + static long canvas_children_count(t_canvas *x) { long n=0; *************** *** 7460,7463 **** --- 7472,7476 ---- class_addmethod3(c,canvas_object_insert,"object_insert","*"); class_addmethod3(c,canvas_object_get_tips,"object_get_tips","s"); + class_addmethod3(c,canvas_object_help,"object_help","s"); class_addmethod3(c,canvas_text_setto,"text_setto","*"); class_addmethod3(c,canvas_with_reply,"with_reply","*"); *************** *** 7507,7523 **** extern "C" void glob_update_class_info (t_pd *bogus, t_symbol *s, t_symbol *cb_recv, t_symbol *cb_sel); extern "C" void glob_update_path (void); - extern "C" char *class_gethelpdir(t_class *c); - - void post_helppath(void) { - t_namelist *t = sys_helppath; - post("<helppath>"); - while (t) { - post("%s",t->nl_string); - t=t->nl_next; - } - post("</helppath>"); - } - - extern "C" void open_via_helppath(const char *name, const char *dir);
void glob_help(t_pd *bogus, t_symbol *s) { --- 7520,7523 ---- *************** *** 7537,7541 **** dir = class_gethelpdir(c); if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd"); - //post_helppath(); open_via_helppath(namebuf, dir); } --- 7537,7540 ---- *************** *** 7692,7696 **** iemgui_subclass(c); class_setsavefn(c,(t_savefn)cnv_savefn); ! class_sethelpsymbol(c, gensym("cnv"));
c = vu_class = class_new(gensym("vu"), (t_newmethod)vu_new, (t_method)iemgui_free, sizeof(t_vu), 0, A_GIMME, 0); --- 7691,7695 ---- iemgui_subclass(c); class_setsavefn(c,(t_savefn)cnv_savefn); ! class_sethelpsymbol(c, gensym("my_canvas"));
c = vu_class = class_new(gensym("vu"), (t_newmethod)vu_new, (t_method)iemgui_free, sizeof(t_vu), 0, A_GIMME, 0); *************** *** 7990,7994 ****
static t_pd *error_object; ! static char error_string[256]; void canvas_finderror(void *object);
--- 7989,7993 ----
static t_pd *error_object; ! static char error_string[MAXPDSTRING]; void canvas_finderror(void *object);
*************** *** 8003,8006 **** --- 8002,8006 ---- strcat(buf, "\n"); dopost(buf); + strcpy(error_string,buf); error_object = (t_pd *)object; if (!saidit) { *************** *** 8015,8019 **** if (!error_object) post("no findable error yet."); else { ! post("last trackable error: %s", error_string); canvas_finderror(error_object); } --- 8015,8020 ---- if (!error_object) post("no findable error yet."); else { ! post("last trackable error was for object x%lx: %s", error_object, error_string); ! sys_mgui(error_object,"show_error","S",error_string); canvas_finderror(error_object); }