Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

What kind of widget is .main.top.ok?
Hi!
having a widget path like .main.top.ok, how can a Tcl code find out what
kind of widget it is? (i.e. button or label)

Thanxalot!

Shin - A.k.a. Thomas Braun


Report this thread to moderator Post Follow-up to this message
Old Post
Shin The Gin
10-26-04 08:59 PM


Re: What kind of widget is .main.top.ok?
Shin The Gin wrote:
> Hi!
> having a widget path like .main.top.ok, how can a Tcl code find out what
> kind of widget it is? (i.e. button or label)
>
> Thanxalot!
>
> Shin - A.k.a. Thomas Braun
>

[winfo class $widget]

Report this thread to moderator Post Follow-up to this message
Old Post
Bryan Oakley
10-26-04 08:59 PM


Re: What kind of widget is .main.top.ok?
Shin The Gin <N05PAM_shin@n05pam_shin.homelinux.net> wrote:
> Hi!
> having a widget path like .main.top.ok, how can a Tcl code find out what
> kind of widget it is? (i.e. button or label)

> Thanxalot!

winfo class $widget

would help for most standard widgets which have their class hardcoded.
Container widgets such as frame and toplevel allow to specify  arbitrary
class, but it is easy to distinguish between three container classes -
frame, labelframe and toplevel:

if {[winfo toplevel $widget] eq "$widget"} {
puts "$widget is toplevel"
} elseif {![catch {$widget cget -labelanchor}]} {
# widget has -labelanchor option
puts "$widget is labelframe"
} else {
puts "$widget is ordinary frame
}

--
The only other people who might benefit from Linux8086 would be owners
of PDP/11's and other roomsized computers from the same era.
-- Alan Cox

Report this thread to moderator Post Follow-up to this message
Old Post
Victor Wagner
10-26-04 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:00 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.