[PD-dev] [ pure-data-Bugs-2985017 ] popup not working in windows (with workaround)

SourceForge.net noreply at sourceforge.net
Tue Apr 13 16:43:00 CEST 2010


Bugs item #2985017, was opened at 2010-04-10 09:40
Message generated for change (Comment added) made by irmaosaturno
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478070&aid=2985017&group_id=55736

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: externals
Group: v0.42
Status: Pending
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Paulo Casaes  (irmaosaturno)
Assigned to: Hans-Christoph Steiner (eighthave)
Summary: popup not working in windows (with workaround)

Initial Comment:
Ben Bogart's popup is not working properly in windows (PD-Extended 0.41).

It loads fine but it does not output a selection nor does using its inlet work to change its selection. Whenever you try to do so it gives the error:
error: popup0xa4fda0: no such object

I tracked the problem down and it seems that in windows TK doesn't like it when the pointer reference in hex starts with 0x. This might actually be a problem with the TK provided in the windows version and not with popup itself. In Linux and OS X the reference has 0x in it and works just fine.

Here's a workaround that fixes the problem.
diff popup.c popup.c.orig 
596,599d595
< #ifdef NT
< 	char buf2[256];
< 	char *buf2ptr;
< #endif
646,654d641
< #ifdef NT
< 	sprintf(buf2,"%p",x);
< 	buf2ptr = &buf2;
< 	if(strstr(buf2, "0x") == buf2ptr) {
< 		buf2ptr++;
< 		buf2ptr++;
< 	}
< 	sprintf(buf,"popup%s",buf2ptr);
< #else
656d642
< #endif
661,663d646
< #ifdef NT
<    sys_vgui("proc popup_sel%x {index} {\n pd [concat popup%s output $index \\;]\n }\n",x,buf2ptr);
< #else
665c648
< #endif
---
> 

Changes only in the popup_new function. It uses the NT preprocessing directive, in Linux and OS X it should remain unchanged. Basically it tests the pointer for 0x and removes it.

Paulo

----------------------------------------------------------------------

Comment By: Paulo Casaes  (irmaosaturno)
Date: 2010-04-13 11:43

Message:
Just tested it (in windows). Works perfectly.

I had originally used %lx but figured it was "wrong" to cast a pointer to
an long unsigned int. Just checked out the source for pd, shows how what I
know :)

----------------------------------------------------------------------

Comment By: Hans-Christoph Steiner (eighthave)
Date: 2010-04-13 11:21

Message:
good idea, I got rid of the warnings by casting:
http://pure-data.svn.sourceforge.net/viewvc/pure-data?view=rev&revision=13440

----------------------------------------------------------------------

Comment By: Paulo Casaes  (irmaosaturno)
Date: 2010-04-13 06:59

Message:
Changing %p to %lx does work but it gives off the warning:
popup.c:655: warning: format '%lx' expects type 'long unsigned int', but
argument 3 has type 'struct t_popup *'

when compiling. The Makefile has -Werror in the linux build, so that also
has to be changed.

----------------------------------------------------------------------

Comment By: Hans-Christoph Steiner (eighthave)
Date: 2010-04-13 03:01

Message:
These commits should have fixed it:

http://pure-data.svn.sourceforge.net/viewvc/pure-data?view=rev&revision=13437
http://pure-data.svn.sourceforge.net/viewvc/pure-data?view=rev&revision=13438



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478070&aid=2985017&group_id=55736




More information about the Pd-dev mailing list