I am writing a UI using tkinter and ttk widgets.
Having struggled with pack() and "automatic" placing of widgets, and failed, I am trying a different tack, namely placing things where I think I want them to be.
As an example, I create a Notebook, and add in Frame objects to give me a set of tabbed pages. So far, so good.
However, on at least one of the pages, I want to create a Treeview (which is scrollable, so I also need a Scrollbar on the right side of it) which will occupy most of the page, but at the bottom of the page I want a row of buttons to support various actions on the contents of the Treeview.
This will be a fullscreen app, so once the widgets are set up, they will not be moved or resized (aside from the columns in the Treeview).
I can get the screen size, so I know how big the top level window is, and I can create the Notebook to (almost) fill the window.
Is there a way I can tell how large the frame for the notebook's 'page' area is? Since I set the Notebook width and height, I assume this is the same size?
In other windowing systems there is a distinction between client and non-client rectangles, and ways of getting system "metrics" such as the default width of a scrollbar, etc.
Do similar things exist for tk widgets? In my case, I would want to know the height of the tab selection part of the Notebook, so that I can specify the size of it so it still fits on the screen, rather than ending up where the buttons at the bottom of the page are actually off-screen.
(Eventually, this will be a touchscreen driven app).
Oooh. Supplementry question: with a touchscreen rather than a mouse, does <ButtonRelease-1> still fire when you lift your finger?
(My touchscreen is packed away at the moment as we are getting the house ready for potential viewers, and the boss insists that my study must not look like someone ram-raided RS and dumped the haul in there...)
Thanks in advance...
Having struggled with pack() and "automatic" placing of widgets, and failed, I am trying a different tack, namely placing things where I think I want them to be.
As an example, I create a Notebook, and add in Frame objects to give me a set of tabbed pages. So far, so good.
However, on at least one of the pages, I want to create a Treeview (which is scrollable, so I also need a Scrollbar on the right side of it) which will occupy most of the page, but at the bottom of the page I want a row of buttons to support various actions on the contents of the Treeview.
This will be a fullscreen app, so once the widgets are set up, they will not be moved or resized (aside from the columns in the Treeview).
I can get the screen size, so I know how big the top level window is, and I can create the Notebook to (almost) fill the window.
Is there a way I can tell how large the frame for the notebook's 'page' area is? Since I set the Notebook width and height, I assume this is the same size?
In other windowing systems there is a distinction between client and non-client rectangles, and ways of getting system "metrics" such as the default width of a scrollbar, etc.
Do similar things exist for tk widgets? In my case, I would want to know the height of the tab selection part of the Notebook, so that I can specify the size of it so it still fits on the screen, rather than ending up where the buttons at the bottom of the page are actually off-screen.
(Eventually, this will be a touchscreen driven app).
Oooh. Supplementry question: with a touchscreen rather than a mouse, does <ButtonRelease-1> still fire when you lift your finger?
(My touchscreen is packed away at the moment as we are getting the house ready for potential viewers, and the boss insists that my study must not look like someone ram-raided RS and dumped the haul in there...)
Thanks in advance...
Statistics: Posted by SteveSpencer — Thu May 16, 2024 11:18 am