Bonsoir chers tous
je voudrais afficher CodeProduit - NomProduit - Unite de la ligne selectionnée dans mon treeview . Merci..

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from tkinter import *
from tkinter import ttk
from subprocess import call
from tkinter import messagebox
import sqlite3
 
F_Produit=Tk()
F_Produit.title("LISTE__PRODUITS")
F_Produit.geometry("750x600+250+50")
F_Produit.resizable(height=False,width=False)
F_Produit.configure(bg='gray63')
 
tree=ttk.Treeview(F_Produit,columns=(1,2,3,4),heigh=0,show="headings")
tree.place(x=10, y=225,width=724,height=300)
tree.heading(1, text="Id",anchor=CENTER)
tree.heading(2, text="CodeProduit",anchor=W)
tree.heading(3, text="NomProduit",anchor=W)
tree.heading(4, text="Unite",anchor=CENTER)
 
tree.column(1, width=5,anchor=CENTER)
tree.column(2, width=20,anchor=W)
tree.column(3, width=40,anchor=W)
tree.column(4, width=20,anchor=CENTER)
tree.insert("",END,values=("1","C200", "alinert","unt"))
tree.insert("", END, values=("2", "fd200", "ternis", "unta"))
 
code=Label(F_Produit,text="Code_Produit",font=("arial narow",9,"bold"),bg='gray63',fg="white")
code.place(x='10',y='10')
entrcode=Entry(F_Produit,font=("arial narow",8,"bold"),width=30)
entrcode.place(x='10',y='30')
 
Produit=Label(F_Produit,text="Nom_Produit",font=("arial narow",9,"bold"),bg='gray63',fg="white")
Produit.place(x='10',y='50')
entrProduit=Entry(F_Produit,font=("arial narow",8,"bold"),width=55)
entrProduit.place(x='10',y='70')
 
Unite=Label(F_Produit,text="Unite",font=("arial narow",9,"bold"),bg='gray63',fg="white")
Unite.place(x='10',y='90')
entrUnite=Entry(F_Produit,font=("arial narow",8,"bold"),width=30)
entrUnite.place(x='10',y='110')
 
F_Produit.mainloop()