Using -use and -container - not quite doing what I want 
Author Message
 Using -use and -container - not quite doing what I want

I am loading a script into a frame created by  another script.

I set the -container  1 on the frame. Once loaded I obtain the winfo id
value and send that back to my program.

I then insert the id value into the toplevel statement using -use. So
far, nice and simple. I am using separate interpreters for both scripts,
but that should not an issue (????).

I encounter a problem with the pathname, I can see the frame is filled
in with something because the frame goes from having leftover junk from
the previous screen location to our standard grey background, but no
widgets. Since the script works fine without the -use option, I can only
think that the pathname is somehow modified when putting the toplevel
inside another window.

Any suggestions

Dave



Mon, 07 Feb 2005 09:34:48 GMT  
 Using -use and -container - not quite doing what I want

Quote:

> I am loading a script into a frame created by  another script.

> I set the -container  1 on the frame. Once loaded I obtain the winfo id
> value and send that back to my program.

> I then insert the id value into the toplevel statement using -use. So
> far, nice and simple. I am using separate interpreters for both scripts,
> but that should not an issue (????).

> I encounter a problem with the pathname, I can see the frame is filled
> in with something because the frame goes from having leftover junk from
> the previous screen location to our standard grey background, but no
> widgets. Since the script works fine without the -use option, I can only
> think that the pathname is somehow modified when putting the toplevel
> inside another window.

> Any suggestions

> Dave

I've done this - so I know it works ;)

Post the snippets of code from bothscripts that have the
widget creation/management

Bruce



Mon, 07 Feb 2005 10:43:27 GMT  
 Using -use and -container - not quite doing what I want

Quote:


> > I am loading a script into a frame created by  another script.

> > I set the -container  1 on the frame. Once loaded I obtain the winfo id
> > value and send that back to my program.

> > I then insert the id value into the toplevel statement using -use. So
> > far, nice and simple. I am using separate interpreters for both scripts,
> > but that should not an issue (????).

> > I encounter a problem with the pathname, I can see the frame is filled
> > in with something because the frame goes from having leftover junk from
> > the previous screen location to our standard grey background, but no
> > widgets. Since the script works fine without the -use option, I can only
> > think that the pathname is somehow modified when putting the toplevel
> > inside another window.

> > Any suggestions

> > Dave

> I've done this - so I know it works ;)

> Post the snippets of code from bothscripts that have the
> widget creation/management

> Bruce

Hi, can you post sample code how you use it?

Thanks,
tak



Mon, 07 Feb 2005 21:17:05 GMT  
 Using -use and -container - not quite doing what I want

Quote:


>> I am loading a script into a frame created by  another script.

>> I set the -container  1 on the frame. Once loaded I obtain the winfo
>> id value and send that back to my program.

>> I then insert the id value into the toplevel statement using -use. So
>> far, nice and simple. I am using separate interpreters for both
>> scripts, but that should not an issue (????).

>> I encounter a problem with the pathname, I can see the frame is
>> filled in with something because the frame goes from having leftover
>> junk from the previous screen location to our standard grey
>> background, but no widgets. Since the script works fine without the
>> -use option, I can only think that the pathname is somehow modified
>> when putting the toplevel inside another window.

>> Any suggestions

>> Dave

> I've done this - so I know it works ;)

> Post the snippets of code from bothscripts that have the
> widget creation/management

> Bruce

Played around some more and got it working. I am using vtcl to generate
the script files, then modifying the scripts. The script used as the
container was simple, I have a frame widget  and
I just add -container 1 to the frame attributes.  When I load the
script, I do a winfo id .xxx to get
the hex value for the frame handle and send that back to my remote
server program.

frame $base.swin -container 1 \
        -borderwidth 2 -height 690 -relief groove -width 705
...

SendValue $base.swin,[winfo id $base.swin]

SendValue is a C routine which sends the arguments back to a server via
a socket

The second script contained the subordinate window also created under
vtcl. I modified it so that
if a global variable contains the hex value for the master window, then
the -use attribute is used

Before I Tcl_EvalFile the script, I set the global variable

Tcl_Eval(interp,"set CtgParent 0x123")

global CtgParent

if {$CtgParent == ""} {
    vTcl:toplevel $base -class Toplevel \
        -background #445e71 -highlightbackground #445e71
    wm focusmodel $base passive
    wm geometry $base 715x427+121+89; update
    wm maxsize $base 715 725
    wm minsize $base 132 1
    wm overrideredirect $base 0
    wm resizable $base 1 1
    wm deiconify $base
    wm title $base "Edit X/Y Panel Device"
    bindtags $base "$base Toplevel all _TopLevel"
    vTcl:FireEvent $base <<Create>>
    wm protocol $base WM_DELETE_WINDOW "vTcl:FireEvent $base
<<DeleteWindow>>"

Quote:
} else {

    vTcl:toplevel $base -use $CtgParent -class Toplevel \
        -background #445e71 -highlightbackground #445e71

Quote:
}

I will probably modify vtcl to automatically generate the code
automatically to switch between
regular toplevel and sub-window.


Wed, 09 Feb 2005 11:39:24 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. wanting to learn assembly but not quite sure where to start

2. Using Tcl_Channel in C++ STL containers

3. Focus Problem using BLT container widget on Linux.

4. using -container / -use commands

5. core in UNIX using container

6. QUESTION: Using the -container attribute

7. container detail using combobox edit policy

8. RB uses CPU even when doing nothing

9. Clarion Browse using SQL doing a SELECT ASC and then SELECT DESC

10. Doing continuos integration using Labview

11. Doing Sums using Prolog!

12. any1 done a magic square in c++ using class

 

 
Powered by phpBB® Forum Software