+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()
+
+
+if __name__ == '__main__':
+ argparser = ArgumentParser(epilog='Report bugs to tinc@tinc-vpn.org.')