1

I'm using the place() method of assigning the location of slider bars on my application window. I am using relx, rely, and relwidth to control where the sliders go to make sure they scale up when I maximize the window.

The slider bars are in a horizontal position, and take up most of the width of my screen. I can't figure out how to adjust the "thickness/height?" of the slider bar relative to the screen.

You can do width = ... to adjust the thickness permanently, but I'm finding that you can't use relheight = ... to do it relative to the screen.

Can someone help me adjust this parameter relative to the parent widget size?

sweetSlider = Scale(app, orient=HORIZONTAL,width=30,from_=0,to=100,showvalue=0,variable=sweetVar)
sweetSlider.place(relx=0.15,rely=0.06,relwidth=0.7)

In the above, relx and rely are the placement of the upper left corner of the slider on my GUI screen (app). relwidth=0.7 sets the width of the slider always to 70% the width of the screen.

I wish to set the other dimension of the slider, the "height" in the same manner (to maybe 10% of the screen size). The relheight parameter works with buttons, but it doesn't seem to work with the slider.

finefoot
  • 9,914
  • 7
  • 59
  • 102
Thetravellingfool
  • 183
  • 1
  • 2
  • 10
  • 1
    Can you give us code that shows what you've done? Though, to be honest, place is almost certainly the wrong tool for the job. You usually end up having to do a lot more work than necessary. – Bryan Oakley Dec 05 '13 at 02:03
  • @Bryan Oakley: Hmm, I understand that grid may well have been the better option. I edited my question to include my slider code. I believe (though I'm wrong all the time) that the relative widget size and my using .place() are mutually exclusive. If I were to ask the straight question of how to adjust the relative size of the slider, would that have been a better question? – Thetravellingfool Dec 05 '13 at 02:35

0 Answers0