473,412 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Why is the scroll bar just a fraction of the canvas? / Misplaced?

Scroll bars, especially the vertical, are displayed at the end of the region. They appear to function well otherwise.
Code:

Expand|Select|Wrap|Line Numbers
  1. #test_scroll_bar_2_pack.py
  2. from tkinter import *
  3.  
  4. t = Tk()
  5.  
  6. c = Canvas(t)
  7. hsb = Scrollbar(t, orient="h", command=c.xview)
  8. vsb = Scrollbar(t, orient="v", command=c.yview)
  9. c.configure(yscrollcommand=vsb.set, xscrollcommand=hsb.set)
  10.  
  11. c.pack()
  12. hsb.pack(side=BOTTOM, fill=X)
  13. vsb.pack(side=RIGHT, fill=Y)
  14.  
  15. ###t.grid_rowconfigure(0, weight=1)
  16. ###t.grid_columnconfigure(0, weight=1)
  17.  
  18.  
  19. for x in range(100, 5000, 100):
  20.     for y in range(100, 5000, 100):
  21.         c.create_text((x,y), anchor=CENTER, text="%d,%d" % (x,y))
  22. c.configure(scrollregion = (0, 0, 5000, 5000))
  23.  
  24. t.mainloop()
Jan 9 '20 #1
0 1383

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mickel Grönroos | last post by:
Hi, I have a Tkinter.Canvas of variable width. Is there a standard way of asking the canvas which parts of it that is visible? I.e. on the horizontal scale, I would like to know at what fraction...
2
by: Askari | last post by:
Hi, I do a "perso"widget where have two scrolls (one vertical, one horizontal) for a canvas. When, the first time, I added widget in the canvas, the scroll self-ajust and when I move scrollbar,...
2
by: PhilC | last post by:
Hi Folks, I'm trying to click on a canvas to draw a line. The canvas has scroll bars. All is well until I move the scrollbars. This naturally because the relationship between my screen click and...
0
by: syed_saqib_ali | last post by:
Please take a look at and run the code snippet shown below. It creates a canvas with vertical & Horizontal scroll-bars. If you shrink the window to smaller than the area of the canvas, the...
2
by: William Gill | last post by:
I need to display a couple of labels and a checkbox from each entry in my database. Simple enough, but there are several hundred records, and I only want to display 5 or 10 at a time. Can this be...
1
by: Jeremy Chapman | last post by:
I've got a grid inside a div so that it's got scroll bars around it. What I want to do is have the header row fixed at the top, so that the vertical scroll bars scroll just the data rows of the...
0
by: John McMonagle | last post by:
I tried binding mouse wheel events (<Button-4>, <Button-5>) to a Tkinter Canvas widget with the hope of using the event.delta value to subsequently scroll the Canvas. However, it seems that...
1
by: Shankartalukdar | last post by:
Dear all, I am currently drawing a visualization tool in python using Tkinter. I would like to know how to add scroll bars into the canvas widget using the Tkinter module.Could you...
7
by: Haiyan | last post by:
Dear experts: I am trying to add one xy-scrollbar on the canvas, then put lots of check buttons on the canvas. I got at least following 2 problems: 1.I can see the y-scroll bar but contents on...
5
ilya Kraft
by: ilya Kraft | last post by:
Hello I have this interactive canvas as a background of my web, it is on 100% width and high, but when I add content that continues longer than canvas and you have to scroll down, canvas is not...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.