Advertisement
Guest User

Untitled

a guest
Nov 12th, 2009
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.27 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import wx
  3. import wx.webkit
  4.  
  5. source = '''
  6. <html>
  7.  <head>
  8.    <style type="text/css">
  9.      body {
  10.           background-image: url(http://dev.nocphone.com/~gabriel/back.png);
  11.           background-attachment: fixed;
  12.           background-repeat: repeat-x;
  13.           background-position: left top;
  14.      }
  15.    </style>
  16.  </head>
  17.  <body>
  18.    <h1> Title </h1>
  19.    <p> text text text text text text text text text text </p>
  20.    
  21.    <h1> Title </h1>
  22.    <p> text text text text text text text text text text </p>
  23.    
  24.    <h1> Title </h1>
  25.    <p> text text text text text text text text text text </p>
  26.    
  27.  </body>
  28. </html>
  29.  
  30. '''
  31. class Note(wx.Frame):
  32.     def __init__(self, parent, id, title):
  33.         wx.Frame.__init__(self, parent, id, title)
  34.  
  35.         self.sizer = wx.BoxSizer(wx.VERTICAL)
  36.  
  37.         self.content_box = wx.BoxSizer(wx.VERTICAL)
  38.         self.webkit = wx.webkit.WebKitCtrl(self, -1)
  39.         self.webkit.SetPageSource(source)
  40.         self.content_box.Add(self.webkit, 3, wx.GROW|wx.ALIGN_TOP|wx.ALL, 20)
  41.         self.sizer.Add(self.content_box, 1, wx.GROW)
  42.         self.SetSizerAndFit(self.sizer)
  43.         self.SetClientSize((300, 400))
  44.         self.Show(True)
  45.  
  46. app = wx.App()
  47. Note(None, -1, '')
  48. app.MainLoop()
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement