[comp.windows.x] XView selection problem

mferidun@bbn.com (Metin Feridun) (05/26/90)

I am using XView 1.0.1 (with patches), X11R4 on Sun 3 running
SunOS 4.0.3. I have the following problem:

In my application (which consists of a straight forward text window
(Textsw)), if I select (click select, click drag, etc.) when there is
already a selected text somewhere else (say, xterm or any other
application), my application infinite loops, with the error message

	Selection library internal error:
	Select call returned error

When this happens, the remedy is to remotely kill the application,
or reboot the workstation (sigh). This problem does not occur if
nothing is selected in any of the co-existing applications.

Has anyone run into this problem, or have suggestions as to how I
can fix it?

Thanks.

Metin Feridun
mferidun@bbn.com


ps. this is a sample code that manifests the problem.

+++++++++++++++++++++ example code +++++++++++++++++++++++++++++++++++

#include <X11/Xlib.h>
#include <xview/xview.h>
#include <xview/scrollbar.h>
#include <xview/panel.h>
#include <xview/textsw.h>

Frame frame;
Panel panel;
Textsw textsw;

void update();
void quit();

main(argc, argv)
     int argc;
     char *argv[];
{

  xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);

  frame = (Frame) xv_create(NULL, FRAME, NULL);

  panel = (Panel) xv_create(frame, PANEL, NULL);

  (void) xv_create(panel, PANEL_BUTTON,
		     PANEL_LABEL_STRING, "Update",
		     PANEL_NOTIFY_PROC, update,
		     NULL);
  (void) xv_create(panel, PANEL_BUTTON,
		     PANEL_LABEL_STRING, "Quit",
		     PANEL_NOTIFY_PROC, quit,
		     NULL);

  window_fit_height(panel);

  textsw = xv_create(frame, TEXTSW ,
		     WIN_BELOW , panel,
		     XV_WIDTH, 500,
		     XV_HEIGHT, 300,
		     TEXTSW_READ_ONLY,		TRUE ,
		     TEXTSW_MEMORY_MAXIMUM ,	100000 ,
		     0 );

  window_fit(frame);
  xv_main_loop(frame);
}

void update()
{
  int len;

  len = strlen("update\n");
  textsw_insert(textsw, "update\n", len);
}

void quit()
{
  xv_destroy_safe(frame);
}