5 class multibox ~rows ~columns ?(row_view = rows) ?(col_view = columns)
8 GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC
10 let vp = GBin.viewport ~shadow_type:`NONE ~packing:sw#add in
12 GPack.table ~columns ~rows ~homogeneous:true ~packing:vp#add () in
14 Array.init ~len:columns
15 ~f:(fun left -> Array.init ~len:rows
16 ~f:(fun top -> GButton.button
17 ~packing:(table#attach ~top ~left ~expand:`BOTH)))
20 inherit widget sw#as_widget
21 method cell ~col ~row = buttons.(col).(row)
25 (sw#event#connect#expose ~after:true ~callback:
27 may !id ~f:sw#connect#disconnect;
28 let height = table#misc#allocation.height * row_view / rows
29 and width = table#misc#allocation.width * col_view / columns in
30 vp#misc#set_size ~height ~width;
33 table#focus#set_vadjustment vp#vadjustment