simple ui
This commit is contained in:
		
							
								
								
									
										42
									
								
								helloWorld.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								helloWorld.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
import glob
 | 
			
		||||
import wx
 | 
			
		||||
 | 
			
		||||
class ServerPanel(wx.Panel):    
 | 
			
		||||
    def __init__(self, parent):
 | 
			
		||||
        super().__init__(parent)
 | 
			
		||||
        main_sizer = wx.BoxSizer(wx.VERTICAL)
 | 
			
		||||
        self.row_obj_dict = {}
 | 
			
		||||
 | 
			
		||||
        self.list_ctrl = wx.ListCtrl(
 | 
			
		||||
            self, size=(-1, 100), 
 | 
			
		||||
            style=wx.LC_REPORT | wx.BORDER_SUNKEN
 | 
			
		||||
        )
 | 
			
		||||
        self.list_ctrl.InsertColumn(0, 'Server name', width=140)
 | 
			
		||||
        self.list_ctrl.InsertColumn(1, 'Port number', width=140)
 | 
			
		||||
        self.list_ctrl.InsertColumn(2, 'Status', width=200)
 | 
			
		||||
        main_sizer.Add(self.list_ctrl, 0, wx.ALL | wx.EXPAND, 5)        
 | 
			
		||||
        start_button = wx.Button(self, label='Start')
 | 
			
		||||
        start_button.Bind(wx.EVT_BUTTON, self.on_edit)
 | 
			
		||||
        stop_button = wx.Button(self, label='Stop')
 | 
			
		||||
        stop_button.Bind(wx.EVT_BUTTON, self.on_edit)
 | 
			
		||||
        main_sizer.Add(start_button, 0, wx.ALL | 100, 5)        
 | 
			
		||||
        main_sizer.Add(stop_button, 0, wx.ALL | 100, 5)
 | 
			
		||||
        self.SetSizer(main_sizer)
 | 
			
		||||
 | 
			
		||||
    def on_edit(self, event):
 | 
			
		||||
        print('in on_edit')
 | 
			
		||||
 | 
			
		||||
    def update_mp3_listing(self, folder_path):
 | 
			
		||||
        print(folder_path)
 | 
			
		||||
 | 
			
		||||
class ServerFrame(wx.Frame):    
 | 
			
		||||
    def __init__(self):
 | 
			
		||||
        super().__init__(parent=None,
 | 
			
		||||
                         title='Server Dashboard')
 | 
			
		||||
        self.panel = ServerPanel(self)
 | 
			
		||||
        self.Show()
 | 
			
		||||
 | 
			
		||||
if __name__ == '__main__':
 | 
			
		||||
    app = wx.App(False)
 | 
			
		||||
    frame = ServerFrame()
 | 
			
		||||
    app.MainLoop()
 | 
			
		||||
		Reference in New Issue
	
	Block a user