-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui.py
More file actions
58 lines (22 loc) · 798 Bytes
/
gui.py
File metadata and controls
58 lines (22 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
__author__ = 'cxtan'
import wx
import client
import socket
class my_frame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, "cxtan", size = (300, 200))
panel = wx.Panel(self)
label = wx.StaticText(panel, -1, "hell cxtan", (100,10))
txt = wx.TextCtrl(panel, -1, "input your name:", (100,50))
txt.SetInsertionPoint(0)
self.button = wx.Button(panel, -1, "connect", pos = (100, 100))
self.Bind(wx.EVT_BUTTON, self.Buttin_click, self.button)
def Buttin_click(self, event):
local_IP = socket.gethostbyname(socket.gethostname())
client.TCP_connect(local_IP)
if __name__ == '__main__':
app = wx.App()
mframe = my_frame()
mframe.Show()
app.MainLoop()
pass