File: mmodal.c

package info (click to toggle)
nethack 3.4.3-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 13,512 kB
  • ctags: 16,957
  • sloc: ansic: 196,792; cpp: 7,083; sh: 6,785; yacc: 2,005; lex: 377; makefile: 120; awk: 89; sed: 11
file content (30 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (22)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*	SCCS Id: @(#)mmodal.c	3.1	93/01/24		  */
/* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */
/* NetHack may be freely redistributed.  See license for details. */

#if !TARGET_API_MAC_CARBON
# include <Dialogs.h>
# include <ControlDefinitions.h>
#else
# include <Carbon/Carbon.h>
#endif

#include "macpopup.h"

/* Flash a dialog button when its accelerator key is pressed */
void
FlashButton(DialogRef wind, short item) {
	short type;
	Handle handle;
	Rect rect;
	unsigned long ticks;

	/* Apple recommends 8 ticks */
	GetDialogItem(wind, item, &type, &handle, &rect);
	HiliteControl((ControlHandle)handle, kControlButtonPart);
	Delay(8, &ticks);
	HiliteControl((ControlHandle)handle, 0);
	return;
}