At 09:38 AM 6/3/97 -0700, Mubarak Ali Khan wrote:
>Hi,
>
>  How do a create a field similar to the one in Attribute Editor.
>
>state  [deiconify] V
>
>  This field is like a cyclic field and displays the value that you select.
>ie). If you select normal that normal is displayed.
>
>What command can I use to create a similar field. I used menubutton but that
>has a list of radio or checkbutton whose value is not displayed at toplevel.

I was thinking of doing the same thing... the missing link for me was the 
tkMbPost command that apparently posts a menu as if the menubutton were 
clicked with the mouse.  Take a look at the code that vtcl uses to do it 
itself... around line 195 of prop_mgr.tcl.  He uses a menubutton plus an 
extra button for the down-arrow that calls tkMbPost to post the menu. Here 
is an excerpt from it:

            frame $base
            menubutton ${base}.l \
                -textvariable $variable -bd 1 -width 12 -menu ${base}.l.m \
                -highlightthickness 1 -relief sunken -anchor w -fg black \
                -padx 0 -pady 1
            menu ${base}.l.m -tearoff 0
            foreach i [lindex $vTcl($prefix,$option) 3] {
                ${base}.l.m add command -label "$i" -command \
                    "set $variable $i; $config_cmd; "
            }
            button ${base}.f -relief raised -bd 1 -image file_down \
                -height 5 -command "tkMbPost ${base}.l"
            pack ${base}.l -side left -expand 1 -fill x
            pack ${base}.f -side right -fill y -pady 1 -padx 1



---
R. Troy Monaghen                | Alliance Systems Incorporated
 [EMAIL PROTECTED]                   |  [EMAIL PROTECTED]
 http://www.mcs.net/~troy       |  http://www.alli.com

Reply via email to