OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Python Tkinter: Change button position based on window size

  • Thread starter Thread starter Thevin Jayawardena
  • Start date Start date
T

Thevin Jayawardena

Guest
This is just a concept that I haven't actually programmed yet. I'm still learning the logic for Tkinter and I'm wondering how to Change button position based on the window size. The best thing I can compare my idea in my head is something similar to word wrap.

Original size:

Code:
-------------------------------
|  -----    -----    -----    |
| |     |  |     |  |     |   |
| |     |  |     |  |     |   |
|  -----    -----    -----    |
|  -----    -----             |
| |     |  |     |            |
| |     |  |     |            |
|  -----    -----             |
-------------------------------

Change Example 1:

Code:
--------------------
|  -----    -----  |
| |     |  |     | |
| |     |  |     | |
|  -----    -----  |
|  -----    -----  |
| |     |  |     | |
| |     |  |     | |
|  -----    -----  |
|  -----           |
| |     |          |
| |     |          |
|  -----           |
--------------------

Change Example 2:

Code:
-----------------------------------------------
|  -----    -----    -----    -----    -----  |
| |     |  |     |  |     |  |     |  |     | |
| |     |  |     |  |     |  |     |  |     | |
|  -----    -----    -----    -----    -----  |
-----------------------------------------------

Is there a way to do something like this?
<p>This is just a concept that I haven't actually programmed yet. I'm still learning the logic for Tkinter and I'm wondering how to Change button position based on the window size. The best thing I can compare my idea in my head is something similar to word wrap.</p>
<p>Original size:</p>
<pre><code>-------------------------------
| ----- ----- ----- |
| | | | | | | |
| | | | | | | |
| ----- ----- ----- |
| ----- ----- |
| | | | | |
| | | | | |
| ----- ----- |
-------------------------------
</code></pre>
<p>Change Example 1:</p>
<pre><code>--------------------
| ----- ----- |
| | | | | |
| | | | | |
| ----- ----- |
| ----- ----- |
| | | | | |
| | | | | |
| ----- ----- |
| ----- |
| | | |
| | | |
| ----- |
--------------------
</code></pre>
<p>Change Example 2:</p>
<pre><code>-----------------------------------------------
| ----- ----- ----- ----- ----- |
| | | | | | | | | | | |
| | | | | | | | | | | |
| ----- ----- ----- ----- ----- |
-----------------------------------------------
</code></pre>
<p>Is there a way to do something like this?</p>
 

Latest posts

Top