-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSecret_Input.cpp
More file actions
29 lines (25 loc) · 831 Bytes
/
Secret_Input.cpp
File metadata and controls
29 lines (25 loc) · 831 Bytes
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
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Secret_Input.H>
#include <FL/Fl_Window.H>
namespace Examples {
class Main_Window : public Fl_Window {
public:
Main_Window() : Fl_Window {200, 100, 300, 300, "Secret input example"} {
input1.value("123456");
input1.when(FL_WHEN_CHANGED);
input1.callback([](Fl_Widget* sender, void* window) {
reinterpret_cast<Main_Window*>(window)->box1.label(reinterpret_cast<Main_Window*>(window)->input1.value());
}, this);
box1.align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
}
private:
Fl_Secret_Input input1 {10, 10, 100, 25};
Fl_Box box1 {10, 50, 100, 25, "123456"};
};
}
auto main(int argc, char *argv[]) -> int {
auto window = Examples::Main_Window {};
window.show(argc, argv);
return Fl::run();
}