Python Forum
sQlite3 output to tkinter treeview - how do I set / increase width of the output?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sQlite3 output to tkinter treeview - how do I set / increase width of the output?
#1
Hello,
Brand new to posting in this forum so hello all.

I do not seem to be able to increase the width of the output from an sQlite3 DB table.
The output is delivered in full, and I am clueless as to how to change it.
I'm sure the solution is straightforward. Too much of a newbie... any help very gratefully received.

This is my current output:
My current output




def showCustTable():
   showCustTableWin=Tk()
   showCustTableWin.title("* Customer Table *")
   showCustTableWin.geometry("850x350")
   showCustTableWin.wm_iconbitmap('favicon.ico')

   def View():
      myshop_db  = sqlite3.connect("myshop_db.db")
      c = myshop_db.cursor()
      c.execute('''SELECT * FROM Customers''')

      rows = c.fetchall()
      for row in rows:
         tree.insert("",tk.END, values = row)
      myshop_db.commit()
      myshop_db.close()

   frame1 = Frame(showCustTableWin, width=850, height=350,bd=15,relief="raise")
   frame1.pack()

   tree= ttk.Treeview(frame1, column=("column1", "column2", "column3", "column4", "column5", "column6", "column7"), show='headings')
   tree.heading("#1", text="CUST#")
   tree.column("#1", width = 5, anchor = "w")
   tree.heading("#2", text="NAME")
   tree.column("#2", width = 25, anchor = "w")
   tree.heading("#3", text="ADDRESS")
   tree.column("#3", width = 30, anchor = "w")
   tree.heading("#4", text="CITY")
   tree.column("#4", width = 15, anchor = "w")
   tree.heading("#5", text="POSTCODE")
   tree.column("#5", width = 15, anchor = "w")
   tree.heading("#6", text="TEL")
   tree.column("#6", width = 15, anchor = "w")
   tree.heading("#7", text="EMAIL")
   tree.column("#7", width = 35, anchor = "w")
   tree.pack()   
   View()
   
Again, thank you very much in advance for having a look. :)
Reply


Messages In This Thread
sQlite3 output to tkinter treeview - how do I set / increase width of the output? - by dewijones67 - Jan-16-2019, 04:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinter Shell Terminal Or Shell Output sweetthdevil 5 8,911 Feb-03-2024, 02:51 PM
Last Post: Gribouillis
  tkinter - update/refresh treeview snakes 5 20,877 Dec-02-2023, 07:05 PM
Last Post: aynous19
  [PyGUI] How to format output from layout and keys thruss 2 2,784 Nov-30-2023, 08:11 AM
Last Post: sulo167
  send function output from one py file to another (OOP) lunacy90 15 2,398 Aug-26-2023, 02:42 PM
Last Post: deanhystad
  [Tkinter] How to insert data json to treeview tkinter? Shakanrose 8 4,400 Jan-19-2023, 03:58 PM
Last Post: Shakanrose
  [Tkinter] Different rows colours in treeview tkinter Krissstian 1 1,261 Nov-20-2022, 09:59 PM
Last Post: woooee
  [PyQt] Execute the script in remote and get the output maiya 2 1,389 Jul-10-2022, 05:03 AM
Last Post: maiya
  [Tkinter] About Tkinter Treeview.selection_get() usage. water 3 8,296 Feb-12-2022, 02:19 PM
Last Post: water
  [Tkinter] TKINTER quiz using sqlite3 database hezza_23 45 21,420 Nov-29-2021, 09:42 PM
Last Post: Hilal
  [Tkinter] [split] Is there a way to embed a treeview as a row inside another treeview? CyKlop 5 3,359 Oct-20-2021, 12:14 AM
Last Post: CyKlop

Forum Jump:

User Panel Messages

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