Mercurial Hosting > editor
comparison src/luan_editor/menu.luan @ 64:1c68552e8ac2
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 05 Jun 2025 12:48:30 -0600 |
parents | 7e2d6426c155 |
children |
comparison
equal
deleted
inserted
replaced
63:f9ce379de456 | 64:1c68552e8ac2 |
---|---|
16 local get_all_frames = Frame.get_all_frames or error() | 16 local get_all_frames = Frame.get_all_frames or error() |
17 local Spell_checker = require "classpath:luan_editor/Spell_checker.luan" | 17 local Spell_checker = require "classpath:luan_editor/Spell_checker.luan" |
18 local spell_check = Spell_checker.spell_check or error() | 18 local spell_check = Spell_checker.spell_check or error() |
19 local Window = require "classpath:luan_editor/Window.luan" | 19 local Window = require "classpath:luan_editor/Window.luan" |
20 local show_list_window = Window.show_list_window or error() | 20 local show_list_window = Window.show_list_window or error() |
21 local new_window = Window.new_window or error() | |
21 | 22 |
22 | 23 |
23 local function action_listener(fn) | 24 local function action_listener(fn) |
24 return function(_) | 25 return function(_) |
25 fn() | 26 fn() |
75 text = "File" | 76 text = "File" |
76 menu_items = { | 77 menu_items = { |
77 new_menu_item{ | 78 new_menu_item{ |
78 text = "New File" | 79 text = "New File" |
79 accelerator = "N" | 80 accelerator = "N" |
80 action_listener = action_listener(window.new) | 81 action_listener = action_listener(new_window) |
81 } | 82 } |
82 new_menu_item{ | 83 new_menu_item{ |
83 text = "Open..." | 84 text = "Open..." |
84 accelerator = "O" | 85 accelerator = "O" |
85 action_listener = action_listener(window.open) | 86 action_listener = action_listener(window.open) |
99 action_listener = action_listener(text_area.print) | 100 action_listener = action_listener(text_area.print) |
100 } | 101 } |
101 revert | 102 revert |
102 new_menu_item{ | 103 new_menu_item{ |
103 text = "Paste File(s)" | 104 text = "Paste File(s)" |
105 accelerator = "P" | |
104 action_listener = function(_) | 106 action_listener = function(_) |
105 if not window.paste_files() then | 107 if not window.paste_files() then |
106 show_message_dialog(nil,"No files to paste") | 108 show_message_dialog(nil,"No files to paste") |
107 end | 109 end |
108 end | 110 end |