1package body agar.gui.widget.ucombo is 2 3 package cbinds is 4 function allocate_polled 5 (parent : widget_access_t; 6 flags : flags_t; 7 callback : agar.core.event.callback_t; 8 fmt : agar.core.types.void_ptr_t) return ucombo_access_t; 9 pragma import (c, allocate_polled, "AG_UComboNewPolled"); 10 11 procedure size_hint 12 (ucombo : ucombo_access_t; 13 text : cs.chars_ptr; 14 items : c.int); 15 pragma import (c, size_hint, "AG_UComboSizeHint"); 16 17 procedure size_hint_pixels 18 (ucombo : ucombo_access_t; 19 width : c.int; 20 height : c.int); 21 pragma import (c, size_hint_pixels, "AG_UComboSizeHintPixels"); 22 end cbinds; 23 24 function allocate_polled 25 (parent : widget_access_t; 26 flags : flags_t; 27 callback : agar.core.event.callback_t) return ucombo_access_t is 28 begin 29 return cbinds.allocate_polled 30 (parent => parent, 31 flags => flags, 32 callback => callback, 33 fmt => agar.core.types.null_ptr); 34 end allocate_polled; 35 36 procedure size_hint 37 (ucombo : ucombo_access_t; 38 text : string; 39 items : natural) 40 is 41 c_text : aliased c.char_array := c.to_c (text); 42 begin 43 cbinds.size_hint 44 (ucombo => ucombo, 45 text => cs.to_chars_ptr (c_text'unchecked_access), 46 items => c.int (items)); 47 end size_hint; 48 49 procedure size_hint_pixels 50 (ucombo : ucombo_access_t; 51 width : natural; 52 height : natural) is 53 begin 54 cbinds.size_hint_pixels 55 (ucombo => ucombo, 56 width => c.int (width), 57 height => c.int (height)); 58 end size_hint_pixels; 59 60 -- 61 62 function widget (ucombo : ucombo_access_t) return widget_access_t is 63 begin 64 return ucombo.widget'access; 65 end widget; 66 67end agar.gui.widget.ucombo; 68