Skip to main content

Insight.k.k. VisualKit for easy application development

Project description

ikkVisualKit

Pythonアプリケーション開発用の軽量GUIツールキット。tkinterとcustomtkinterをベースに、ウィンドウ、ダイアログ、システムトレイアプリケーション用の汎用コンポーネントを提供します。

主な機能

  • ウィンドウベースクラス - CTkやtkinterベースのウィンドウを簡単に構築
  • ダイアログコンポーネント - OK、YesNo、カスタムダイアログなど汎用ダイアログ
  • システムトレイ対応 - トレイメニュー、常駐アプリケーション機能
  • 画像管理 - パッケージ内の画像リソースを統一的に管理

インストール

pip install ikkVisualKit

使用例

from ikkVisualKit import WindowBaseModan

class MainWindow(WindowBaseModan):
    def __init__(self):
        super().__init__(
            title="My Application",
            version="1.0.0",
            size=(1000, 600)
        )
    
    def _build(self, root):
        super()._build(root)
        # UIパーツの配置

if __name__ == "__main__":
    app = MainWindow()
    app.show_window()
    app.run()

Overview

ikkVisualKitはGUIアプリ作成用典型的なパーツのToolKitです。

Feature

  • CustomTkinterベース
  • DPIスケーリング対応
  • フォームアプリの作成が容易になるBaseクラスの提供
  • フォームアプリ向けに
  • 常駐(タスクトレイ)アプリの作成を用意するテンプレートの提供
  • サイズの大きいカスタムメッセージダイアログの提供

インストール方法

pip install ikkVisualKit

利用方法

from ikkVisualKit import WindowBaseModan    #ファームアプリを作成する場合
from ikkVisualKit import DialogResult       #ダイアログを利用する場合

フォームアプリケーションの作成方法

フォームの作成

  1. WindowBaseModanを継承した任意のウインドウクラスを作成します。
  2. def _build(self, root):をオーバライドして,super()._build(root)を実行します。
  3. show_window()run()を実行するとWindowアプリケーションが起動します。
from ikkVisualKit import WindowBaseModan

class MainWindow(WindowBaseModan):
    def __init__(self):
        super().__init__(
            title="MyApplecation",  #アプリ名
            version="0.0.0",        #バージョン
            size=(1000, 600),       #ウィンドウサイズ
            icon_path="resources/icon.dio.ico", #アイコンパス(.ico推奨)
            tray_app=False          #常駐アプリにしたいならTrue
            )
    #----------------------------------------------
    def _build(self, root):
        super()._build(root)
        #パーツの配置
if __name__ == "__main__":
    app = MainWindow()
    app.show_window()
    app.run()

カスタムボタン

  • 大中小3タイプのボタンサイズを用意
  • ツールチップテキストをプロパティとして用意
  • マウスホバー時の色変更
  • ボタンに付与するアイコン画像を予め用意

小さいアイコン付きボタン

以下のコードは小さいサイズのアイコン付きボタンを作成する例です。 コンストラクタのx,yに配置する座標を指定し、image_keyでアイコンを指定してください。 ツールチップテキストと、イベントハンドラを後から登録することが可能です。

self.btnSetting  = self.make_ActionButton(x=16 , y=176, image_key="setting.dio")
self.btnSetting.tooltip_text = "設定を開く"  #ツールチップテキスト設定
self.btnSetting.command = self.on_setting   #ボタン押下で実行する関数の登録

alt text

大きいサイズのボタン

大きいサイズのボタンを利用する場合ばsize_rank=1もしくはsize_rank=2を指定してください。また、text=で指定した文字がアイコンと共に表示されます。

self.btnStart    = self.make_ActionButton(624, 16 , image_key="start.dio",size_rank=2,text="検査スタート")
self.btnClear    = self.make_ActionButton(784, 16 , image_key="clear.dio",size_rank=1,text="クリア")

アイコンの一覧

Name Image
clear.dio clear.dio
goto.dio clear.dio
help.dio clear.dio
link.dio clear.dio
lock.dio clear.dio
log.dio clear.dio
open.dio clear.dio
recipe.dio clear.dio
save.dio clear.dio
search.dio clear.dio
setting.dio clear.dio
start.dio clear.dio
unlock.dio clear.dio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ikkvisualkit-0.0.1.tar.gz (59.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ikkvisualkit-0.0.1-py3-none-any.whl (76.7 kB view details)

Uploaded Python 3

File details

Details for the file ikkvisualkit-0.0.1.tar.gz.

File metadata

  • Download URL: ikkvisualkit-0.0.1.tar.gz
  • Upload date:
  • Size: 59.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for ikkvisualkit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 89336ebe08bf42cb81d050d08a9bd0c640c2eace41b62b52cefaf0ce85e84702
MD5 80729beadb16005c328192669837dfb0
BLAKE2b-256 c9ab63981066958296b5bf7792f76eb09dd6a3f1c793f568c926943a7ba62783

See more details on using hashes here.

File details

Details for the file ikkvisualkit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ikkvisualkit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 76.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for ikkvisualkit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cd16887b492cb5f6e18b3a848f596fac80fce3cc70ba38797e2cbe77c8f1928d
MD5 898763099fd80cd7363ba96502e308e4
BLAKE2b-256 dd33250aab3c29558c863940f04b777f5c371ca9cbfc845d37fae4ae9689851f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page