0

aquí le dejo mí código, el problema es que el Scrollbar aparece en la ventana principal, aunque su el pack, no se ubica al lado del treeview, creo que la solución es un detalle pequeño, pero no la consigo, ¿Me podrán ayudar?

  def modulo_dashboard(self): 
        self.windows_container = Toplevel()
        self.windows_container.transient(windows_raiz)
        self.windows_container.resizable(width=False, height=False)
        self.windows_container.resizable(0,0)
        #self.windows_consulta.protocol('WM_DELETE_WINDOW', self.on_exit) # Invalidar x y    mandar a función con mensaje 
        self.windows_container.geometry("1340x530+2+164")
        #   Medidas del Geometry ("ancho x alto + columna + fila")


    #   Configuración del Treeview
    style = ttk.Style()
    style.theme_use("alt") #alt, clam, vista
    style.configure("Treeview", background="skyblue2", foreground="black",
        rowheight=22, fieldbackground="skyblue2", font = ('arial', 11))
    style.map("Treeview", background=[('selected', 'navy')], foreground=[('selected', 'white')])
    #   Agrandar emcabezado
    nametofont("TkHeadingFont").configure(size=12)

Aquí comienza el Treeview

    # Comienza el Treeview
    self.tree = ttk.Treeview(self.windows_container, height = 12, columns = ('#0', '#1'), show="headings")
    self.tree.place(x =40, y = 140)

    vsb = ttk.Scrollbar(self.windows_container, orient="vertical", command=self.tree.yview)
    vsb.pack(side=RIGHT, fill=BOTH)

    self.tree.column("#0", width=0, minwidth=0)
    self.tree.column("#1", width=300, minwidth=50)
    self.tree.column("#2", width=200, minwidth=50)

    self.tree.heading('#0', text = '', anchor = CENTER)
    self.tree.heading('#1', text = 'Ubicación', anchor = CENTER)
    self.tree.heading('#2', text = 'Cantidad Equipos', anchor = CENTER)
    
    self.tree.configure(yscrollcommand=vsb.set)
    self.tree.bind("<Button-1>", self.selusandoclik5)

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.