Tkinter - columnspan doesn't seem to affect Message
<p>I've trying to create a simple interface in Python (2.7) with Tkinter featuring a user-input box, browse button and description on the first row and a multi-line explanation spanning their width on the line below. </p>

<p>My issue is that the <code>columnspan</code> option doesn't seem to allow my <code>Message</code> widget to span the width of the three columns above, as can be seen below:</p>

<p><a href="https://i.stack.imgur.com/Cqa97.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/Cqa97.jpg" alt="Non-spanning message box"></a></p>

<p>How can I get this <code>Message</code> to span the entire width? I've additionally tried using the <code>width</code> parameter but this seems to be of a different scale to that for the <code>Entry</code> widget.</p>

<p>My code is as follows:</p>

<pre><code>from Tkinter import *

class App(Frame):

    def __init__(self, *args, **kwargs):
        Frame.__init__(self, *args, **kwargs)
        self.grid(sticky=N + W + E + S)

        # set up labels and buttons
        self.folder_text = Label(
            self, text='Select Folder:  ', font='Arial 10', anchor=W
        )
        self.folder_text.grid(row=0, column=0, sticky=W)

        self.input_folder = Entry(
            self, width=40, font='Arial 10'
        )
        self.input_folder.grid(row=0, column=1)

        self.browse_button = Button(
            self, text="Browse", font='Arial 8 bold',
            command=lambda: self.browse_for_folder(self.input_folder)
        )
        self.browse_button.grid(row=0, column=2)

        self.desc = Message(
            self, text='This tool will create a .csv file in the specified folder containing the Time and '
                       'Latitude/Longitude (WGS84) for all TIFF, RAW and JPEG/JPG files contained in the '
                       'folder with this information available.', font='Arial 8', anchor=W
        )
        self.desc.grid(row=1, column=0, columnspan=3, sticky=E + W)

        self.run_button = Button(
            self, text="Run!", font='Arial 10 bold', fg='red',
            command=lambda: self.run(self.input_folder)
        )

        self.run_button.grid(row=2, column=1)

# ---SNIP---

root = Tk()
root.bind('&lt;Escape&gt;', lambda e: root.destroy())
root.resizable(0, 0)
root.title('Get photo geolocations')

app = App(root)
root.mainloop()
</code></pre>

<p>If you change the background color of the widget you will see that it does indeed span multiple columns. </p>

<p>The main feature of the <code>Message</code> widget is that it will insert linebreaks in the text so that the text maintains a specific aspect ratio if a width is not specified. The text of a <code>Message</code> window will not fill extra horizontal space if the widget is made wider than its natural size.</p>

<p>The aspect ratio is ignored if you specify the width. Unlike the <code>Label</code> where the width refers to the number of characters, the <code>width</code> option of a <code>Message</code> is pixel-based (or distance: inches, centimeters, millimeters, or printer points). </p>

<p>A simple way to use the <code>width</code> option is to bind to the <code>&lt;Configure&gt;</code> event of the widget, and set the width option to be the actual width of the widget (or the width minus a little for a margin)</p>

<p>For example:</p>

<pre><code>self.desc.bind("&lt;Configure&gt;", 
    lambda event: event.widget.configure(width=event.width-8))
</code></pre>

python tkinter