HavocFramework / Havoc

The Havoc Framework.
GNU General Public License v3.0
6.31k stars 903 forks source link

Reworked widget to dialogs and created a brand new widget API #409

Closed p4p1 closed 9 months ago

p4p1 commented 9 months ago

Changed

import havocui

win = havocui.Dialog("main title") second = havocui.Dialog("second")

third = havocui.Widget("tmp") fourth = havocui.Widget("small")

def run_popup(): havocui.messagebox("mdrr","content") def print_msg(): print("here") def print_id(idi): print("num:", idi) third.addLabel("testing") third.addButton("popup", run_popup) third.addCheckbox("a single checkbox", print_msg) third.addCombobox(print_id, "option 1", "option 2", "option3") third.addLineedit("placeholder..", print_id) third.addCalendar(print_id) def open_third(): print(dir(havocui)) third.setBottomTab()

fourth.addLabel("testing2") fourth.addCheckbox("something", print_msg) fourth.addCheckbox("something else", print_msg) def open_fourth(): fourth.setSmallTab()

def open_second(): second.exec() def close_second(): second.close() def cal_show(data): print(data) second.addCalendar(cal_show) second.addButton("close second me!", close_second)

def call_in_widget(): print("in here") win.close() def call_checkbox(): print("checked")

def combo_box(num): print(num)

def process_line(string): print(string)

win.addLabel("This is a popup dialodjsssg") win.addCheckbox("check me!", call_checkbox) win.addButton("click me!", call_in_widget) win.addCombobox(combo_box, "test", "test1", "test2") win.addLineedit("placeholder ...", process_line)

def call_btn(): win.exec()

havocui.createtab("Widget testing", "open widget", call_btn, "open second", open_second, "open third", open_third, "open fourth", open_fourth)