0

I am creating program using Tkinter and faced a problem. I have a json of configs:

{
"canvas_size": 450,
  "line_width": 2,
  "unit_line_width": 5,
  "dash": {
    "dash": 10,
    "space": 10
  }
}

And canvas objects with this specs like circles look perfect on my MacBook.

canvas.create_oval(top_x, top_y, bottom_x, bottom_y,
            dash=dash, fill='',
            tags=("draggable", self.selection_fig_tag),
            outline=outline, width=width)

However when I switch to Desktop my program looks awful due to different screen resolution. How can I adjust these configurations using screen dpi or etc, so my program will look same on different screens?

  • You can configure tkinter's internal scaling factor with `root.tk.call('tk', 'scaling', 2.0)`. See [this answer](https://stackoverflow.com/a/34133102/14507110) – Billy Apr 30 '22 at 10:32
  • @billy This method is used to zoom all the widgets like windows and text. It doesn't make the lines wider. So, that's not what I need – Dmitry Uspenskiy Apr 30 '22 at 17:17
  • Making the lines wider wasn't the question. In order to do that, you can use the `width` option of `create_oval` here. Please ask clearly when you are asking. – Billy Apr 30 '22 at 17:36

0 Answers0