ScrollBarRenderView.cs 905 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using Gtk;
  3. public class ScrollBarRenderView : Table
  4. {
  5. private RenderView renderview;
  6. public ScrollBarRenderView(RenderView renderview)
  7. : base(2, 2, false)
  8. {
  9. this.renderview = renderview;
  10. Attach(renderview, 0, 1, 0, 1,
  11. AttachOptions.Expand | AttachOptions.Fill,
  12. AttachOptions.Expand | AttachOptions.Fill, 0, 0);
  13. Adjustment hadjustment = new Adjustment(0, -10, 10, 1, 2, 2);
  14. HScrollbar hscroll = new HScrollbar(hadjustment);
  15. Attach(hscroll, 0, 1, 1, 2,
  16. AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
  17. Adjustment vadjustment = new Adjustment(0, -10, 10, 1, 2, 2);
  18. VScrollbar vscroll = new VScrollbar(vadjustment);
  19. Attach(vscroll, 1, 2, 0, 1,
  20. 0, AttachOptions.Expand | AttachOptions.Fill, 0, 0);
  21. renderview.SetAdjustments(hadjustment, vadjustment);
  22. }
  23. public RenderView Renderer {
  24. get {
  25. return renderview;
  26. }
  27. }
  28. }