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

« back to all changes in this revision

Viewing changes to lib/appmon/src/appmon_lb.erl

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
%%     $Id$
17
17
%%
18
18
 
19
 
%%% Due to the fact that the application buttons in the appmon window gets
20
 
%%% too small to read when the number of applications increases, this 
21
 
%%% listbox window has been created. 
22
 
%%% Because of the limitations of GS a listbox was chosen to keep the nodes
23
 
%%% and applications. When it's possible to scroll a frame I think one should
24
 
%%% put in scrollbars in the appmon main window. The listbox solution is to
25
 
%%% slow with lots of applications.
 
19
%%% Due to the fact that the application buttons in the appmon window
 
20
%%% gets too small to read when the number of applications increases,
 
21
%%% this listbox window has been created. 
 
22
%%% Because of the limitations of GS a listbox was chosen to keep
 
23
%%% the nodes and applications. When it's possible to scroll a frame I
 
24
%%% think one should put in scrollbars in the appmon main window.
 
25
%%% The listbox solution is too slow with lots of applications.
26
26
%%%
27
27
%%% In the listbox the nodes are shown with their applications beneith.
28
 
%%% By double clicking on an application name, or a single click and then 
29
 
%%% pressing the load button, its application window is started.
30
 
%%% 
31
 
%%% 
32
 
 
 
28
%%% By double clicking on an application name, or a single click and
 
29
%%% then pressing the load button, its application window is started.
33
30
 
34
31
-module(appmon_lb).
35
32
 
336
333
            NewWin = configure (Win#win.pid, W, H),
337
334
            loop (NewWin, Data);
338
335
 
339
 
        {gs, lb, doubleclick, _, Txt} ->
 
336
        {gs, lb, doubleclick, _, _Txt} ->
340
337
            load_app (gs:read (lb, selection), Data),
341
338
            loop (Win, Data);
342
339
            
343
 
        {gs, lb, click, _, Txt} ->
 
340
        {gs, lb, click, _, _Txt} ->
344
341
            loop (Win, Data);
345
342
 
346
343
        {gs, close, click, _D, _Arg} -> 
353
350
            end,
354
351
            loop (#win{}, Data);
355
352
 
356
 
        {gs, load, click, _D, Txt} ->
 
353
        {gs, load, click, _D, _Txt} ->
357
354
            load_app (gs:read (lb, selection), Data),
358
355
            loop (Win, Data);
359
356
        
360
 
        {gs, clear, click, _D, Txt} ->
 
357
        {gs, clear, click, _D, _Txt} ->
361
358
            gs:config (lb, {selection, clear}),
362
359
            loop (Win, Data);
363
360
        
378
375
                               {y, Y},
379
376
                               {width, ?WIN_W},
380
377
                               {height, ?WIN_H},
381
 
                               {title, "Appmon: nodes and applications"},
 
378
                               {title,"Appmon: nodes and applications"},
382
379
                               {configure, true}]),
383
380
 
384
381
    gs:listbox (lb, Win, [{x, 5},
455
452
 
456
453
add_apps_1 (Apps, Node, Data) ->
457
454
    case lists:keysearch (Node, #node.node, Data) of
458
 
        {value, Node_rec} ->
 
455
        {value, _Node_rec} ->
459
456
            NewApps = parse_apps (Apps, []),
460
457
            lists:keyreplace (Node, #node.node, 
461
458
                              Data, new_node (Node, NewApps));
478
475
        {value, Node_rec} ->
479
476
            L = Node_rec#node.apps,
480
477
            L2 = lists:keydelete (App, #app.app, L),
481
 
            lists:keyreplace (Node, #node.node, Data, new_node (Node, L2));
 
478
            lists:keyreplace(Node, #node.node, Data, new_node(Node,L2));
482
479
        
483
480
        _false ->
484
481
            Data
549
546
            lists:keyreplace (Node, 
550
547
                              #node.node, 
551
548
                              Data, 
552
 
                              new_node (Node, Status, Node_rec#node.apps));
 
549
                              new_node(Node,Status,Node_rec#node.apps));
553
550
 
554
551
        _not_found ->
555
552
            Data
562
559
%%% update updates the listbox with new data.
563
560
%%%
564
561
 
565
 
update (Data, win_closed) ->
 
562
update (_Data, win_closed) ->
566
563
    true;
567
564
 
568
565
update (Data, _Win) ->