svad has asked for the wisdom of the Perl Monks concerning the following question:

Hello, all!
I am trying to embed into perl/Tk application some other GUI, which I am developing.
Tk manpages says that about -container option for Frame() widget, and also mentions that "window will support the appropriate window manager protocols for things like geometry requests."
Does anyone knows where to get information what namely must support my newly created GUI program?

If anyone succeeded embedding non-Tk program into Tk-program, please share your experience!

Best wishes,

  • Comment on How to embed other GUI into Tk application

Replies are listed 'Best First'.
Re: How to embed other GUI into Tk application
by graff (Chancellor) on Apr 26, 2002 at 04:19 UTC
    I realize it's bad form for me to ask a question in response to a question, so please forgive me, but... what benefit do you hope to get by embedding a non-Tk GUI (which you create) inside a widget of a Perl-Tk program?

    Is your non-Tk GUI set up so it can also work by itself (not inside a Tk widget)? If so, and you are looking for a way to make its output accessible to an "outer" Perl-Tk GUI, why not run the "inner" GUI as a pipeline file handle

    open(MYGUI,"inner-gui |");
    then setup a
    for that file handle? This would seem to keep everything simpler, and might perform better -- both GUI's do their normal thing, both are handled by the main window manager.

    If do have a compelling reason for the "embedded GUI apps" approach, I'd be very interested to learn more about that sort of situation.

      in my case non-Tk GUI is not a standalone independent program, but rather specially written for this case.

      If I write GUI using Tk, I prefer using it in a most portable way, i.e. without non-portable additions like external inclusions.

      But here I am tempting to do several different kinds of things. <bl>

    • 1. extend Tk GUI functionality by creating non-Tk widget with a native to current platform widget, for example Borland VCL or CLX, for example, data-aware widgets
    • 2. opposite case (after I'll understand underlying mechanics)
      to enrich my other Win32 GUI application with a powerfullest Text widget I ever saw, as well as other well-done Tk widgets.
    • 3. everything else I've forgot to mention :) </bl>
Re: How to embed other GUI into Tk application
by {NULE} (Hermit) on Apr 26, 2002 at 00:59 UTC