Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. let a_frame = Frame.create ~relief:`Groove ~borderwidth:2 top
  2. let scry = Scrollbar.create a_frame
  3. let txt = Text.create ~width:20 ~height:4
  4. ~yscrollcommand:(Scrollbar.set scry)
  5. ~background:(`Color "#FFCB60")
  6. ~foreground:(`Color "#3F2204")
  7. a_frame ;;
  8. Scrollbar.configure ~command:(Text.yview txt) scry ;;
  9. grid ~column:0 ~row:0 [scry] ;;
  10. grid ~column:1 ~row:0 [txt] ;;
  11. let bq = Button.create
  12. ~text:"The end"
  13. ~command:(fun () ->
  14. Printf.printf
  15. "%s\n"
  16. (Text.get ~start:(`Linechar (0,0),[]) ~stop:(`End,[]) txt);
  17. flush stdout;
  18. Printf.printf "Bye.\n" ; closeTk () ; exit 0)
  19. top ;;
  20. pack [coe a_frame; coe bq]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement