# TSlider creating a slider with no sliding space!

**URL:** <https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000>\
**Category:** Newbie\
**Created:** [May 17, 2022, 12:06pm UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000 "2022-05-17T12:06:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [May 17, 2022, 12:06pm UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000/1 "2022-05-17T12:06:31Z")

</div>

Hello,

I was trying to recreate the TSlider example posted here: [classTSlider.html](https://root.cern.ch/doc/master/classTSlider.html). I slightly modified the `xyslider.C` macro. The code is attached here.

[xyslider.C](https://root-forum.cern.ch/uploads/short-url/wSgbQbIcHecuBMIGRGf8P8brYf.C) (729 Bytes)  
[action.C](https://root-forum.cern.ch/uploads/short-url/rQFHhxVLD2kYH78MQlVYIfyVQ52.C) (441 Bytes)

Here is the comparison of output for both files.

 ![Screenshot from 2022-05-17 09-00-28](https://root-forum.cern.ch/uploads/default/original/3X/e/a/eaf2781c254caba36a3dc0456a8ca571a4157e10.png)

As you can notice there is no sliding space in my plot. Also, the code I attached is almost identical to what is posted on the website. I only changed the histogram part.

I am new to ROOT so I don’t know how to solve it. Please help.

Thank you.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 17, 2022, 1:03pm UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000/3 "2022-05-17T13:03:53Z")

</div>

I tried. Indeed it works for me.  
Pick the extreme of the slider and reduce it.

---

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [May 18, 2022, 3:26pm UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000/4 "2022-05-18T15:26:02Z")

</div>

I don’t know why but it didn’t work for me. Maybe it is because my computer screen resolution is different. Can you please suggest to me some other GUI which can take input from the canvas?

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 18, 2022, 3:28pm UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000/5 "2022-05-18T15:28:07Z")

</div>

If you want to zoom on the X and Y axis you do not need any additional GUI. Slide the axis themselves.

---

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [May 19, 2022, 5:15am UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000/6 "2022-05-19T05:15:13Z")

</div>

In my original script, I want the slider to vary the TLine() on the plot. I don’t want to do it manually because it takes time.

This TLine() I am using to highlight the cuts on the histogram.

Please help to solve this. It would be very helpful.

Thanks.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [May 19, 2022, 6:16am UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000/7 "2022-05-19T06:16:07Z")

</div>

For me all is fine. when I execute the example [here](https://root.cern/doc/master/classTSlider.html). I get:

 ![Screenshot 2022-05-19 at 08.13.50](https://root-forum.cern.ch/uploads/default/original/3X/d/9/d9080335945f70ab66c21a81b067c82492fb349f.png)  
Then I can grab the right side of the slider and reduce it. I get:  
 ![Screenshot 2022-05-19 at 08.14.03](https://root-forum.cern.ch/uploads/default/original/3X/4/e/4e8c318d9fb5a4db16928f45964eeda33bb6369a.png)  
And I can move it easily .  
Sorry, but I do not see any problem.

---

<div class="post-metadata">

**Author:** ![Divyang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/7ea924/32.png) [@Divyang](https://root-forum.cern.ch/u/Divyang)\
**Post date:** [May 19, 2022, 6:58pm UTC](https://root-forum.cern.ch/t/tslider-creating-a-slider-with-no-sliding-space/50000/8 "2022-05-19T18:58:22Z")

</div>

Ohh! I got it. I didn’t know I have to reduce the size. Thanks for your help.
