# Template Canvas Scroll bars scripting

**URL:** <https://forum.inductiveautomation.com/t/template-canvas-scroll-bars-scripting/49349>\
**Category:** Ignition\
**Tags:** ignition80, vision\
**Created:** [July 29, 2021, 1:50pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scroll-bars-scripting/49349 "2021-07-29T13:50:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![meredithj](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@meredithj](https://forum.inductiveautomation.com/u/meredithj)\
**Post date:** [July 29, 2021, 1:50pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scroll-bars-scripting/49349/1 "2021-07-29T13:50:15Z")

</div>

I am using a template canvas and the templates that I am using are bigger than the view port on my screen. This is fine for what I am using it for since scroll bars are automatically added and the user can scroll the bars just fine.  
Is there a way that I can use some python or jython scripting to move my viewport to different positions of the underlaying canvas? I want to be able to move the viewport to be in different spots (ie center, upper left, lower right, etc) by clicking some buttons or when I do scripting on other parts of the screen.

Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 29, 2021, 2:15pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scroll-bars-scripting/49349/2 "2021-07-29T14:15:30Z")

</div>

> [@Scroll scrollbar to position via script](https://forum.inductiveautomation.com/t/scroll-scrollbar-to-position-via-script/15999):
>
> I've had a request from a customer to auto-scroll a template repeater to the previous scroll position as left at on the last page view. How would I go about doing this? Cheers!

this should get you started

---

<div class="post-metadata">

**Author:** ![meredithj](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@meredithj](https://forum.inductiveautomation.com/u/meredithj)\
**Post date:** [August 3, 2021, 8:21pm UTC](https://forum.inductiveautomation.com/t/template-canvas-scroll-bars-scripting/49349/3 "2021-08-03T20:21:04Z")

</div>

I ended up using this post as the basis for what I was trying to do.

> [@Using the Template Canvas as a work-around for Zoom](https://forum.inductiveautomation.com/t/using-the-template-canvas-as-a-work-around-for-zoom/42774/2):
>
> I have noticed several forum posts on similar topics: But there has only been solutions to scrollbar incrementing. This is my solution to the “focus” or “Jump-to” issue… from java.awt import Point def TemplateCanvas\_Focus(): canvas = event.source.parent.parent.getComponent("Template Canvas") #### this is the java JScrollPane class... we can use any methods associated with JScrollPane here#### scrollPane = canvas.getComponents()[2] ####this is the java JSViewport class... we can use any…
