Download
jcs
/wifi_da
/about.c
(View History)
jcs *: Don't add our own about menu on System 7+, simplify dialog | Latest amendment: 17 on 2023-10-24 |
1 | /* |
2 | * Copyright (c) 2023 joshua stein <jcs@jcs.org> |
3 | * |
4 | * Permission to use, copy, modify, and distribute this software for any |
5 | * purpose with or without fee is hereby granted, provided that the above |
6 | * copyright notice and this permission notice appear in all copies. |
7 | * |
8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
15 | */ |
16 | |
17 | #include "wi-fi.h" |
18 | |
19 | void |
20 | wifi_about(void) |
21 | { |
22 | DialogPtr dp; |
23 | StringHandle dast; |
24 | Rect bounds; |
25 | short hit; |
26 | Handle h; |
27 | |
28 | dp = GetNewDialog(OwnedResourceID(ABOUT_DIALOG_ID), 0L, |
29 | (WindowPtr)-1L); |
30 | |
31 | dast = (StringHandle)GetResource('dast', OwnedResourceID(0)); |
32 | ParamText("\pWi-Fi", *dast, "\p", "\p"); |
33 | DisposHandle(dast); |
34 | |
35 | center_in_screen(((DialogPeek)dp)->window.port.portRect.right, |
36 | ((DialogPeek)dp)->window.port.portRect.bottom, false, &bounds); |
37 | MoveWindow(dp, bounds.left, bounds.top, false); |
38 | SetPort(dp); |
39 | ShowWindow(dp); |
40 | |
41 | for (;;) { |
42 | ModalDialog(0, &hit); |
43 | if (hit == ok) |
44 | break; |
45 | } |
46 | |
47 | DisposDialog(dp); |
48 | } |