diff options
author | Dan Gudmundsson <[email protected]> | 2012-12-21 11:51:31 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2013-01-09 11:44:29 +0100 |
commit | 7108397ed9bccfc4cf9ace23f0d29dc3e69b31da (patch) | |
tree | be3f2d08eedea09a141a0a7330018c397f5d980d /lib/wx/examples/demo/demo.erl | |
parent | c722d65fbd9be59bd8698149e3cc1a98096fc345 (diff) | |
download | otp-7108397ed9bccfc4cf9ace23f0d29dc3e69b31da.tar.gz otp-7108397ed9bccfc4cf9ace23f0d29dc3e69b31da.tar.bz2 otp-7108397ed9bccfc4cf9ace23f0d29dc3e69b31da.zip |
wx: Fix demo and tests
Added debugging and workarounds for wx-2.9 on Mac
Diffstat (limited to 'lib/wx/examples/demo/demo.erl')
-rw-r--r-- | lib/wx/examples/demo/demo.erl | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/wx/examples/demo/demo.erl b/lib/wx/examples/demo/demo.erl index 76ebc804bb..2f560096f5 100644 --- a/lib/wx/examples/demo/demo.erl +++ b/lib/wx/examples/demo/demo.erl @@ -32,6 +32,21 @@ -record(state, {win, demo, example, selector, log, code}). +%% For wx-2.9 usage +-ifndef(wxSTC_ERLANG_COMMENT_FUNCTION). +-define(wxSTC_ERLANG_COMMENT_FUNCTION, 14). +-define(wxSTC_ERLANG_COMMENT_MODULE, 15). +-define(wxSTC_ERLANG_COMMENT_DOC, 16). +-define(wxSTC_ERLANG_COMMENT_DOC_MACRO, 17). +-define(wxSTC_ERLANG_ATOM_QUOTED, 18). +-define(wxSTC_ERLANG_MACRO_QUOTED, 19). +-define(wxSTC_ERLANG_RECORD_QUOTED, 20). +-define(wxSTC_ERLANG_NODE_NAME_QUOTED, 21). +-define(wxSTC_ERLANG_BIFS, 22). +-define(wxSTC_ERLANG_MODULES, 23). +-define(wxSTC_ERLANG_MODULES_ATT, 24). +-endif. + start() -> start([]). @@ -268,8 +283,9 @@ handle_event(Ev,State) -> code_change(_, _, State) -> {stop, not_yet_implemented, State}. -terminate(_Reason, State) -> +terminate(_Reason, State = #state{win=Frame}) -> catch wx_object:call(State#state.example, shutdown), + wxFrame:destroy(Frame), wx:destroy(). %%%%%%%%%%%%%%%%% Internals %%%%%%%%%% @@ -312,7 +328,20 @@ code_area(Parent) -> {?wxSTC_ERLANG_MACRO, {40,144,170}}, {?wxSTC_ERLANG_RECORD, {40,100,20}}, {?wxSTC_ERLANG_SEPARATOR,{0,0,0}}, - {?wxSTC_ERLANG_NODE_NAME,{0,0,0}}], + {?wxSTC_ERLANG_NODE_NAME,{0,0,0}}, + %% Optional 2.9 stuff + {?wxSTC_ERLANG_COMMENT_FUNCTION, {160,53,35}}, + {?wxSTC_ERLANG_COMMENT_MODULE, {160,53,35}}, + {?wxSTC_ERLANG_COMMENT_DOC, {160,53,35}}, + {?wxSTC_ERLANG_COMMENT_DOC_MACRO, {160,53,35}}, + {?wxSTC_ERLANG_ATOM_QUOTED, {0,0,0}}, + {?wxSTC_ERLANG_MACRO_QUOTED, {40,144,170}}, + {?wxSTC_ERLANG_RECORD_QUOTED, {40,100,20}}, + {?wxSTC_ERLANG_NODE_NAME_QUOTED, {0,0,0}}, + {?wxSTC_ERLANG_BIFS, {130,40,172}}, + {?wxSTC_ERLANG_MODULES, {64,102,244}}, + {?wxSTC_ERLANG_MODULES_ATT, {64,102,244}} + ], SetStyle = fun({Style, Color}) -> ?stc:styleSetFont(Ed, Style, FixedFont), ?stc:styleSetForeground(Ed, Style, Color) |