ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcl-core
tcl-core
[TCLCORE] TIP #213: A Standard Dialog for Font Selection
by Pat Thoyts other posts by this author
Apr 2 2008 4:15PM messages near this date
Re: [TCLCORE] TIP #213: A Standard Dialog for Font Selection (Pat Thoyts) | Re: [TCLCORE] TIP #213: A Standard Dialog for Font Selection
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I intend to push TIP #213 along as for Tk 8.6 now. I've added an
implementation for a native font chooser for windows and a scripted
dialog for everyone else that is based upon dkf's font selection dialog
but rewritten to use ttk widgets.
A patch against the Tk 8.6 HEAD is at
http://sourceforge.net/support/tracker.php?aid=1477426

I want to make one change to the tip. The current api says:

~ "-updatefont

~    This specifies the name of a font created with font create which
~  will be updated to reflect the details of the users selection; if this
~  option is specified, it provides the result of tk_chooseFont if the
~  dialog is not cancelled. Where the dialog implementation supports it,
~  the font will also be updated during the selection process. This
~  allows the effects of changing the font to be reflected immediately in
~  other Tk widgets."

Now both dkf's dialog and the critcl-based native implementations I have
for tkchat (windows and Gtk) use '-apply command' which is more flexible
and really more in keeping with the rest of Tk. If a named font needs to
be updated then it can be done in the apply script. The command has the
font specification appended as the final argument so we can have:
~  tk_chooseFont -apply {.textwidget configure -font}
or write a procedure to update any named font or whatever.

So I propose:
~ "-apply command

~ Specify a Tcl command to be invoked if the dialog's apply button is
pressed. The command will have the currently selected font description
appended as a list of (family ?size? ?style? ?style ...?)"

The API given now (-initialfont, -parent, -title, -apply) is sufficient
on Windows and for use with the Gtk font selection dialog. I do not know
if this is acceptable on MacOSX/Aqua and await comments. However my
opinion is that this is better than nothing and will in fact satisfy 90%
of users.

Provision of a single command (tk_chooseFont) and such a simple API
should help to make it simple to provide other font selection dialog
implementations where this will help to achieve a native look&feel (Gtk
and Qt being the obvious candidates).

I intend to push for voting as soon as possible.

Pat Thoyts
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)

iQCVAwUBR/QRnWB90JXwhOSJAQh7eAP/Ua6pBZgwyapURpCpQYqjOnFUUXfBdMQr
eyrhv7WqS2e7OGcgb2OcA5To0WzIlpoHI/Kfq8Fu9zJjCGO5CipcK2Ddpf/xGE3A
noQGX3cpGy7IvGR4q9w8/3HRby0qT9ZIXwa396ejUZ2gbJepF88YDJE5ZHEbX4uZ
gNoN1vVmZ1E=
=+dVd
-----END PGP SIGNATURE-----


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Pat Thoyts
Donal K. Fellows
Daniel A. Steffen
Pat Thoyts

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved