Commit Graph

9 Commits

Author SHA1 Message Date
Georg Brandl bf82e374ee More 2to3 fixes in the Tools directory. Fixes #2893. 2008-05-16 17:02:34 +00:00
Neal Norwitz d91085598f Remove apply() 2006-03-17 08:00:19 +00:00
Barry Warsaw 698c14936a Update a comment. 2001-07-10 21:45:27 +00:00
Barry Warsaw 74a7ece9f3 Move the "from Tkinter import *" out of the method and into the module
scope (still inside the __name__=='__main__' guard).  Necessitated by
recent addition of nested scopes.
2001-02-01 20:52:08 +00:00
Barry Warsaw 80d83e38ab askcolor(): databasefile and wantspec can now be set on every
invocation, instead of just the first.
1999-04-27 18:56:35 +00:00
Barry Warsaw 61ba0721db Removed unnecessary import `from PyncheWidget import PyncheWidget' 1999-03-26 15:59:51 +00:00
Barry Warsaw 2be858230a __init__(): Removed initialcolor keyword.
show(): added color keyword here so that the selected color can be
chosen on each invocation of askcolor().

Also fixed this class, and askcolor() so that the same Chooser
instance can be re-used instead of creating a new one on each
invocation of askcolor().

Added a module function save() which can be used to explicitly save
the option database in ~/.pynche.  This does not happen automatically
when used as a modal.
1998-10-22 18:51:22 +00:00
Barry Warsaw a20f6af862 Chooser.__init__(): Added `wantspec' keyword to conform exactly to
tkColorChooser.askcolor() interface (i.e. don't return a color name
even if there is an exact match).
1998-10-22 03:44:52 +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