1%% 2%% %CopyrightBegin% 3%% 4%% Copyright Ericsson AB 2017. All Rights Reserved 5%% 6%% Licensed under the Apache License, Version 2.0 (the "License"); 7%% you may not use this file except in compliance with the License 8%% You may obtain a copy of the License at 9%% 10%% http://www.apache.org/licenses/LICENSE-2.0 11%% 12%% Unless required by applicable law or agreed to in writing, software 13%% distributed under the License is distributed on an "AS IS" BASIS, 14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied 15%% See the License for the specific language governing permissions and 16%% limitations under the License 17%% 18%% %CopyrightEnd% 19%% 20-module(wx_oc_object). 21-include_lib("wx/include/wx.hrl"). 22 23%%-behaviour(wx_object). %% commented out avoid warnings 24 25%% wx_object callbacks 26-export([init/1]). 27 28-record(state, {}). 29 30init([]) -> 31 Init = fun() -> 32 Frame0 = wxFrame:new(wx:null(), ?wxID_ANY, "Test wx_object", [{size, {500, 400}}]), 33 Frame = wx_object:set_pid(Frame0, self()), 34 Sz = wxBoxSizer:new(?wxHORIZONTAL), 35 Panel = wxPanel:new(Frame), 36 wxSizer:add(Sz, Panel, [{flag, ?wxEXPAND}, {proportion, 1}]), 37 wxWindow:show(Frame), 38 {Frame, {Frame, Panel}} 39 end, 40 {Obj, _UserState} = Init(), 41 {Obj, #state{}}; 42init([Init]) -> 43 {Obj, _UserState} = Init(), 44 {Obj, #state{}}. 45