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

[gui] scroll utility

parent f4a60b44
No related branches found
No related tags found
No related merge requests found
...@@ -110,3 +110,11 @@ let split ~dir ?get ?set w1 w2 = ...@@ -110,3 +110,11 @@ let split ~dir ?get ?set w1 w2 =
ignore (pane#event#connect#button_release ~callback) ; ignore (pane#event#connect#button_release ~callback) ;
end ; end ;
new Wutil.gobj_widget pane 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 : ...@@ -87,3 +87,15 @@ val split :
?get:(unit -> float) -> ?get:(unit -> float) ->
?set:(float -> unit) -> ?set:(float -> unit) ->
widget -> widget -> widget 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