diff options
author | scratko <m@scratko.xyz> | 2024-11-12 01:23:17 +0300 |
---|---|---|
committer | scratko <m@scratko.xyz> | 2024-11-12 01:27:49 +0300 |
commit | 060fe2ebc6f5ed26c445f95b3cd6c9ee5bc24e28 (patch) | |
tree | 6a042263a2e26cbb535118a43f4a84ff47fbde25 /main.cpp | |
parent | 9023f43291b894f7670df2ffe513808ef6360954 (diff) | |
download | picture-puzzle-060fe2ebc6f5ed26c445f95b3cd6c9ee5bc24e28.tar.gz picture-puzzle-060fe2ebc6f5ed26c445f95b3cd6c9ee5bc24e28.tar.bz2 picture-puzzle-060fe2ebc6f5ed26c445f95b3cd6c9ee5bc24e28.zip |
Added menu-bar and file chooser
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,16 +1,23 @@ #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Box.H> +#include <FL/Fl_Sys_Menu_Bar.H> #include <stdlib.h> #include <time.h> #include "puzzle.hpp" #include "gameplay.hpp" +#include "menu_callbacks.hpp" int main() { srand(time(nullptr)); - Fl_Window *win = new Fl_Window(325, 325, "Picture puzzle"); + Fl_Window *win = new Fl_Window(325, 355, "Picture puzzle"); + Fl_Sys_Menu_Bar *sys_bar = new Fl_Sys_Menu_Bar(0, 0, 165, 20, nullptr); + sys_bar->add("&File/&Load picture", nullptr, load_file_callback); + sys_bar->add("&File/&Exit", nullptr, exit_callback); + sys_bar->add("&Option/&Show solution", nullptr, solve_problem_callback); + sys_bar->add("&About", nullptr, about_callback); GameParams *params = GameParams::SetUpParams(win); PuzzleGame::StartGame(params); win->show(); |