Skip to content

Commit

Permalink
Fix process_form example
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed May 10, 2024
1 parent 0e0fd28 commit d045fa5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ class main_form : public form {
open_gammasoft_png_file_button.text("Open \"gammasoft.png\" file...");
open_gammasoft_png_file_button.click += [] {
images::from_name("gammasoft", drawing::size(512, 512)).save(path::combine(path::get_temp_path(), "gammasoft.png"));
process::start(process_start_info("gammasoft.png").working_directory(path::get_temp_path()));
process::start(process_start_info {"gammasoft.png"}.working_directory(path::get_temp_path()));
};

open_calculator_button.image(button_images::from_name("accessories-calculator", drawing::size(64, 64)));
open_calculator_button.image_align(content_alignment::middle_left);
open_calculator_button.text("Launch Calculator...");
open_calculator_button.click += [] {
if (environment::os_version().is_windows()) process::start("calc");
else if (environment::os_version().is_macos()) process::start("Calculator");
else if (environment::os_version().is_linux()) process::start("gnome-calculator");
if (environment::os_version().is_windows()) process::start(process_start_info {"calc"}.use_shell_execute(false));
else if (environment::os_version().is_macos()) process::start(process_start_info {"Calculator"});
else if (environment::os_version().is_linux()) process::start(process_start_info {"gnome-calculator"}.use_shell_execute(false));
else throw invalid_operation_exception("Calculator application unknown.");
};
}
Expand Down

0 comments on commit d045fa5

Please sign in to comment.