差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
fltk:example-app-countdown_timer [2025/05/27 17:21] – [プログラムのソースコード] Remove unnecessary include headers freemikan | fltk:example-app-countdown_timer [2025/06/12 11:45] (現在) – [スクリーンショット] Remove imagebox freemikan | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== | + | ====== |
- | {{: | + | [[fltk:|{{: |
===== スクリーンショット ===== | ===== スクリーンショット ===== | ||
- | + | {{ : | |
- | {{ : | + | |
===== プロジェクトレイアウト ===== | ===== プロジェクトレイアウト ===== | ||
行 50: | 行 49: | ||
int start = 10; | int start = 10; | ||
int count = 0; | int count = 0; | ||
- | Fl_Box *countdown_digits; | + | Fl_Box *digits; |
Fl_Button *start_button; | Fl_Button *start_button; | ||
Fl_Button *reset_button; | Fl_Button *reset_button; | ||
行 58: | 行 57: | ||
AppContext *as_app_context(void *ptr) { return static_cast< | AppContext *as_app_context(void *ptr) { return static_cast< | ||
- | void update_countdown_digits_label(AppContext *ctx) { | + | void update_digits_label(AppContext *ctx) { |
ctx-> | ctx-> | ||
std:: | std:: | ||
- | ctx->countdown_digits-> | + | ctx->digits-> |
} | } | ||
行 75: | 行 74: | ||
--ctx-> | --ctx-> | ||
- | | + | |
Fl:: | Fl:: | ||
行 82: | 行 81: | ||
void start_button_cb(Fl_Widget *w, void *data) { | void start_button_cb(Fl_Widget *w, void *data) { | ||
if (!Fl:: | if (!Fl:: | ||
- | // Start pressed | + | // Start button |
Fl:: | Fl:: | ||
w-> | w-> | ||
} else { | } else { | ||
- | // Pause pressed | + | // Pause button |
Fl:: | Fl:: | ||
w-> | w-> | ||
行 95: | 行 94: | ||
auto ctx = as_app_context(data); | auto ctx = as_app_context(data); | ||
ctx-> | ctx-> | ||
- | | + | |
} | } | ||
行 101: | 行 100: | ||
auto window = new Fl_Window(300, | auto window = new Fl_Window(300, | ||
- | auto countdown_digits | + | auto digits |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
auto start_button = new Fl_Button(10, | auto start_button = new Fl_Button(10, | ||
行 115: | 行 114: | ||
.start = countdown_start, | .start = countdown_start, | ||
.count = countdown_start, | .count = countdown_start, | ||
- | .countdown_digits | + | .digits |
.start_button = start_button, | .start_button = start_button, | ||
.reset_button = reset_button, | .reset_button = reset_button, | ||
}; | }; | ||
- | | + | |
start_button-> | start_button-> | ||
reset_button-> | reset_button-> |