MCPcopy Create free account
hub / github.com/NetHack/NetHack / create_ripout_widget

Function create_ripout_widget

win/X11/wintext.c:571–616  ·  view source on GitHub ↗

* The ripout window creation routine. */

Source from the content-addressed store, hash-verified

569 * The ripout window creation routine.
570 */
571static Widget
572create_ripout_widget(Widget parent)
573{
574 Widget imageport;
575 Arg args[16];
576 Cardinal num_args;
577
578 static int rip_width, rip_height;
579
580 if (!rip_image) {
581 XpmAttributes attributes;
582 int errorcode;
583
584 attributes.valuemask = XpmCloseness;
585 attributes.closeness = 65535; /* Try anything */
586 errorcode = XpmReadFileToImage(XtDisplay(parent),
587 appResources.tombstone,
588 &rip_image, 0, &attributes);
589 if (errorcode != XpmSuccess) {
590 char buf[BUFSZ];
591
592 Sprintf(buf, "Failed to load %s: %s", appResources.tombstone,
593 XpmGetErrorString(errorcode));
594 X11_raw_print(buf);
595 return (Widget) 0;
596 }
597 rip_width = rip_image->width;
598 rip_height = rip_image->height;
599 }
600
601 num_args = 0;
602 XtSetArg(args[num_args], XtNwidth, rip_width);
603 num_args++;
604 XtSetArg(args[num_args], XtNheight, rip_height);
605 num_args++;
606 XtSetArg(args[num_args], XtNtranslations,
607 XtParseTranslationTable(rip_translations));
608 num_args++;
609
610 imageport = XtCreateManagedWidget("rip", windowWidgetClass, parent, args,
611 num_args);
612
613 XtAddCallback(imageport, XtNexposeCallback, rip_exposed, (XtPointer) 0);
614
615 return imageport;
616}
617
618#endif /* GRAPHIC_TOMBSTONE */
619

Callers 1

display_text_windowFunction · 0.85

Calls 1

X11_raw_printFunction · 0.85

Tested by

no test coverage detected