#!/usr/bin/mumps

#+ Copyright (C) 2022 by Kevin C. O'Kane
#+
#+ Kevin C. O'Kane, Ph.D.
#+ Professor Emeritus
#+ Computer Science Department
#+ University of Northern Iowa
#+ Cedar Falls, IA 50614-0507
#+ kc.okane@gmail.com
#+ http://www.cs.uni.edu/~okane
#+
#+ This program is free software; you can redistribute it and/or modify
#+ it under the terms of the GNU General Public License as published by
#+ the Free Software Foundation; either version 2 of the License, or
#+ (at your option) any later version.
#+
#+ This program is distributed in the hope that it will be useful,
#+ but WITHOUT ANY WARRANTY; without even the implied warranty of
#+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#+ GNU General Public License for more details.
#+
#+ You should have received a copy of the GNU General Public License
#+ along with this program; if not, write to the Free Software
#+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#	May 23, 2022

#	Mumps GTK Signal Handler

	do ^gtk4.h
	write "on.select1.changed.mps"," ",widget,!
	set x=$z~mdh~tree~selection~get~selected(select1,0)
	set x=$zblanks(x)
	write "selection ",x,!
	if x'?.n quit
	o 1:"ohsu.medline,old"
	use 1
	set %=$zseek(^map(x))
	set a=""
	for  do
	. u 1 r b
	. if '$t break
	. if $l(b)=0 break
	. set b=b_$c(10)
	. set a=a_" "_b

	close 1

	set %=$z~mdh~text~buffer~set~text(textbuffer1,a)
