0
from tkinter import *

root = Tk()
root.geometry("400x400")
my_canvas = Canvas(root)
my_canvas["bg"] = '#808080'
my_canvas.place(relx=0, rely=0, relheight=1, relwidth=1)

This frame I want to change to fill the X axis instead of being dependent on grid inside it

frame = Frame(my_canvas, width=100, height=10)
frame.grid(row=0, column=0, padx=5, pady=5, sticky="ew")

example = Label(frame, text="Hello World!", bg="#1d1d1d", fg="#ffffff")
example.grid(row=1, column=1, sticky="ew")      

root.mainloop()
Yovel
  • 3
  • 3
  • Have you done any research? Did you follow any basic tutorial? – Thingamabobs Oct 11 '21 at 18:23
  • I asked because as far as I know I have no way of doing what I asked though maybe someone else will give me a solution to the problem. – Yovel Oct 11 '21 at 18:35
  • [Resizing a frame in a canvas](https://stackoverflow.com/q/29319445) – Thingamabobs Oct 11 '21 at 18:48
  • Are you expecting to be able to scroll the canvas? Items added to the canvas with `pack`, `place`, or `grid` aren't scrollable. It's fairly unusual to use `grid` to add a frame inside a canvas. – Bryan Oakley Oct 11 '21 at 19:32
  • The canvas for scroll and inside have frames and inside frames have labels sorted use grid but I want the size of frame will no changes – Yovel Oct 13 '21 at 06:12

0 Answers0