You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ff/helloWorld.py

53 lines
2.0 KiB
Python

2 years ago
import glob
import wx
import wx.lib.buttons as buttons
2 years ago
class ServerPanel(wx.Panel):
def __init__(self, parent):
super().__init__(parent)
main_sizer = wx.BoxSizer(wx.VERTICAL)
secondary_sizer = wx.BoxSizer(wx.HORIZONTAL)
2 years ago
self.row_obj_dict = {}
self.list_ctrl = wx.ListCtrl(
self, size=(-1, 100),
style=wx.LC_REPORT | wx.BORDER_SUNKEN
)
# self.pnl1.SetBackgroundColour(wx.BLACK)
2 years ago
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)
2 years ago
start_button = wx.Button(self, label='Start')
start_button.SetBackgroundColour((205, 215, 206))
2 years ago
start_button.Bind(wx.EVT_BUTTON, self.on_edit)
stop_button = wx.Button(self, label='Stop')
stop_button.SetBackgroundColour('#F08080')
# wx.BORDER(stop_button, wx.BORDER_NONE)
2 years ago
stop_button.Bind(wx.EVT_BUTTON, self.on_edit)
main_sizer.Add(start_button, 0, wx.CENTER | wx.ALL | 100, 5)
main_sizer.Add(stop_button, 0, wx.CENTER | 100, 5)
# start_button.SetWindowStyleFlag(wx.SIMPLE_BORDER)
# stop_button.SetWindowStyleFlag(wx.SIMPLE_BORDER)
# wx.StaticBitmap(self, -1, png, (500, 300), (png.GetWidth(), png.GetHeight()))
2 years ago
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.SetBackgroundColour((44, 51, 51))
2 years ago
self.panel = ServerPanel(self)
# image = wx.StaticBitmap(self, wx.ID_ANY)
# image.SetBitmap(wx.Bitmap('WXPython.png'))
2 years ago
self.Show()
if __name__ == '__main__':
app = wx.App(False)
frame = ServerFrame()
app.MainLoop()