Commit Graph

15 Commits

Author SHA1 Message Date
Georg Brandl bf76ce168c Make the Pynche tool work with Python 3. 2010-08-02 22:08:58 +00:00
Collin Winter 6afaeb757a Convert print statements to function calls in Tools/. 2007-08-03 17:06:41 +00:00
Barry Warsaw 531e3932bf Fix a typo, update (only one) style improvement, whitespace
normalization.
2002-10-21 14:20:37 +00:00
Barry Warsaw ffa926d77e __init__(), save_views(): Catch ValueError along with IOError and
EOFError so any failures in unmarshalling are just ignored.  Use
print>> instead of sys.stderr.write().
2001-07-10 21:48:51 +00:00
Barry Warsaw 2095b2fe14 Added docstring describing Viewer interface.
set_colordb(): Call Viewers' colordb_changed() method if they have
them.  Notifies them of changes to the color name database.
1999-04-27 18:53:29 +00:00
Barry Warsaw 0604d72318 Lots of changes to support loading alternative color name database.
You can switch database by just loading the new one; the list window
and nearest colors adapt to the new database.

Some reorganizing of code.  Also, the name of the database file is
stored in the ~/.pynche pickle.  If it can't be loaded, fallbacks are
used.
1999-04-26 23:17:16 +00:00
Barry Warsaw 4ab5ae2ad0 Error message goes to stderr
canceled() takes an optional flag so that the canceled flag can be
cleared.
1998-10-22 18:48:01 +00:00
Barry Warsaw ca07ba00ac Many changes to support a second mode of operation. Pynche can now be
run either as a standalone application (by running pynche or
pynche.pyw), or as a modal dialog inside another application.  This
can be done by importing pyColorChooser and running askcolor().  The
API for this is the same as the tkColorChooser.askcolor() API, namely:

    When `Okay' is hit, askcolor() returns ((r, g, b), "name").  When
    `Cancel' is hit, askcolor() returns (None, None).

Note the following differences:

    1. pyColorChooser.askcolor() takes an optional keyword `master'
       which if set tells Pynche to run as a modal dialog.  `master'
       is a Tkinter parent window.  Without the `master' keyword
       Pynche runs standalone.

    2. in pyColorChooser.askcolor() will return a Tk/X11 color name as
       "name" if there is an exact match, otherwise it will return a
       color spec, e.g. "#rrggbb".  tkColorChooser can't return a
       color name.

There are also some UI differences when running standalone vs. modal.
When modal, there is no "File" menu, but instead there are "Okay" and
"Cancel" buttons.

The implementation of all this is a bit of a hack, but it seems to
work moderately well.  I'm not guaranteeing the pyColorChooser.Chooser
class has the same semantics as the tkColorChooser.Chooser class.
1998-10-22 03:25:59 +00:00
Barry Warsaw 8a09e1ccda Saving/Restoring state into ~/.pynche file 1998-10-20 20:45:46 +00:00
Barry Warsaw cd09867c57 current_rgb(): New method 1998-10-05 21:14:12 +00:00
Barry Warsaw 4638c5b7f3 Docstring 1998-10-02 16:20:14 +00:00
Barry Warsaw a7ba45b7b6 update_views_current(): New method 1998-10-01 16:46:43 +00:00
Barry Warsaw fda3aceb71 Added interface to get/set colordb 1998-09-29 20:04:19 +00:00
Barry Warsaw 1ac18cd326 simplify 1998-09-28 23:41:12 +00:00
Barry Warsaw 987fb9225f Initial revision 1998-09-28 15:59:21 +00:00