C-Menu
0.2.9
A User Interface Toolkit
Toggle main menu visibility
Loading...
Searching...
No Matches
ui_notcurses_img.c
Go to the documentation of this file.
1
#
define
_XOPEN_SOURCE
600
2
#
include
<
notcurses
/
notcurses
.
h
>
3
#
include
<
stdio
.
h
>
4
#
include
<
unistd
.
h
>
5
6
#
ifdef
__USE_GNU_GETTEXT
7
#
include
<
libintl
.
h
>
8
#
define
_
(
String
)
gettext
(
String
)
9
#
define
gettext_noop
(
String
)
String
10
#
define
N_
(
String
)
gettext_noop
(
String
)
11
#
else
12
#
define
_
(
String
)
(
String
)
13
#
define
N_
(
String
)
String
14
#
define
textdomain
(
Domain
)
15
#
define
bindtextdomain
(
Package
,
Directory
)
16
#
endif
17
18
int
main
() {
19
struct
notcurses_options nopts = {};
20
struct
notcurses *nc = notcurses_init(&nopts, NULL);
21
if
(!nc) {
22
fprintf(stderr,
_
(
"Error: Unable to initialize notcurses.\n"
));
23
return
EXIT_FAILURE;
24
}
25
struct
ncvisual *ncv = ncvisual_from_file(
"test.png"
);
26
if
(!ncv) {
27
fprintf(stderr,
_
(
"Error: Could not load image file.\n"
));
28
goto
end;
29
}
30
struct
ncvisual_options vopts = {
31
.n = notcurses_stdplane(nc),
32
.blitter = NCBLIT_PIXEL,
33
.flags = NCVISUAL_OPTION_CHILDPLANE,
34
};
35
struct
ncplane *cn = ncvisual_blit(nc, ncv, &vopts);
36
if
(!cn)
37
goto
end;
38
notcurses_render(nc);
39
sleep(2);
40
end:
41
ncvisual_destroy(ncv);
42
notcurses_stop(nc);
43
return
0;
44
}
_
#define _(String)
Definition
amort.c:23
main
int main(int argc, char **argv)
Capture the current terminal settings for later restoration.
Definition
amort.c:41
ui
ui_notcurses_img.c
Generated by
1.17.0