Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- import wx
- import wx.webkit
- source = '''
- <html>
- <head>
- <style type="text/css">
- body {
- background-image: url(http://dev.nocphone.com/~gabriel/back.png);
- background-attachment: fixed;
- background-repeat: repeat-x;
- background-position: left top;
- }
- </style>
- </head>
- <body>
- <h1> Title </h1>
- <p> text text text text text text text text text text </p>
- <h1> Title </h1>
- <p> text text text text text text text text text text </p>
- <h1> Title </h1>
- <p> text text text text text text text text text text </p>
- </body>
- </html>
- '''
- class Note(wx.Frame):
- def __init__(self, parent, id, title):
- wx.Frame.__init__(self, parent, id, title)
- self.sizer = wx.BoxSizer(wx.VERTICAL)
- self.content_box = wx.BoxSizer(wx.VERTICAL)
- self.webkit = wx.webkit.WebKitCtrl(self, -1)
- self.webkit.SetPageSource(source)
- self.content_box.Add(self.webkit, 3, wx.GROW|wx.ALIGN_TOP|wx.ALL, 20)
- self.sizer.Add(self.content_box, 1, wx.GROW)
- self.SetSizerAndFit(self.sizer)
- self.SetClientSize((300, 400))
- self.Show(True)
- app = wx.App()
- Note(None, -1, '')
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement