CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Anyone familiar with TCL/TK and DialogBoxes?



Dec 19, 2011, 9:40 AM

Post #1 of 2 (1983 views)
Anyone familiar with TCL/TK and DialogBoxes? Can't Post

Hope this is OK to ask...

Is there a way to get a reference to the buttons on a TCL/TK DialogBox? I didn't want to build my own version of a DB, though it isn't really hard. But since I already coded everything with a DB, I wanted to get a reference to one of the YES/NO buttons so I can gray it out and enable it based on user input.

I see you can get the children of a widget and so on, but I didn't get too far.

Thanks for any help.



Dec 29, 2011, 3:22 PM

Post #2 of 2 (1896 views)
Re: [srhadden] Anyone familiar with TCL/TK and DialogBoxes? [In reply to] Can't Post

I figured this out eventually. The second button in the dialogbox is referred to as "button1" internally. I wrote a routine to grab a reference to it, and then I could set the state of it however I wanted.

sub getDBButtonRef {

my($dialogBox,$nameOfButton) = @_;

foreach ($dialogBox->children) {

$name = $_->name; $diag_child = $_;

if($name =~ /bottom/) {

foreach $d ($diag_child->children) {

print $d->name;

if($d->name =~ /$nameOfButton/){

return $d;

} } } } return undef; }

(This post was edited by srhadden on Dec 29, 2011, 3:23 PM)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives