Scrollbars and the -in option are now correctly saved as $base....

"J.Robert Suckling" wrote:

> > > > Other question: i want to use to almost identical frames in the window.
> > > > I would use some variables to make them look alike. How can this be done
> > > > in vtcl?
>
> cgavin wrote:
> > Back to existing versions...
> > In the 1.2.2, there is an option in the Preferences called "Ask for widget
> > name on insert". If you enable this option, vtcl will ask you everytime you
> > insert a widget for it's name (so you can give meaningful names).
>
> I am not sure what the question is.  But it reminds me that vtcl
> was written in such a way that it wants the user to instance
> TclWindow.s (for some 's' :). This could be done by passing
> in base arguments.  The problem being that the pack
> comands and some of the imbeded commands are unrolled.
> By unrolled I mean the original value for the base is
> written out rather then the string "$base".  The problem
> can  be seen in this code fragment. generated by vtcl for
>
> proc TclWindow.brwsr {base} {
> ...
>  pack $base.f25.f33.02 \
>         -in .brwsr.f25.f33 -anchor center -expand 1 -fill both -side left
> ...
>
> If the -in path was $base.f25.f33 then the value of $base,
> this change would alow the creation of  instances of the
> original.   Code then could be written like this:
>         vTclWindow.brwsr brwsr1
>         vTclWindow.brwsr brwsr2
>        vTclWindow.brwsr brwsr3
> to open as many instances as might be needed.
> Of cource the problem is not quite this simple, since other parts of the
> code are unrolled as well. Scroll bars come to mind. I am sure there are
> a few others.
>
> Of cource with some hand tweaking this can be done.
> Here is an real example.  new_viewer can be called
> as many times as needed.
>
> proc new_viewer {file} {
> global W               ;# fire up a new viewer.
>        incr    W(w.base)       ;# get a unique window name.
>        set w .view$W(w.base)
> 
>        vTclWindow.view $w      ;# draw the window
>         wm title $w "$file"
>
>         set fd [open $file]     ;# and fill it.
>         while {  [gets $fd line] >= 0 } {
>                 $w.f54.tex64 insert end "$line\n"
>         }
>        close $fd
> }
>
> And of cource the problem is the hand tweaking must be
> redone each time vtcl is run.
> 
> _______________________________________________
> vtcl-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/mailman/listinfo/vtcl-user

_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/vtcl-user

Reply via email to