@@ -59,15 +59,19 @@ SOFTWARE.
5959#include "sin.h"
6060#include "private/sinP.h"
6161
62+ #ifndef GTK4_EXT
6263#include <X11/StringDefs.h>
6364#include <X11/Shell.h>
65+ #endif
6466#ifdef MOTIF
6567#include <Xm/Frame.h>
6668#include <Xm/Text.h>
6769#else
70+ #ifndef GTK4_EXT
6871#include <X11/Xaw/Viewport.h>
6972#include <X11/Xaw/AsciiText.h>
7073#endif
74+ #endif
7175
7276/*******************************************************************************
7377 * reset_string_measure
@@ -228,10 +232,12 @@ XtActionProc phg_sin_xt_string_event(
228232}
229233#endif
230234
235+ #ifndef GTK4_EXT
231236static XtTranslations compiled_translations ;
232237static String translations = "\
233238 <Key>Return: newline() StringEvent() RequestSatisfied() \n\
234239 " ;
240+ #endif
235241
236242/*******************************************************************************
237243 * create_string
@@ -306,10 +312,12 @@ static void create_string(
306312 NULL );
307313#endif
308314
315+ #ifndef GTK4_EXT
309316 if ( !compiled_translations ) {
310317 compiled_translations = XtParseTranslationTable ( translations );
311318 }
312319 XtOverrideTranslations ( widgets -> textw , compiled_translations );
320+ #endif
313321#ifdef DEBUGINP
314322 printf ("Done with create string.\n" );
315323#endif
@@ -343,9 +351,11 @@ static void enable_string(
343351#ifdef DEBUGINP
344352 printf ("Setting flags\n" );
345353#endif
354+ #ifndef GTK4_EXT
346355 XSaveContext ( XtDisplay (device -> item_handle .string .textw ),
347356 XtWindow (device -> item_handle .string .textw ),
348357 phg_sin_device_context_id , (caddr_t )device );
358+ #endif
349359 device -> flags .been_up_yet = 1 ;
350360 }
351361#ifdef DEBUGINP
@@ -409,8 +419,13 @@ static void destroy_string(
409419#ifdef DEBUGINP
410420 printf ("Destroy string.\n" );
411421#endif
412- if ( device -> item_handle .string .shell )
422+ if ( device -> item_handle .string .shell ) {
423+ #ifdef GTK4_EXT
424+ gtk_window_destroy (GTK_WINDOW (device -> item_handle .string .shell ));
425+ #else
413426 XtDestroyWidget ( device -> item_handle .string .shell );
427+ #endif
428+ }
414429}
415430
416431/*******************************************************************************
0 commit comments