~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/wx/test/wx_class_SUITE.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2010-03-09 17:34:57 UTC
  • mfrom: (10.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100309173457-4yd6hlcb2osfhx31
Tags: 1:13.b.4-dfsg-3
Manpages in section 1 are needed even if only arch-dependent packages are
built. So, re-enabled them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 2008-2010. All Rights Reserved.
 
5
%%
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
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%%-------------------------------------------------------------------
19
19
%%% File    : wx_class_SUITE.erl
113
113
    Frame = wxFrame:new(Wx, ?wxID_ANY, "Frame"),
114
114
    Panel = wxPanel:new(Frame, []),
115
115
    Tree = ?mt(wxTreeCtrl,wxTreeCtrl:new(Panel, [{style , ?wxTR_HAS_BUTTONS}])),
116
 
    Root = ?mt(wxTreeItemId, wxTreeCtrl:addRoot(Tree, "Root", [])),
117
 
    Item1 = ?mt(wxTreeItemId, wxTreeCtrl:appendItem(Tree, Root, "Item1", [])),
118
 
    ?m(ok, wxTreeCtrl:setItemData(Tree, Item1, {data, item1})),
119
 
    Item2 = ?mt(wxTreeItemId, wxTreeCtrl:appendItem(Tree, Root, "Item2", [])),
120
 
    ?m(ok, wxTreeCtrl:setItemData(Tree, Item2, {data, item2})),
121
 
    Item3 = ?mt(wxTreeItemId, wxTreeCtrl:appendItem(Tree, Root, "Item3", [])),
 
116
    Root = wxTreeCtrl:addRoot(Tree, "Root", []),
 
117
    ?m(true, is_integer(Root)),
 
118
    Item1 = wxTreeCtrl:appendItem(Tree, Root, "Item1", []),
 
119
    ?m(true, is_integer(Item1)),
 
120
    ?m(ok,  wxTreeCtrl:setItemData(Tree, Item1, {data, item1})),
 
121
    Item2 = wxTreeCtrl:appendItem(Tree, Root, "Item2", []),
 
122
    ?m(ok,  wxTreeCtrl:setItemData(Tree, Item2, {data, item2})),
 
123
    Item3 = wxTreeCtrl:appendItem(Tree, Root, "Item3", []),
122
124
    ?m(ok, wxTreeCtrl:setItemData(Tree, Item3, {data, item3})),
123
125
    
124
126
    Sizer = wxBoxSizer:new(?wxVERTICAL),
359
361
    Time = timer:tc(erlang, apply, [Sort,[]]),
360
362
    io:format("Sorted ~p ~n",[Time]),
361
363
    
 
364
    Item = wxListItem:new(),
 
365
    _List = wx:map(fun(Int) ->
 
366
                           wxListItem:setId(Item, Int),
 
367
                           ?m(true, wxListCtrl:getItem(LC, Item)),
 
368
                           io:format("~s~n",[wxListItem:getText(Item)])
 
369
                   end, lists:seq(0,100)),
 
370
    wxListItem:destroy(Item),
 
371
 
362
372
    wx_test_lib:wx_destroy(Frame,Config).
363
373
 
364
374
 
373
383
    io:format("TrSortRadioBox ~p ~n", [TrSortRadioBox]),
374
384
    %% If I uncomment any of these lines, it will crash
375
385
 
376
 
    ?m(_, catch wxControlWithItems:setClientData(TrSortRadioBox, 0, timestamp)),
 
386
    io:format("~p~n", [catch wxControlWithItems:setClientData(TrSortRadioBox, 0, timestamp)]),
377
387
    %?m(_, wxListBox:append(TrSortRadioBox, "Session Id", session_id)),
378
388
    %?m(_, wxListBox:insert(TrSortRadioBox, "Session Id", 0, session_id)),
379
389