Dear Monks

I guess the answer to my question will be "No", but I just want to be sure.

I have a GUI written in TK which I cannot port to another GUI language, too much complicated. In my software I miss a row Web browser to quick open Webpages INSIDE my application. With Win32::GUI there is a quite simple way to integrate a Web Browser in the own GUI. My question: Is it possible o combine the two toolkits? The idea would be to have a TK pane (or similar) and open a WebBrowser Active X (Win32::GUI::AxWindow) in it?

In my script below I have the two components, what I miss (and I guess is not possible at all) is how to show the browser in a TK window. Unpossible, isn't?

#!/usr/bin/perl use warnings; use strict; use Tk; use Win32::GUI qw(); use Win32::GUI::AxWindow; my $mw = MainWindow->new; Browser(); MainLoop; sub Browser{ # Main Window my $Window = Win32::GUI::Window->new( -name => 'Window', -text => 'Win32::GUI::AxWindow Web Browser', -pos => [100, 100], -size => [640, 480], ); # Add a WebBrowser AxtiveX my $Browser = Win32::GUI::AxWindow->new( -parent => $Window, -name => 'Browser', -control => 'Shell.Explorer', -pos => [0, 0], -size => [640, 480], ); # Register some event $Browser->RegisterEvent( StatusTextChange => sub { my $self = shift; my $eventid = shift; print 'Event : ', @_, "\n"; } ); # Call Method $Browser->CallMethod('Navigate', 'http://www.perlmonks.org/'); # Event loop $Window->Show(); Win32::GUI::Dialog(); # Main window event handler sub Window_Resize { my($width, $height) = ($Window->GetClientRect)[2..3]; $Browser->Move (0, 0); $Browser->Resize($width, $height); return 1; } }

In reply to Combining Win32::GUI and TK by welleozean

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.