4
%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
4
%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
128
128
process_flag(trap_exit, true),
129
129
DriverWithArgs = DriverName ++ " " ++ code:priv_dir(wx) ++ [0],
131
case catch open_port({spawn, DriverWithArgs},[binary]) of
133
erlang:error({open_port,Err});
135
wx_debug_info = ets:new(wx_debug_info, [named_table]),
136
wx_non_consts = ets:new(wx_non_consts, [named_table]),
137
true = ets:insert(wx_debug_info, wxdebug_table()),
138
spawn_link(fun() -> debug_ping(Port) end),
141
true = ets:insert(wx_non_consts, List)
143
{ok, #state{cb_port=Port, driver=DriverName, users=gb_sets:empty()}}
132
Port = open_port({spawn, DriverWithArgs},[binary]),
133
wx_debug_info = ets:new(wx_debug_info, [named_table]),
134
wx_non_consts = ets:new(wx_non_consts, [named_table]),
135
true = ets:insert(wx_debug_info, wxdebug_table()),
136
spawn_link(fun() -> debug_ping(Port) end),
139
true = ets:insert(wx_non_consts, List)
141
{ok, #state{cb_port=Port, driver=DriverName, users=gb_sets:empty()}}
143
error({Err, "Could not initiate graphics"})
146
146
%%--------------------------------------------------------------------