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.0.tar.gz (50.2 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.0-py3-none-any.whl (64.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ikkvisualkit-0.0.0.tar.gz
  • Upload date:
  • Size: 50.2 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.0.tar.gz
Algorithm Hash digest
SHA256 6bc7cc04cad320ae070b530b5a8743f31a28e325a3c9136f02ab143382a0ee94
MD5 8aa5ea6246f9ad4027b92b111ba7c2c4
BLAKE2b-256 636931dfa69168186a6591fe970e5b4140bbab000d3bfef3262507f635998cbb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ikkvisualkit-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 64.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd58908256416a7bff537e029b20a9afb12bb47e1cc4d93395ad6856645c41f9
MD5 41c00342efd56bedf7c91848d24449a7
BLAKE2b-256 302970415ec3a2f4db49292d1c03f5d7a66986bc7901e2a8b5c59be57d16dd6a

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