diff options
author | Dan Gudmundsson <[email protected]> | 2014-01-27 14:23:15 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-01-27 14:23:15 +0100 |
commit | 75bfbe5a61fa1a1dd204fdb21dc4bf7df8e8003d (patch) | |
tree | cedea2151cdc673bddfe541cf4956c5fd6b431ab /lib/wx/test/wx_event_SUITE.erl | |
parent | c922ea6f82bb3d95d05d1f212b91e13f97e972b8 (diff) | |
parent | fd055cf43486358a413a1fa22f30f0aa711d25e1 (diff) | |
download | otp-75bfbe5a61fa1a1dd204fdb21dc4bf7df8e8003d.tar.gz otp-75bfbe5a61fa1a1dd204fdb21dc4bf7df8e8003d.tar.bz2 otp-75bfbe5a61fa1a1dd204fdb21dc4bf7df8e8003d.zip |
Merge branch 'dgud/wx/refactor-and-bugfixes/OTP-11586'
* dgud/wx/refactor-and-bugfixes/OTP-11586:
wx: Delay all deletes if recursed in event loop
wx: wx could hang if wxe_server died (or had died) when inside a callback
wx: Delay memory cleanup until safe
wx: Refactor C++ code
wx: Add init_dialog event
Update icons
wx: Update icons to plain old white ones
Diffstat (limited to 'lib/wx/test/wx_event_SUITE.erl')
-rw-r--r-- | lib/wx/test/wx_event_SUITE.erl | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/lib/wx/test/wx_event_SUITE.erl b/lib/wx/test/wx_event_SUITE.erl index bbb5294d08..b9c2fafe0e 100644 --- a/lib/wx/test/wx_event_SUITE.erl +++ b/lib/wx/test/wx_event_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2013. All Rights Reserved. +%% Copyright Ericsson AB 2008-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -48,7 +48,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [connect, disconnect, connect_msg_20, connect_cb_20, mouse_on_grid, spin_event, connect_in_callback, recursive, - char_events, callback_clean + dialog, char_events, callback_clean ]. groups() -> @@ -402,6 +402,42 @@ recursive(Config) -> wx_test_lib:wx_destroy(Frame, Config). +dialog(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); +dialog(Config) -> + Wx = wx:new(), + Frame = wxFrame:new(Wx, ?wxID_ANY, "Testing"), + wxFrame:show(Frame), + Env = wx:get_env(), + Tester = self(), + PD = wxProgressDialog:new("Dialog","Testing", + [%%{parent, Frame}, + {maximum,101}, + {style, ?wxPD_SMOOTH bor ?wxPD_AUTO_HIDE}]), + Forward = fun(#wx{event=#wxInitDialog{}}, Ev) -> + ?mt(wxInitDialogEvent, Ev), + io:format("Heyhoo~n", []), + wxEvent:skip(Ev), + Tester ! {progress_dialog,PD} + end, + wxDialog:connect(PD, init_dialog, [{callback, Forward}]), + Recurse = fun(Recurse, N) -> + true = wxProgressDialog:update(PD, min(N,100)), + timer:sleep(5), + Recurse(Recurse,N+1) + end, + Run = fun() -> + wx:set_env(Env), + Recurse(Recurse, 0) + end, + Worker = spawn_link(Run), + timer:sleep(500), + io:format("Got ~p~n", [wx_test_lib:flush()]), + unlink(Worker), + wxProgressDialog:destroy(PD), + wx_test_lib:wx_destroy(Frame, Config). + + + char_events(TestInfo) when is_atom(TestInfo) -> wx_test_lib:tc_info(TestInfo); char_events(Config) -> Wx = wx:new(), |