+ def on_quit(self, event):
+ app.ExitMainLoop()
+
+ def on_timer(self, event):
+ vpn.refresh()
+ self.np.nodes.refresh()
+ self.np.subnets.refresh()
+ self.np.edges.refresh()
+ self.np.connections.refresh()
+
+
+def main(netname, pidfile):
+ global vpn, app
+
+ if netname is None:
+ netname = os.getenv('NETNAME')
+
+ vpn = VPN(netname, pidfile)
+ vpn.connect()
+
+ app = wx.App()
+ mw = MainWindow(None, -1, 'Tinc GUI')
+
+ """
+ def OnTaskBarIcon(event):
+ mw.Raise()
+ """
+
+ """
+ icon = wx.Icon("tincgui.ico", wx.BITMAP_TYPE_PNG)
+ taskbaricon = wx.TaskBarIcon()
+ taskbaricon.SetIcon(icon, 'Tinc GUI')
+ wx.EVT_TASKBAR_RIGHT_UP(taskbaricon, OnTaskBarIcon)
+ """
+
+ app.MainLoop()
+ vpn.close()
+