From 13d616c9302a1c9404479c27dde509319fc4f604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwena=EBl=20Delaval?= Date: Tue, 29 Oct 2013 16:48:34 +0100 Subject: [PATCH] Scrollbars on inputs/outputs of hepts Allowed shrinking hepts main window and added scrollbars on frames for inputs and outputs. --- compiler/main/hepts.ml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/compiler/main/hepts.ml b/compiler/main/hepts.ml index 669e6f1..d1dd2aa 100644 --- a/compiler/main/hepts.ml +++ b/compiler/main/hepts.ml @@ -380,24 +380,28 @@ let main () = ignore (GMain.init ()); (* main windows *) - let win = GWindow.window ~title:(!node_name ^ " - commands") () in + let win = GWindow.window ~allow_shrink:true ~title:(!node_name ^ " - commands") () in let box = GPack.vbox ~packing:win#add () in - let up_part = GPack.vbox ~packing:box#add () in - let mid_part = GPack.hbox ~packing:box#add () in - let period_part = GPack.hbox ~packing:box#add () in - let low_part = GPack.button_box `HORIZONTAL ~packing:box#add () in + let up_part = GPack.paned `VERTICAL ~packing:(box#pack ~expand:true) () in + let mid_part = GPack.hbox ~packing:(box#pack ~expand:false) () in + let period_part = GPack.hbox ~packing:(box#pack ~expand:false) () in + let low_part = GPack.button_box `HORIZONTAL ~packing:(box#pack ~expand:false) () in (* Input frame *) - let in_frame = GBin.frame ~label:"Inputs" ~packing:up_part#add () in + let in_frame = GBin.frame ~label:"Inputs" ~packing:up_part#add1 () in + let scroll_in = + GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC ~packing:in_frame#add () in let input_frame = GPack.table ~columns:3 ~rows:nb_inputs - ~packing:in_frame#add () in + ~packing:scroll_in#add_with_viewport () in (* Output frame *) - let out_frame = GBin.frame ~label:"Outputs" ~packing:up_part#add () in + let out_frame = GBin.frame ~label:"Outputs" ~packing:up_part#add2 () in + let scroll_out = + GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC ~packing:out_frame#add () in (* let output_frame = GPack.table ~row_spacings:0 ~border_width:1 ~columns:2 ~rows:nb_outputs *) (* ~packing:out_frame#add () in *) let output_frame = GPack.table ~columns:2 ~rows:nb_outputs - ~packing:out_frame#add () in + ~packing:scroll_out#add_with_viewport () in (* Step label *) let step_label = GMisc.label ~text:"Step: -" ~packing:mid_part#add () in