Using IE from wxPython on Win32

I've been scratching my head on this for a few hours now but can't
seem to get the simplest example to work. I just want to embed IE
into a wxPython panel/frame/notebook but all I get is a small block.
Any help is greatly appreciated. Please see below.

Thanks!

Tim

Running:

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
wxPython2.6.2.1

Script:

import wx
import wx.lib.iewin as iewin

class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title,
                          pos=(150, 150), size=(350, 200))

        panel = wx.Panel(self)

  ie = iewin.IEHtmlWindow(panel, -1)
  ie.LoadUrl("http://www.yahoo.com")

class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame(None, "Simple wxPython App")
        self.SetTopWindow(frame)

        print "Print statements go to this stdout window by default."

        frame.Show(True)
        return True
        
app = MyApp(redirect=0)
app.MainLoop()

Hi Tim,

Don’t rely on the default layout, is not wise. Just add a sizer and put the ie window in the sizer using proportion 1 and the wx.EXPAND flag

Peter

···

On 2/13/06, Tim tim@sleepy.wojomedia.com wrote:

I’ve been scratching my head on this for a few hours now but can’t
seem to get the simplest example to work. I just want to embed IE
into a wxPython panel/frame/notebook but all I get is a small block.
Any help is greatly appreciated. Please see below.

Thanks!

Tim

Running:

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
wxPython2.6.2.1

Script:

import wx
import wx.lib.iewin as iewin

class MyFrame(
wx.Frame):
def init(self, parent, title):
wx.Frame.init(self, parent, -1, title,
pos=(150, 150), size=(350, 200))

    panel = wx.Panel(self)

    ie = iewin.IEHtmlWindow(panel, -1)
    ie.LoadUrl("[http://www.yahoo.com](http://www.yahoo.com)")

class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, “Simple wxPython App”)

    self.SetTopWindow(frame)

    print "Print statements go to this stdout window by default."

    frame.Show(True)
    return True

app = MyApp(redirect=0)
app.MainLoop
()


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org

For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

In our application we add a notebook page first, this works okay....
our panel gets passed into the __init__ as gui.......

def __init__(self, acotApi, gui, log):
        global noteBook, ln
        # added to test
        self.acotApi = acotApi
        noteBook= gui.getNoteBook()
        wx.Panel.__init__(self, id = -1, parent=noteBook)#, style=wxNO_FULL_REPAINT_ON_RESIZE)
        self.SetBackgroundColour( wx.Colour(242, 245, 250) )
        page = None
        # select = 0 adds the page but doesn't bring it to the front of the tabs
        noteBook.AddPage(self, " "+ln.Lbl_NexPert+" ", select = 1, imageId = -1)
        self.log = log
        self.frame = gui
        self.cwd = os.path.split(sys.argv[0])[0]
        if not self.cwd:
            self.cwd = os.getcwd()
        if gui:
            self.titleBase = gui.GetTitle()
        self.html = iewin.IEHtmlWindow(self, -1, style = wx.NO_FULL_REPAINT_ON_RESIZE)
        self.box = wx.BoxSizer(wx.VERTICAL)
        self.box.Add(self.html, 7, wx.wxGROW)

Greg Miller

···

From: Tim <tim@sleepy.wojomedia.com>
Reply-To: wxPython-users@lists.wxwidgets.org
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] Using IE from wxPython on Win32
Date: Mon, 13 Feb 2006 05:51:23 -0600

I've been scratching my head on this for a few hours now but can't
seem to get the simplest example to work. I just want to embed IE
into a wxPython panel/frame/notebook but all I get is a small block.
Any help is greatly appreciated. Please see below.

Thanks!

Tim

Running:

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32
wxPython2.6.2.1

Script:

import wx
import wx.lib.iewin as iewin

class MyFrame(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title,
                          pos=(150, 150), size=(350, 200))

        panel = wx.Panel(self)

ie = iewin.IEHtmlWindow(panel, -1)
ie.LoadUrl("http://www.yahoo.com")

class MyApp(wx.App):
    def OnInit(self):
        frame = MyFrame(None, "Simple wxPython App")
        self.SetTopWindow(frame)

        print "Print statements go to this stdout window by default."

        frame.Show(True)
        return True

app = MyApp(redirect=0)
app.MainLoop()

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org