IT-Academy

static line

Feb 2nd, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.17 KB | None | 0 0
  1. import wx
  2.  
  3.  
  4. class Example(wx.Frame):
  5.            
  6.     def __init__(self, *args, **kw):
  7.         super(Example, self).__init__(*args, **kw)
  8.        
  9.         self.InitUI()
  10.        
  11.     def InitUI(self):  
  12.  
  13.         pnl = wx.Panel(self)
  14.  
  15.         font = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)
  16.         heading = wx.StaticText(self, label='The Central Europe', pos=(130, 15))
  17.         heading.SetFont(font)
  18.  
  19.         wx.StaticLine(self, pos=(25, 50), size=(300,1))
  20.  
  21.         wx.StaticText(self, label='Slovakia', pos=(25, 80))
  22.         wx.StaticText(self, label='Hungary', pos=(25, 100))
  23.         wx.StaticText(self, label='Poland', pos=(25, 120))
  24.         wx.StaticText(self, label='Czech Republic', pos=(25, 140))
  25.         wx.StaticText(self, label='Germany', pos=(25, 160))
  26.         wx.StaticText(self, label='Slovenia', pos=(25, 180))
  27.         wx.StaticText(self, label='Austria', pos=(25, 200))
  28.         wx.StaticText(self, label='Switzerland', pos=(25, 220))
  29.  
  30.         wx.StaticText(self, label='5 445 000', pos=(250, 80))
  31.         wx.StaticText(self, label='10 014 000', pos=(250, 100))
  32.         wx.StaticText(self, label='38 186 000', pos=(250, 120))
  33.         wx.StaticText(self, label='10 562 000', pos=(250, 140))
  34.         wx.StaticText(self, label='81 799 000', pos=(250, 160))
  35.         wx.StaticText(self, label='2 050 000', pos=(250, 180))
  36.         wx.StaticText(self, label='8 414 000', pos=(250, 200))
  37.         wx.StaticText(self, label='7 866 000', pos=(250, 220))
  38.  
  39.         wx.StaticLine(self, pos=(25, 260), size=(300,1))
  40.  
  41.         tsum = wx.StaticText(self, label='164 336 000', pos=(240, 280))
  42.         sum_font = tsum.GetFont()
  43.         sum_font.SetWeight(wx.BOLD)
  44.         tsum.SetFont(sum_font)
  45.  
  46.         btn = wx.Button(self, label='Close', pos=(140, 310))
  47.  
  48.         btn.Bind(wx.EVT_BUTTON, self.OnClose)        
  49.        
  50.         self.SetSize((360, 380))
  51.         self.SetTitle('wx.StaticLine')
  52.         self.Centre()
  53.         self.Show(True)      
  54.        
  55.     def OnClose(self, e):
  56.        
  57.         self.Close(True)    
  58.                      
  59. def main():
  60.    
  61.     ex = wx.App()
  62.     Example(None)
  63.     ex.MainLoop()    
  64.  
  65. if __name__ == '__main__':
  66.     main()
Advertisement
Add Comment
Please, Sign In to add comment