Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tkinter - resize tkMessageBox

1,398 views
Skip to first unread message

rahul...@yahoo.com

unread,
Jun 4, 2007, 4:29:41 PM6/4/07
to
Hi,
Is there a way to resize the width of the "tkMessageBox.askyesno"
dialog box, so that the text does not wrap to the next line.
Thanks
Rahul

jim-on-linux

unread,
Jun 4, 2007, 6:15:11 PM6/4/07
to pytho...@python.org, rahul...@yahoo.com
On Monday 04 June 2007 16:29, rahul...@yahoo.com
wrote:
I don't know of any.
It's a little more work but your better off using
Toplevel and/or frame, you have more control over
the window and its appearance.

jim-on-linux
http://www.inqvista.com

Glenn Hutchings

unread,
Jun 5, 2007, 3:00:56 AM6/5/07
to
On 4 Jun, 21:29, rahulna...@yahoo.com wrote:
> Is there a way to resize the width of the "tkMessageBox.askyesno"
> dialog box, so that the text does not wrap to the next line.

You can use the Tk option database, either explicitly or from a file.
For example, to set the wrap length of all dialogs to 10 inches, try
this:

root = Tk()
root.option_add("*Dialog.msg.wrapLength", "10i")

Regards,

Glenn

Cameron Laird

unread,
Jun 5, 2007, 5:25:20 PM6/5/07
to
In article <1181026856.2...@q75g2000hsh.googlegroups.com>,
.
.
.
But that does *not* affect the MessageBoxes under MacOS and Windows, right?

Cameron Laird

unread,
Jun 5, 2007, 5:28:36 PM6/5/07
to
In article <mailman.8693.1180993...@python.org>,
.
.
.
Yes and no. Yes, synthesizing ones own MessageBox gives greater
control, but that becomes a non-"native" MessageBox which is
alleged to discomfort some end-users.

'Nother way to say this: tkMessageBox is implemented in terms of
native widgets, as much as possible, and native MessageBoxes on
at least some platforms do NOT provide for resizing or width
control.

Cameron Laird

unread,
Jun 11, 2007, 11:52:09 AM6/11/07
to
In article <0v0hj4-...@lairds.us>, I wondered:

I apologize for my coyness. I'll be explicit: current MessageBoxes
under MacOS and Windows (but NOT X11-based MessageBoxes, as with Linux)
do NOT respect Dialog options. Tkinter will presumably build in Tile
capabilities in the future; then the default appearances may change
again.

0 new messages