Re: Tkinter grid layout question

Phil <[email protected]>
Newsgroups gmane.comp.python.tutor
Message-ID <[email protected]>
On 27/10/23 19:08, Alan Gauld via Tutor wrote:

Thank you Alan for taking the time to reply.

> Or do you mean the buttons are positioned to the right of
> the image but with the image horizontally level with the
> centre of the buttons? In which case the image surely
> can't be top-left? Or is it a big image, bigger than
> the 4 buttons?

Yes to both.

> Can you use ASCII art to show what you are aiming for?

  |-------------------|  |------------------|
  |                        |  |   frame 2     |
  |    image         |  |                      |
  |                        |  |           X         |
  |   250 x 230    |  |        X   X       |
  |                        |  |          X          |
  |   frame 1       |  |                      |
  |-------------------|  |------------------|

The Xes represent the four direction buttons. There is a label
in the blank space between the up and down buttons that shows
which button was pressed.

I thought about using two frames when the positioning of the
buttons became difficult but I persisted. The buttons kept
splitting apart until I hit upon the idea of using rowspan on
image. I thought this was a bogie idea, but it worked and I didn't
really understand the reason why it worked, hence my message
to the list.

Using two frames is a far better approach which worked
without any editing at all. Just a bit of copying and pasting
from the original code.

Of course I don't know what use I can put to, it was just an exercise to 
create an image to put on a button.

By the way, each button is 50 x 50 and not the usual rectangular shape.

-- 
Regards,
Phil
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.