On Wed, 19 Jan 2000, Ivan Lucena wrote:

> 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} {

    if {![info exists ::vTcl]} {
      puts [$scr get]

>     $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.

Look above, where I've added a check to see if you are running in vTcl
test mode. If you are, the proc does nothing and you won't accidentally
loose the scrollbars if you save while the widget has no scrollbars.

Note also the "puts" statement that I added. I don't know why the canvas
doesn't work for you, but the "puts" will show you what the string is and
maybe you can figure out why it never is what you think it should be.
Maybe it's not ever getting called.

...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).

Reply via email to