Skip to main content

scrollbar doesn't fill or appear. tkinter

I'm having trouble with my scrollbar. I tried something but each time I had a little trouble. now I can't even see the scrollbar, other times it doesn't fill the y-axis. firstly I tried without canvas, just with frame (allTelemtry) for using grid() but couldn't achieve it then tried with canvas so I can use pack() but still can't do it properly.

from tkinter import *
from tkinter import ttk

root = Tk()
root.state('zoomed')

# creating notebook
telemetry = ttk.Notebook(root, width=1083, height=200)
telemetry.place(x=440, y=560)

allTelemetry = Frame(telemetry)
allTelemetry.pack(fill="both", expand = 1)

# creating canvas for scrollbar 
allTelemetryCanvas = Canvas(allTelemetry)
allTelemetryCanvas.pack(fill="both", expand = 1)

dotTelemetry = Frame(telemetry)
dotTelemetry.pack(fill="both", expand = 1)

telemetry.add(allTelemetry, text= u"Hepsini Goster")
telemetry.add(dotTelemetry, text= u"Anlik Telemetri")

#------------------------------------------------------------
teleTitle = [" ", "Takmno","Paketno","Zaman",
        "1Basn","2Basn",
        "Nem",
        "1kseklik","2Ykseklik",
        "rtifaFark","niHz","Scaklk","PilGerilimi",
        "La1","Lo1","Al1",
        "La2","Lo2","Al2",
        "Drm",
        "x","y","z",
        "DnSays","Video"]

empty = Label(allTelemetryCanvas, text="",width=3)
empty.grid(row=0,column=0,padx=1, pady=1)
for j in range(1,25):
    teleTitle[j] = teleTitle[j].encode('UTF-8')

    entry = Label(allTelemetryCanvas,text=teleTitle[j].decode(),anchor='w', width=5, bd=2)
    entry.grid(row=0, column=j,padx=1, pady=1)

packet=1
for i in range(1,10):
    packetNum = Label(allTelemetryCanvas, text = packet, anchor="w",width=3)
    packetNum.grid(row=i, column=0,pady=0.5)
    packet = packet+1
    for j in range(1,25):
        takenData = Entry(allTelemetryCanvas,width=5)
        takenData.grid(row=i, column=j,pady=0.5)

# !!!!!!!!!!!!!!!!!
scrollbar = ttk.Scrollbar(allTelemetry, orient='vertical', command=allTelemetryCanvas.yview)
scrollbar.pack(side=RIGHT, fill="y")
allTelemetryCanvas['yscrollcommand'] = scrollbar.set


root.mainloop()


source https://stackoverflow.com/questions/72664385/scrollbar-doesnt-fill-or-appear-tkinter

Comments

Popular posts from this blog

Why is my reports service not connecting?

I am trying to pull some data from a Postgres database using Node.js and node-postures but I can't figure out why my service isn't connecting. my routes/index.js file: const express = require('express'); const router = express.Router(); const ordersCountController = require('../controllers/ordersCountController'); const ordersController = require('../controllers/ordersController'); const weeklyReportsController = require('../controllers/weeklyReportsController'); router.get('/orders_count', ordersCountController); router.get('/orders', ordersController); router.get('/weekly_reports', weeklyReportsController); module.exports = router; My controllers/weeklyReportsController.js file: const weeklyReportsService = require('../services/weeklyReportsService'); const weeklyReportsController = async (req, res) => { try { const data = await weeklyReportsService; res.json({data}) console...

How to show number of registered users in Laravel based on usertype?

i'm trying to display data from the database in the admin dashboard i used this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count(); echo $users; ?> and i have successfully get the correct data from the database but what if i want to display a specific data for example in this user table there is "usertype" that specify if the user is normal user or admin i want to user the same code above but to display a specific usertype i tried this: <?php use Illuminate\Support\Facades\DB; $users = DB::table('users')->count()->WHERE usertype =admin; echo $users; ?> but it didn't work, what am i doing wrong? source https://stackoverflow.com/questions/68199726/how-to-show-number-of-registered-users-in-laravel-based-on-usertype

The number of nodes and edges I calculated manually and by a method provided by networkx library dont match

I am trying to analyse a graph using networkx library in Python. I have implemented a function that returns the nodes and edges of that graph. After that I counted the number of nodes and edges by implementing the len() function for nodes and edges, which gave me 17 for both nodes and edges. However, when I used the method graph.number_of_nodes() of networkx library it gave me 53. My code: import pandas as pd import networkx as nx import matplotlib.pyplot as plt header_list = ["a","b","w"] E =pd.read_csv("aves-barn-swallow-contact-network.edges",sep=" ",header= None,names=header_list) # print(E.head()) # prints first few rows of the csv file G = nx.from_pandas_edgelist(E,"a","b",["w"]) nx.draw(G) plt.show() class GraphAnalyse: #finding nodes and edges def nodeEdge(self,Graph): nodes = Graph.nodes() edges = Graph.edges() ...