Fix stausbar bug

main
Mikael Nordin 4 years ago
parent 83e97125b8
commit bad2bf9928

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@ -51,9 +51,8 @@ class WireFrame(wx.Frame): # pylint: disable=too-many-ancestors,too-many-instan
self.make_menu_bar() self.make_menu_bar()
# and a status bar # and a status bar
self.CreateStatusBar() self.statusbar = self.CreateStatusBar(style = wx.BORDER_NONE)
self.status = str(self.num_aconns) + " active connection(s)" self.set_status()
self.SetStatusText(self.status)
self.timer = wx.Timer(self) self.timer = wx.Timer(self)
self.count = 0 self.count = 0
@ -62,6 +61,10 @@ class WireFrame(wx.Frame): # pylint: disable=too-many-ancestors,too-many-instan
self.Bind(wx.EVT_PAINT, self.timing) self.Bind(wx.EVT_PAINT, self.timing)
self.Show() self.Show()
def set_status(self):
status = str(self.num_aconns) + " active connection(s)"
self.statusbar.SetStatusText(status)
def timing(self, event): # pylint: disable=unused-argument def timing(self, event): # pylint: disable=unused-argument
""" """
Start a timer Start a timer
@ -80,6 +83,7 @@ class WireFrame(wx.Frame): # pylint: disable=too-many-ancestors,too-many-instan
self.num_aconns = len(self.active_conns) self.num_aconns = len(self.active_conns)
self.conns = self.get_wg_conns() self.conns = self.get_wg_conns()
self.num_conns = len(self.conns) self.num_conns = len(self.conns)
self.set_status()
self.write_to_sizer() self.write_to_sizer()
self.count = 0 self.count = 0
@ -125,7 +129,6 @@ class WireFrame(wx.Frame): # pylint: disable=too-many-ancestors,too-many-instan
"Please choose a config file from the file menu (CTRL+O).") "Please choose a config file from the file menu (CTRL+O).")
self.sizer.Add(hd0, 0, wx.ALIGN_CENTER) self.sizer.Add(hd0, 0, wx.ALIGN_CENTER)
self.sizer.Add(missingstr, 0, wx.ALIGN_LEFT) self.sizer.Add(missingstr, 0, wx.ALIGN_LEFT)
self.sizer.Layout() self.sizer.Layout()
def get_next_int_name(self): def get_next_int_name(self):

Loading…
Cancel
Save