Menu

#1754 option -use does not work properly under Windows

closed-accepted
8
2004-12-19
2004-09-08
No

I was exploring the possibility to embed a Tk window in
a window owned by another program and so I first tried
the following script:

exec wish -use [winfo id .] &

in the console window under Windows 98 and Windows XP
(using 8.4.1 repsectively 8.4.5).

This causes a crash (a messagebox with an application
error comes up - memory referenced at some invalid
address or a message of similar wordings)

Discussion

  • Eric Boudaillier

    Logged In: YES
    user_id=493507

    I think you don't use the fonctionnality well.
    Try:

    frame .f -container 1
    pack .f
    exec wish -use [winfo id .f] &

    The second wish will be displayed inside .f.

    Anyway, this shouldn't crash.
    The code responsible of the crash is in TkWinEmbed.c (1.7),
    at the start of TkWinEmbeddedEventProc(), when the Container
    structure is searched.
    tsdPtr->firstContainerPtr is NULL.

     
  • Arjen Markus

    Arjen Markus - 2004-09-09

    Logged In: YES
    user_id=400048

    Yes, that does indeed do the trick. Thanks.
    The remaining problem now is: how can I embed a Tk window in
    another application? (Well, that is a different question
    altogether.)

    Okay, the code fragment I found in the book by Brent Welch
    was not very explicit about the frame (it is there, but I
    overlooked that line and it is not clear that this is
    essential). More importantly: the man page for wish does not
    mention a container at all

     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Clarified wish.1; leaving bug open as we might wish to
    consider whether we can to things to stop the crash from
    happening.

     
  • Donal K. Fellows

    • status: open --> open-accepted
     
  • Don Porter

    Don Porter - 2004-10-26

    Logged In: YES
    user_id=80530

    backport.

     
  • Don Porter

    Don Porter - 2004-10-26
    • priority: 5 --> 9
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2004-12-04
    • priority: 9 --> 8
    • assigned_to: chengyemao --> dgp
     
  • Don Porter

    Don Porter - 2004-12-04
    • assigned_to: dgp --> hobbs
     
  • Chengye Mao

    Chengye Mao - 2004-12-19
    • status: open-accepted --> closed-accepted
     
  • Chengye Mao

    Chengye Mao - 2004-12-19

    Logged In: YES
    user_id=191079

    With the latest change in Tk85, a warning dialog box will pop
    up to indicate a failure of container identification if the use-
    window is not a container. It is up to the user to choose
    either proceeding for attachment or cancel since we can't
    expect all Tk container applications will be able to do or have
    done the identification correctly in processing attach
    request. In the latest Tk85, I'm not able to duplicate the
    crash with a use-id of a non-container Tk window. I did my
    tests in Windows XP Pro (SP2)