[PD-cvs] externals/bbogart/popup popup.c,1.13,1.14

IOhannes m zmölnig zmoelnig at users.sourceforge.net
Mon Jun 6 19:18:20 CEST 2005


Update of /cvsroot/pure-data/externals/bbogart/popup
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27211

Modified Files:
	popup.c 
Log Message:
now we can select, change options/name with hidden [popup]s that were already opened


Index: popup.c
===================================================================
RCS file: /cvsroot/pure-data/externals/bbogart/popup/popup.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** popup.c	6 Jun 2005 16:05:31 -0000	1.13
--- popup.c	6 Jun 2005 17:18:18 -0000	1.14
***************
*** 389,397 ****
  	
  	int i;
  
  	x->x_num_options = argc;
  	
  	/* delete old menu items */
! 	if(x->initialized)sys_vgui(".x%x.c.s%x.menu delete 0 end \n", x->x_glist, x);
  
          if(argc>x->x_maxoptions){
--- 389,398 ----
  	
  	int i;
+         int visible=(x->x_glist)?glist_isvisible(x->x_glist):0;
  
  	x->x_num_options = argc;
  	
  	/* delete old menu items */
! 	if(visible)sys_vgui(".x%x.c.s%x.menu delete 0 end \n", x->x_glist, x);
  
          if(argc>x->x_maxoptions){
***************
*** 405,409 ****
  	{
  		x->x_options[i] = atom_getsymbol(argv+i);
! 		if(x->initialized)sys_vgui(".x%x.c.s%x.menu add command -label \"%s\" -command {.x%x.c.s%x configure -text \"%s\" ; popup_sel%x \"%d\"} \n", 
  			x->x_glist, x, x->x_options[i]->s_name, x->x_glist, x, x->x_options[i]->s_name, x, i);
  	}
--- 406,410 ----
  	{
  		x->x_options[i] = atom_getsymbol(argv+i);
! 		if(visible)sys_vgui(".x%x.c.s%x.menu add command -label \"%s\" -command {.x%x.c.s%x configure -text \"%s\" ; popup_sel%x \"%d\"} \n", 
  			x->x_glist, x, x->x_options[i]->s_name, x->x_glist, x, x->x_options[i]->s_name, x, i);
  	}
***************
*** 415,422 ****
  static void popup_bgcolour(t_popup* x, t_symbol* col)
  {
  	DEBUG(post("bgcolour start");)
  
  	x->x_colour = col;
! 	if(x->initialized)sys_vgui(".x%x.c.s%x configure -background \"%s\"\n", x->x_glist, x, col->s_name);
  }
  
--- 416,424 ----
  static void popup_bgcolour(t_popup* x, t_symbol* col)
  {
+         int visible=(x->x_glist)?glist_isvisible(x->x_glist):0;
  	DEBUG(post("bgcolour start");)
  
  	x->x_colour = col;
! 	if(visible)sys_vgui(".x%x.c.s%x configure -background \"%s\"\n", x->x_glist, x, col->s_name);
  }
  
***************
*** 424,431 ****
  static void popup_name(t_popup* x, t_symbol *name)
  {
  	DEBUG(post("name start");)
  
  	x->x_name = name;
! 	if(x->initialized)sys_vgui(".x%x.c.s%x configure -text \"%s\"\n", x->x_glist, x, name->s_name);
  }
  
--- 426,434 ----
  static void popup_name(t_popup* x, t_symbol *name)
  {
+         int visible=(x->x_glist)?glist_isvisible(x->x_glist):0;
  	DEBUG(post("name start");)
  
  	x->x_name = name;
! 	if(visible)sys_vgui(".x%x.c.s%x configure -text \"%s\"\n", x->x_glist, x, name->s_name);
  }
  
***************
*** 434,442 ****
  {
  	DEBUG(post("iselect start");)
  
  	int i=(int)item;
  	if( i<x->x_num_options && i>=0)
  	{
! 		if(x->initialized)sys_vgui(".x%x.c.s%x configure -text \"%s\" ; popup_sel%x \"%d\" \n",
  			glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name,x, i);
                  else popup_output(x, i);
--- 437,446 ----
  {
  	DEBUG(post("iselect start");)
+         int visible=(x->x_glist)?glist_isvisible(x->x_glist):0;
  
  	int i=(int)item;
  	if( i<x->x_num_options && i>=0)
  	{
! 		if(visible)sys_vgui(".x%x.c.s%x configure -text \"%s\" ; popup_sel%x \"%d\" \n",
  			glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name,x, i);
                  else popup_output(x, i);
***************
*** 453,456 ****
--- 457,461 ----
  {
  	int i,match=0;
+         int visible=(x->x_glist)?glist_isvisible(x->x_glist):0;
  
  	/* Compare inlet symbol to each option */
***************
*** 459,463 ****
  	  if(x->x_options[i]->s_name == s->s_name)
  	  {
! 	    if(x->initialized)sys_vgui(".x%x.c.s%x configure -text \"%s\" ; popup_sel%x \"%d\" \n",
                          glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name,x, i);
              else popup_output(x, i);
--- 464,468 ----
  	  if(x->x_options[i]->s_name == s->s_name)
  	  {
! 	    if(visible)sys_vgui(".x%x.c.s%x configure -text \"%s\" ; popup_sel%x \"%d\" \n",
                          glist_getcanvas(x->x_glist), x, x->x_options[i]->s_name,x, i);
              else popup_output(x, i);
***************
*** 478,481 ****
--- 483,487 ----
  
          int i, new_limit;
+         int visible=(x->x_glist)?glist_isvisible(x->x_glist):0;
  
          new_limit = x->x_num_options + argc;
***************
*** 500,504 ****
          {
                  x->x_options[i] = atom_getsymbol(argv+i-x->x_num_options);
!                 if(x->initialized)sys_vgui(".x%x.c.s%x.menu add command -label \"%s\" -command {.x%x.c.s%x configure -text \"%s\" ; popup_sel%x \"%d\"} \n",
                          x->x_glist, x, x->x_options[i]->s_name, x->x_glist, x, x->x_options[i]->s_name, x, i);
          }
--- 506,510 ----
          {
                  x->x_options[i] = atom_getsymbol(argv+i-x->x_num_options);
!                 if(visible)sys_vgui(".x%x.c.s%x.menu add command -label \"%s\" -command {.x%x.c.s%x configure -text \"%s\" ; popup_sel%x \"%d\"} \n",
                          x->x_glist, x, x->x_options[i]->s_name, x->x_glist, x, x->x_options[i]->s_name, x, i);
          }





More information about the Pd-cvs mailing list