使用wxpython编写登录界面
1、界面如下:
2、github地址
3、代码如下:
#coding=utf-8
'''
登陆界面
'''
import wx
import webbrowser
import pickle
from wx.lib.embeddedimage import PyEmbeddedImage
import os
class LoginFrame(wx.Frame):
fx = None #框架x轴位置
fy = None #框架y轴位置
mx = None #移动x轴位置
my = None #移动y轴位置
def __init__(self):
wx.Frame.__init__(self,None,-1,u'登陆',style=wx.SIMPLE_BORDER,size=(500,300))
self.Center()
self.SetBackgroundColour('#b3d8ff')
# ******************主界面设计S
mainBoxSizer = wx.BoxSizer(wx.VERTICAL)
topPanel = wx.Panel(self,-1,size=(500,30))
topPanel.SetBackgroundColour('#80beff')
file = open('./source/images/close.png', 'rb')
b64 = file.read().encode('base64')
file.close()
bitmap = PyEmbeddedImage(b64).GetBitmap()
self.closeButton = wx.StaticBitmap(topPanel, -1 , bitmap,pos=(470,3))
self.closeButton.Bind(wx.EVT_LEFT_DOWN,self.OnCloseApp)
mainBoxSizer.Add(topPanel)
#顶部导航
mainBoxSizer.Add((0,10))
titleLabel = wx.StaticText(self, -1, u'