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.2.tar.gz (60.6 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.2-py3-none-any.whl (78.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ikkvisualkit-0.0.2.tar.gz
  • Upload date:
  • Size: 60.6 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.2.tar.gz
Algorithm Hash digest
SHA256 17c8b4c6627a9b4cac319fd1f36072d8d147e78dc86a725bb39d63b9601c138b
MD5 b0a2091de0bfe0d8a47a3acf233dcb85
BLAKE2b-256 b293786fe9fbf1b6d0b9e5a0dff578fc53609da08898c7f703b34758233f1dcf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ikkvisualkit-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 78.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5aab9d4dbf3a094174504447d45486b97355253c6603bcdb5386ea41d023431d
MD5 3157ae159e7777a96d2c2cfdd34e741b
BLAKE2b-256 e38e6fa46f022923730a373882fcdb306c9419a46706d797b633071de3120d78

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