First stab at supporting syntax highlighting via wxStyledTextCtrl #8

Merged
zxq9 merged 8 commits from uw-syntax-highlighting into master 2025-04-02 16:34:58 +09:00
Showing only changes of commit d4f2b3f2b0 - Show all commits

View File

@ -9,7 +9,18 @@ new(Parent, Id, Opts) ->
%% Set up the container lexer
wxStyledTextCtrl:setLexer(STC, ?wxSTC_LEX_CONTAINER),
FontSize = 13,
Mono = wxFont:new(FontSize, ?wxFONTFAMILY_TELETYPE, ?wxFONTSTYLE_NORMAL,
?wxFONTWEIGHT_NORMAL, [{face, "Monospace"}]),
lists:foreach(
fun(Style) ->
wxStyledTextCtrl:styleSetFont(STC, Style, Mono)
end,
lists:seq(0, 6)
),
%%
wxStyledTextCtrl:styleSetFont(STC, ?wxSTC_STYLE_DEFAULT, Mono),
%% Define styles
set_colors(STC),
%% Connect the styling event