Commit 18872064 authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Added callback functions

parent 7287d8e7
Pipeline #3764 canceled with stages
......@@ -46,7 +46,7 @@ proc createArea(boxMainWindow: Box) =
btnRestart.connect("clicked", ansurf_gtk_do_restart, cb_send_msg)
# btnStatus.connect("clicked", ansurf_gtk_do_status) # TODO handle do status differently
# btnStart.connect("clicked", ansurf_gtk_do_start_stop, cb_kill_apps, cb_send_msg)
btnStart.connect("clicked", ansurf_gtk_do_start_stop, cb_send_msg)
btnChangeID.connect("clicked", ansurf_gtk_do_changeid, cb_send_msg)
btnCheckIP.connect("clicked", ansurf_gtk_do_myip, cb_send_msg)
......
......@@ -9,5 +9,5 @@ proc init_cli_askkill*(is_desktop: bool): callback_kill_apps =
return cli_kill_apps
proc init_gtk_askkill*(is_desktop: bool): proc =
proc init_gtk_askkill*(): proc =
return window_kill_app
import gintro / gtk
# import .. / cores / ansurf_types
type
......@@ -32,6 +33,7 @@ type
isDNSPort*: bool
isSocksPort*: bool
isTransPort*: bool
# AnsurfStartArgs* = tuple[cb_kill_apps: callback_kill_apps, cb_send_msg: callback_send_messenger]
# MyIP* = object
# thisAddr*: string
# isUnderTor*: string
......
import gintro / gtk
import .. / .. / cores / handle_activities
# import .. / # TODO import object here and try work with the tuple for click
# import .. / ansurf_objects
import .. / .. / cores / handle_killapps
proc ansurf_gtk_do_start_stop*(b: Button, cb_kill_apps, cb_send_msg: proc) =
# proc ansurf_gtk_do_start_stop*(b: Button, cb_kill_apps, cb_send_msg: proc) =
proc ansurf_gtk_do_start_stop*(b: Button, cb_send_msg: proc) =
let cb_kill_apps = init_gtk_askkill()
if b.label == "Start":
ansurf_acts_handle_start("gksudo", cb_kill_apps, cb_send_msg)
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment