added osdialog example

This commit is contained in:
Alexander Popov 2024-06-04 00:45:55 +03:00
parent ec0a08b198
commit 7b56082251
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
7 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,6 @@
# xmake
.xmake/
build/
# 3rd party
third/

View File

@ -0,0 +1 @@
https://github.com/AndrewBelt/osdialog.git

View File

@ -0,0 +1 @@
../third/osdialog/osdialog.h

View File

@ -0,0 +1,18 @@
#include <stdio.h>
#include "osdialog.h"
int main(int argc, char const *argv[]) {
int res;
res = osdialog_message(OSDIALOG_INFO, OSDIALOG_OK, "Info こんにちは");
printf("Result: %d\n", res);
res = osdialog_message(OSDIALOG_WARNING, OSDIALOG_OK_CANCEL, "Warning こんにちは");
printf("Result: %d\n", res);
res = osdialog_message(OSDIALOG_ERROR, OSDIALOG_YES_NO, "Error こんにちは");
printf("Result: %d\n", res);
return 0;
}

View File

@ -0,0 +1 @@
../third/osdialog/osdialog.c

View File

@ -0,0 +1 @@
../third/osdialog/osdialog_zenity.c

View File

@ -0,0 +1,9 @@
set_project("osdialog-example")
set_languages("c99")
add_rules("mode.release")
add_includedirs("include")
target("osdialog-example")
set_kind("binary")
add_files("src/*.c")