Python Forum
Require scroll bars horizontal and vertical throughout the window
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Require scroll bars horizontal and vertical throughout the window
#1
Hello All,

When I try to create scroll bars,horizontal and vertical utilizing
grid I get them for particular row and particular column I wanted scroll bar
throughout the window how can I do that?
Here is my code
I have following elements
-Display text window
-Labels through a for loop (no of labels depend at run time
-Entry text boxes
-Checkboxes

I require vertical and horizontal scroll bars through out the window.I tried utilizing
scroll bar for horizontal one but it only creates for one row and one column
want to have horizontal and vertical scroll bar throughout the window utilizing grid
global master
master =Tk()
scrollbar = Scrollbar(master,orient="horizontal")
scrollbar.grid(column=20, row=20, sticky='NS')

display=Text(master,height=10,width=80)
display.insert(END,output2)
display.grid(row=0)
global count

for  i in range(0,len(count)):
    Label(master,text= str(i) +"." +output1.split()[i]).grid(row=i+11,sticky=W)
rowno = i+11
Label(master,text ="Enter the location ").grid(row=rowno+1,sticky=W)
global EnterLocation
EnterLocation = Entry(master)
EnterLocation.grid(row=rowno+1,column=1)
Label(master,text ="Enter the sequence number").grid(row=rowno+2,sticky=W)
global imageid
imageid = Entry(master)
imageid.grid(row=rowno+2,column=1)

c = Checkbutton(master, text="c1", variable=var1).grid(row=rowno+3,sticky=W)
#    print(var1.get())
global var2
var2 =IntVar()
c= Checkbutton(master,text="c2",variable=var2).grid(row=rowno+4,sticky=W)
global var3
   var3= IntVar()
   c= Checkbutton(master,text="c3",variable=var3).grid(row=rowno+5,sticky=W)
   global var4
   var4= IntVar()
   c= Checkbutton(master,text="c4",variable=var4).grid(row=rowno+6,sticky=W)
   global var5
   var5= IntVar()
   c= Checkbutton(master,text="c5",variable=var5).grid(row=rowno+7,sticky=W)
   global var6
   var6= IntVar()
   c= Checkbutton(master,text="c6",variable=var6).grid(row=rowno+8,sticky=W)
   global var7
   var7= IntVar()
   c= Checkbutton(master,text="c7",variable=var7).grid(row=rowno+9,sticky=W)
   global var8
   var8= IntVar()
   c= Checkbutton(master,text="c8",variable=var8).grid(row=rowno+10,sticky=W)
   global var9
   var9= IntVar()
   c= Checkbutton(master,text="c9",variable=var9).grid(row=rowno+11,sticky=W)
Reply
#2
From http://effbot.org/tkinterbook/scrollbar.htm Note that master/Tk() is not in this list
Quote:The Scrollbar widget is almost always used in conjunction with a Listbox, Canvas, or Text widget. Horizontal scrollbars can also be used with the Entry widget.
There are many examples on the web.
Reply
#3
Hello ,

I wanted a horizontal and vertical scroll bar on the main window.

Thanks and Regards
Tej Gandhi
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Interaction between Matplotlib window, Python prompt and TKinter window NorbertMoussy 3 348 Mar-17-2024, 09:37 AM
Last Post: deanhystad
  [Tkinter] Horizontal extension of widgets + frame size adapted to content Fab117 3 343 Feb-22-2024, 06:54 PM
Last Post: deanhystad
  [PyQt] command require close window Krissstian 14 2,831 Nov-19-2022, 04:18 PM
Last Post: Krissstian
  [PyQt] QTableView: scroll to top cell of the screen random_nick 2 2,769 Oct-08-2022, 12:29 AM
Last Post: random_nick
Photo [PyQt] Connecting progress bars to sensors anastejzja 1 1,123 May-28-2022, 09:09 AM
Last Post: Axel_Erfurt
  [PyQt] How do I get a QScrollArea to scroll? LavaCreeperKing 9 7,604 Oct-29-2021, 08:33 AM
Last Post: Axel_Erfurt
  Treeview scroll selected node to top rfresh737 1 2,668 Apr-14-2021, 03:27 AM
Last Post: deanhystad
  [Tkinter] canvas widget scroll issue chrisdb 2 3,783 Apr-07-2021, 05:48 AM
Last Post: chrisdb
  [Tkinter] Vertical Tabs Alignment in Tkinter muhammadasim 2 5,914 Oct-05-2020, 08:40 AM
Last Post: Larz60+
  [Tkinter] Help with scroll bars kraco 1 2,206 Sep-27-2020, 11:20 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020