simple GUI question

Eric Brunel eric_brunel at despammed.com
Wed Dec 8 11:56:27 CET 2004


Roose wrote:
[snip]
> Another thing I would *like* but is not strictly necessary would be to
> change the font size and color of the text within the box.  Is there a good
> way of doing that?  I have googled around but can't find any decent example
> code for some reason.

Short answer: you can't. The tkMessageBox functions use "native" dialogs, which 
cannot be configured.

The long answer depends on which platform you're on. If you are on Windows..., 
see short answer ;-) : the dialogs used are actually the native ones, and apart 
from abandonning the tkMessageBox module and designing your own dialogs, there 
is no way to alter their appearence (not that I know of).

If you're on Unix, it's a bit better but not much: since there's no such thing 
as "native" dialogs, the dialogs are actually tcl code that is in the tcl/tk 
distro, that you can hack anyway you want. This is however not recommended (not 
by me, anyway...), because it has many drawbacks (modify the tcl code will 
modify *all* your dialogs and you won't be able to simply distribute your script 
with the appearence changes: you'll have to distribute the new tcl code for the 
dialogs too...)

So if you really want to do that, the simplest way is definetely to avoid using 
the tkMessageBox module and to design your own dialogs.

HTH
-- 
- Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com



More information about the Python-list mailing list