Skip to content

Commit

Permalink
C_Bindings: Add open folder and save file dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
malisipi committed May 12, 2023
1 parent 2c63c11 commit 6eacc7d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c_bindings/mui.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ int mui_messagebox(char* title, char* message, char* typ, char* icon);
void mui_beep();
char* mui_inputbox(char* title, char* text, char* default_text);
char* mui_openfiledialog(char* title);
char* mui_savefiledialog(char* title);
char* mui_selectfolderdialog(char* title);

#endif

Expand All @@ -95,8 +97,6 @@ char* mui_openfiledialog(char* title);
void mui_sort_widgets_with_zindex();
void mui_notifypopup();
void mui_passwordbox();
void mui_savefiledialog();
void mui_selectfolderdialog();
void mui_inputbox();
void mui_colorchooser();
*/
16 changes: 16 additions & 0 deletions c_bindings/mui.v
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,22 @@ fn mui_openfiledialog(title &char) &char {
return c""
}

[export: "mui_savefiledialog"]
fn mui_savefiledialog(title &char) &char {
unsafe {
return &char(mui.savefiledialog(title.vstring()).str)
}
return c""
}

[export: "mui_selectfolderdialog"]
fn mui_selectfolderdialog(title &char) &char {
unsafe {
return &char(mui.selectfolderdialog(title.vstring()).str)
}
return c""
}

[export: "mui_inputbox"]
fn mui_inputbox(title &char, text &char, default_text &char) &char {
unsafe {
Expand Down

0 comments on commit 6eacc7d

Please sign in to comment.