# $Id: label.wgt,v 1.7 2002/10/24 05:27:14 cgavin Exp $

##############################################################################
#
# Visual TCL - A cross-platform application development environment
#
# Copyright (C) 2001 Damon Courtney
#
# Description file for Tk Widget
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

##############################################################################
#

Class       TLabel
Lib         ttk
CreateCmd   ttk::label
Icon            icon_label.gif
DefaultOptions  -text Tlabel -relief flat \
                -font \$vTcl(actual_gui_font_dft_name) -anchor w \
	-justify left -compound left \

    #-foreground [ttk::style lookup . -foreground]

	#-foreground black

DoubleClickCmd  vTcl:set_label
#TtkOptions      -background -foreground
TtkWidget       yes

TreeLabel       @vTcl::widgets::ttk::label::getWidgetTreeLabel
DefaultValues   -activebackground -activeforeground -background \
                -foreground -highlightbackground -highlightcolor -font

ClassOption    -_tooltip

Function        "Set Text"  vTcl::widgets::ttk::label::setText
#Function      "Set Multiline Text"  vTcl::widgets::ttk::label::setMultilineText
Function    "Set Tooltip"   vTcl::widgets::ttk::label::setTooltip
Function    "Remove Image"  vTcl::widgets::ttk::label::remove_image

namespace eval vTcl::widgets::ttk::label {

    proc setTooltip {} {
        global vTcl
        vTcl:set_tooltip $vTcl(w,widget)
    }

    proc setText {} {
        # vTcl:set_label $::vTcl(w,widget)
        vTcl:set_text $::vTcl(w,widget)
    }

    proc setMultilineText {} {
        vTcl:set_text $::vTcl(w,widget)
    }

     proc remove_image {} {
        global vTcl
        vTcl:remove_image $vTcl(w,widget)
    }

    proc getWidgetTreeLabel {target} {
        set ttt1 [$target cget -text]
        set ttt2 [$target cget -textvariable]

        if {$ttt2 == ""} {
            return "TLab: $ttt1"
        } else {
            return "TLab: $ttt1 var=$ttt2"
        }
    }
}

