forked from malisipi/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialogs_default.c.v
42 lines (33 loc) · 1.07 KB
/
dialogs_default.c.v
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
31
32
33
34
35
36
37
38
39
40
41
42
module mui
pub fn messagebox(title string, text string, dialog_type string, icon_type string) int {
C.emscripten_run_script(cstr("alert('"+title+"\\n"+text+"')"))
return 0
}
pub fn inputbox(title string, text string, default_text string) string {
unsafe {
return C.emscripten_run_script_string(cstr("prompt('"+title+"\\n"+text+"','"+default_text+"')")).vstring()
}
}
pub fn passwordbox(title string, text string) string {
unsafe {
return C.emscripten_run_script_string(cstr("alert('"+title+"\\n"+text+"')")).vstring()
}
}
pub fn openfiledialog(title string) string {
return ""
}
pub fn savefiledialog(title string) string {
return ""
}
pub fn selectfolderdialog(title string) string {
return ""
}
pub fn colorchooser(title string, default_color string) string {
unsafe {
return C.emscripten_run_script_string(cstr("prompt('"+title+"','"+default_color+"')")).vstring()
}
}
pub fn notifypopup(title string, text string, icon_type string){
C.emscripten_run_script(cstr("alert('"+title+"\\n"+text+"')"))
}
pub fn beep(){}