1 /* $Id: macdlg.c,v 1.2 2003/01/01 11:45:43 ben Exp $ */
3 * Copyright (c) 2002 Ben Harris
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
23 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 * macdlg.c - settings dialogue box for Mac OS.
42 void mac_newsession(void)
46 /* This should obviously be initialised by other means */
47 s
= smalloc(sizeof(*s
));
48 memset(s
, 0, sizeof(*s
));
49 do_defaults(NULL
, &s
->cfg
);
50 s
->back
= &loop_backend
;
52 s
->settings_window
= GetNewDialog(wSettings
, NULL
, (WindowPtr
)-1);
54 SetWRefCon(s
->settings_window
, (long)s
);
55 ShowWindow(s
->settings_window
);
58 void mac_activatedlg(WindowPtr window
, EventRecord
*event
)
60 DialogItemType itemtype
;
66 active
= (event
->modifiers
& activeFlag
) != 0;
67 GetDialogItem(window
, wiSettingsOpen
, &itemtype
, &itemhandle
, &itemrect
);
68 HiliteControl((ControlHandle
)itemhandle
, active ?
0 : 255);
69 DialogSelect(event
, &window
, &item
);
72 void mac_clickdlg(WindowPtr window
, EventRecord
*event
)
75 Session
*s
= (Session
*)GetWRefCon(window
);
77 if (DialogSelect(event
, &window
, &item
))
88 * c-file-style: "simon"