#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    71
    Rep Power
    11

    wxPython: opening IE in a window


    Hi.
    Your help is very appreciated.
    I am building windows app, which contains a browser window(that runs html pages).
    At first I tried using the wx.lib.iewin which works fine, but unfortunately, the user can't use tabs in the iewin.
    So i decided to use the IE aplication, but I have problem
    opening the IE in my window.
    1. To open IE (it works), I use:

    ie = win32com.client.Dispatch("InternetExplorer.Application" )
    ie.Navigate("http://www.microsoft.com/")
    ie.Visible = 1


    2. In order to open it in a window that I create, I try(which doesn't work):
    Code:
    from wxPython.wx import *
    import  sys,os
    import win32con
    import win32com.client
    import win32api
    import win32gui
    
    class MyWin(wxFrame):
        def __init__(self):
            # frame initialization
            wxFrame.__init__(self, NULL, -1, "dc",
                             wxDefaultPosition, wxSize(480,400))
            self.MainWindow = self.InitMainWindow()
            self.MainWindow.Show(true)
            
        def InitMainWindow(self):
            ie = win32com.client.Dispatch("InternetExplorer.Application" )
            ie.Navigate("http://www.microsoft.com/")
            ie.Visible = 1
            return ie
            
            
    class MyApp(wxApp):
        def OnInit(self):
            frame = MyWin()
            return true
    
    if __name__ == '__main__':
        app = MyApp(0)
        app.MainLoop()


    Can someone please tell what I'm doing wrong
    Thank you very much
    Roy
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    71
    Rep Power
    11

    Reply


    AFAIK you can't. That is what the iewin activex component is for. If you use "InternetExplorer.Application" then you are going to get the full application, including it's own frame window.
    Robin Dunn

IMN logo majestic logo threadwatch logo seochat tools logo