Skip to content
Snippets Groups Projects
Commit e7aa956c authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[gui] scroll utility

parent 1cc4e488
No related branches found
No related tags found
No related merge requests found
......@@ -110,3 +110,11 @@ let split ~dir ?get ?set w1 w2 =
ignore (pane#event#connect#button_release ~callback) ;
end ;
new Wutil.gobj_widget pane
let scroll ?(hpolicy=`AUTOMATIC) ?(vpolicy=`AUTOMATIC) w =
let scrolled = GBin.scrolled_window ~vpolicy ~hpolicy () in
scrolled#add_with_viewport w#coerce ;
new Wutil.gobj_widget scrolled
let hscroll w = scroll ~vpolicy:`NEVER w
let vscroll w = scroll ~hpolicy:`NEVER w
......@@ -87,3 +87,15 @@ val split :
?get:(unit -> float) ->
?set:(float -> unit) ->
widget -> widget -> widget
(** default policy is AUTOMATIC *)
val scroll:
?hpolicy:[`AUTOMATIC|`ALWAYS|`NEVER] ->
?vpolicy:[`AUTOMATIC|`ALWAYS|`NEVER] ->
widget -> widget
(** Same as [scroll ~vpolicy:`NEVER] *)
val hscroll : widget -> widget
(** Same as [scroll ~volicy:`NEVER] *)
val vscroll : widget -> widget
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment