1package body agar.gui.widget.toolbar is
2
3  package cbinds is
4    function allocate
5      (parent   : widget_access_t;
6       bar_type : type_t;
7       num_rows : c.int;
8       flags    : flags_t) return toolbar_access_t;
9    pragma import (c, allocate, "AG_ToolbarNew");
10
11    procedure row
12      (toolbar  : toolbar_access_t;
13       row_name : c.int);
14    pragma import (c, row, "AG_ToolbarRow");
15  end cbinds;
16
17  function allocate
18    (parent   : widget_access_t;
19     bar_type : type_t;
20     num_rows : natural;
21     flags    : flags_t) return toolbar_access_t is
22  begin
23    return cbinds.allocate
24      (parent   => parent,
25       bar_type => bar_type,
26       num_rows => c.int (num_rows),
27       flags    => flags);
28  end allocate;
29
30  procedure row
31    (toolbar  : toolbar_access_t;
32     row_name : natural) is
33  begin
34    cbinds.row
35      (toolbar  => toolbar,
36       row_name => c.int (row_name));
37  end row;
38
39  function widget (toolbar : toolbar_access_t) return widget_access_t is
40  begin
41    return agar.gui.widget.box.widget (toolbar.box'access);
42  end widget;
43
44end agar.gui.widget.toolbar;
45