Thanks Rick,

I've tried some of your suggestions and finally I get some success. I put
the code in attachment. the solution works fine with text, listbox, hierbox,
but do nothing work for canvas.

...
    text $base.cpd22.03 -font -height 1 -width 8 -wrap none \
        -xscrollcommand {scr_visibility .top21.cpd22.01} \
        -yscrollcommand {scr_visibility .top21.cpd22.02}
...
proc {scr_visibility} {scr j k} {

    $scr set $j $k

    if {[$scr get] == "0.0 1.0"} {
        grid remove $scr
    } else {
        grid $scr
    }
}

The second problem is that when you save this code in vtcl while the
"text" is clean you louse the code that "grid" the "scrollbars". You have
to put vtl in "test" mode, write something larger than the line width
(use "-wrap nome") and some blank lines to show the both scrollbars
after generate the tcl code.

Does anyone have any sugestion?

Thanks in advance,

Ivan

Rick Macdonald wrote:

> On Thu, 13 Jan 2000, Ivan Lucena wrote:
>
> > How can I configure a Scrollbar to be automatically invisible and
> > visible
> > only when it's necessary?
>
> I haven't done it myself, and all I can do for you is point you to these
> concepts and commands:
>
> o pack forget .scrollbar
>       (hides it)
> o pack .scrollbar -side ...etc... -after .xxx
>       (puts it back; -after/-before optional to force it to the right
>        place.)
>
> If you're not using the pack manager for the scrollbar, you need something
> similar but I can't help.
>
> o subcommands like xview/yview tell you wether part of the widgets data
>   is hidden or not (ie if you need a scrollbar)
>
> ...RickM...
>
> ---------------------------------------------------------------------------
> To unsubscribe from the Visual Tcl mailing list, please send a message
> to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
> message body (where [EMAIL PROTECTED] is your e-mail address).

scr_visibility.tcl

Reply via email to