creating application contexts multiple times the subject does not describe the problem i am having very well please read on i am trying to write a function which creates an xtappcontext and a widget displays the widget for a while then destroys everything and returns the problem is that multiple calls to this function cause a variety of problems including depending on which calls i make to get rid of things core dump badpixmap x error widget not unmapped here is a simple c program i wrote to show the problem include x xlib h include xm xm h include xm pushb h void bla xtappcontext app display dis xopendisplay int junk widget top xtappinitialize app test null junk null null null widget box xtvacreatemanagedwidget blaaa xmpushbuttonwidgetclass top xmnheight xmnwidth null xtrealizewidget top same as xtappmainloop but with only xevents for int i i i xevent event xtappnextevent app event xtdispatchevent event what should i put here xtunrealizewidget top xtdestroywidget top xtdestroyapplicationcontext app xclosedisplay dis main for int i i i bla note that i rewrote xtappmainloop so that at a given time in this example after xevents the function will exit and return to the main program with this example i get the following error on about this is not consistent the th call to bla x error of failed request badpixmap invalid pixmap parameter major opcode of failed request x creategc resource id in failed request xe d serial number of failed request current serial number in output stream if i take out the xtunrealizewidget top line it just dumps core on the seconds call furthermore every time i call xtappinitialize other than the st time i get warning initializing resource lists twice warning initializing translation manager twice so finally my question is this what needs to be done in order to be able to call a function which creates an xtappcontext and widgets multiple times any help would be greatly appreciated please respond via email as i dont usually have time to read this group thanks very much davewood david rex wood davewood cs colorado edu university of colorado at boulder
