Closed p4p1 closed 11 months ago
#!/usr/bin/env python # -*- coding: utf-8 -*- # Made by papi # Created on: Fri 20 Oct 2023 09:51:04 AM CEST # test_scroll.py # Description:
import havocui
abc = havocui.Widget("it is me!", True)
defi = havocui.Dialog("it is me!", True)
def close_defi(): defi.close() def add_text2(): defi.addLabel("new text!") defi.addButton("styled add text", add_text2, "background-color: blue; color: white; border: 2px solid black;") defi.addLabel("Press a button to add text!") def dial_data(num): print(num) defi.addDial(dial_data) defi.addSlider(dial_data) defi.addSlider(dial_data, True) defi.addButton("close", close_defi)
def add_text(): abc.addLabel("new text!") abc.addButton("styled add text", add_text, "background-color: blue; color: white; border: 2px solid black;") abc.addLabel("Press a button to add text!") abc.addCheckbox("checkme", add_text, "QCheckBox { background-color: yellow; color: blue; }") abc.addButton("add text", add_text) abc.addDial(dial_data) abc.addSlider(dial_data) abc.addSlider(dial_data, True)
def show_dialog(): abc.setSmallTab() def defi_show(): defi.exec()
havocui.createtab("scroll", "widget scroll test", show_dialog, "open square dialog", defi_show)
Changes
New
Screenshots
scrollable dialogs
scrollable widgets
button and checkbox with custom style
Dial and sliders
Sample code
import havocui
abc = havocui.Widget("it is me!", True)
defi = havocui.Dialog("it is me!", True)
def close_defi(): defi.close() def add_text2(): defi.addLabel("new text!") defi.addButton("styled add text", add_text2, "background-color: blue; color: white; border: 2px solid black;") defi.addLabel("Press a button to add text!") def dial_data(num): print(num) defi.addDial(dial_data) defi.addSlider(dial_data) defi.addSlider(dial_data, True) defi.addButton("close", close_defi)
def add_text(): abc.addLabel("new text!") abc.addButton("styled add text", add_text, "background-color: blue; color: white; border: 2px solid black;") abc.addLabel("Press a button to add text!") abc.addCheckbox("checkme", add_text, "QCheckBox { background-color: yellow; color: blue; }") abc.addButton("add text", add_text) abc.addDial(dial_data) abc.addSlider(dial_data) abc.addSlider(dial_data, True)
def show_dialog(): abc.setSmallTab() def defi_show(): defi.exec()
havocui.createtab("scroll", "widget scroll test", show_dialog, "open square dialog", defi_show)