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_Text_Display.cxx | |
| parent | 42ff55026e98d6ed6ebf891434afdd03b1a52e02 (diff) | |
Fix "Fl_Input popup menu customize doesn't work" (#874)
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index b2f748411..66a514f68 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -85,6 +85,13 @@ static int scroll_amount = 0; static int scroll_y = 0; static int scroll_x = 0; +static Fl_Menu_Item rmb_menu[] = { + { NULL, 0, NULL, (void*)1 }, + { NULL, 0, NULL, (void*)2 }, + { NULL, 0, NULL, (void*)3 }, + { NULL } +}; + // CET - FIXME #define TMPFONTWIDTH 6 @@ -189,6 +196,10 @@ Fl_Text_Display::Fl_Text_Display(int X, int Y, int W, int H, const char* l) set_flag(SHORTCUT_LABEL); clear_flag(NEEDS_KEYBOARD); + 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); + end(); } @@ -4069,12 +4080,6 @@ void Fl_Text_Display::scroll_timer_cb(void *user_data) { Fl::repeat_timeout(.1, scroll_timer_cb, user_data); } -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 } -}; /** Handle right mouse button down events. \return 0 for no op, 1 to cut, 2 to copy, 3 to paste |
