diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-21 15:23:38 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-21 15:23:38 +0100 |
| commit | e466fe20c84ae17facd62c71de767603705be424 (patch) | |
| tree | ceb442699c0db687abc89323c9e7ee24d802777d /src/Fl_Input.cxx | |
| parent | 42ff55026e98d6ed6ebf891434afdd03b1a52e02 (diff) | |
Fix "Fl_Input popup menu customize doesn't work" (#874)
Diffstat (limited to 'src/Fl_Input.cxx')
| -rw-r--r-- | src/Fl_Input.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 44aabd7dc..3fa2c707b 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -52,9 +52,9 @@ const char *Fl_Input::copy_menu_text = "Copy"; const char *Fl_Input::paste_menu_text = "Paste"; static Fl_Menu_Item rmb_menu[] = { - { Fl_Input::cut_menu_text, 0, NULL, (void*)1 }, - { Fl_Input::copy_menu_text, 0, NULL, (void*)2 }, - { Fl_Input::paste_menu_text, 0, NULL, (void*)3 }, + { NULL, 0, NULL, (void*)1 }, + { NULL, 0, NULL, (void*)2 }, + { NULL, 0, NULL, (void*)3 }, { NULL } }; @@ -763,6 +763,9 @@ int Fl_Input::handle(int event) { */ Fl_Input::Fl_Input(int X, int Y, int W, int H, const char *l) : Fl_Input_(X, Y, W, H, l) { + if (!rmb_menu[0].label()) rmb_menu[0].label(Fl_Input::cut_menu_text); + if (!rmb_menu[1].label()) rmb_menu[1].label(Fl_Input::copy_menu_text); + if (!rmb_menu[2].label()) rmb_menu[2].label(Fl_Input::paste_menu_text); } |
