Skip Menu |

This queue is for tickets about the Tk-Getopt CPAN distribution.

Report information
The Basics
Id: 27647
Status: resolved
Priority: 0/
Queue: Tk-Getopt

People
Owner: Nobody in particular
Requestors: slaven [...] rezic.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: bug-Tk-Getopt [...] rt.cpan.org
Subject: Re: tk:Getopt
Date: 19 Jun 2007 23:03:35 +0200
To: "Shaffer, Kip" <shaffer.jd [...] pg.com>
From: Slaven Rezic <slaven [...] rezic.de>
"Shaffer, Kip" <shaffer.jd@pg.com> writes: Show quoted text
> Slaven, > > Thank you for writing Tk:Getopt... it is a very useful module! > > > > I was wondering if you had any advise on how to allow a user to abort > out of a the script calling Tk::Getopt. > > > > One way that I could imagine to do this is if it was possible for the > calling script to find out which button (OK, Cancel) the user pressed. > > Another way would be to assign callback functions to the buttons. > > > > Would any of these be useful and easily added to Tk::Getopt? >
Yes, I think this could be added. Maybe it could look like -some_option_to_be_names => { ok => sub { ... }, cancel => \&cancel_sub, ... } Regards, Slaven -- Slaven Rezic - slaven <at> rezic <dot> de tkruler - Perl/Tk program for measuring screen distances http://ptktools.sourceforge.net/#tkruler
On Tue Jun 19 17:04:02 2007, slaven@rezic.de wrote: Show quoted text
> "Shaffer, Kip" <shaffer.jd@pg.com> writes: >
> > Slaven, > > > > Thank you for writing Tk:Getopt... it is a very useful module! > > > > > > > > I was wondering if you had any advise on how to allow a user to abort > > out of a the script calling Tk::Getopt. > > > > > > > > One way that I could imagine to do this is if it was possible for the > > calling script to find out which button (OK, Cancel) the user pressed. > > > > Another way would be to assign callback functions to the buttons. > > > > > > > > Would any of these be useful and easily added to Tk::Getopt? > >
> > Yes, I think this could be added. Maybe it could look like > > -some_option_to_be_names => { ok => sub { ... }, > cancel => \&cancel_sub, > ... > } > > Regards, > Slaven >
Another implementation proposal: introduce a function called option_dialog() which works like option_editor, but works like a dialog (that is, has an implicite -wait=>1) and returns the clicked button (like other dialog widgets do). Regards, Slaven
option_dialog is implemented in Tk::Getopt 0.49_52