TKCS 1.0.0

Additional Details

USE THE 1.1.0-ALPHA VERSION. 1.0.0 IS EXTREMELY UNSTABLE.

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package TKCS --version 1.0.0
                    
NuGet\Install-Package TKCS -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TKCS" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TKCS" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TKCS" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TKCS --version 1.0.0
                    
#r "nuget: TKCS, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TKCS@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TKCS&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TKCS&version=1.0.0
                    
Install as a Cake Tool

TKCS (Tkinter CSharp) πŸš€

A lightweight, object-oriented Windows Forms wrapper library that mirrors classic Python Tkinter layout design and syntax conventions natively in C#.

NuGet Version Platform


🌟 Features

  • Tkinter Syntax: Use familiar Python-like constructors like button, label, and entry inside the TKCS namespace.
  • Strongly-Typed Wrappers: Argument validation via explicit types (new text(), new bgcolor()) prevents type assignment mismatches.
  • Auto-Parenting: Child UI controls automatically register and attach to the active parent window context without manual .Add() clutter.
  • Inline Callbacks: Wire up button execution logic instantly using standard C# lambda expressions (() => { ... }).
  • Optional Geometry Injections: Clean positioning parameters using an integrated layout model (new Geometry(x, y, w, h)).

πŸ“¦ Installation

To inject the TKCS toolkit architecture into your standard .NET application workspace, run the following command via the .NET CLI:

dotnet add package TKCS

Alternatively, search for TKCS via the Package Manager Console UI inside Visual Studio.

⚠️ Prerequisite requirement: Your project target runtime properties configuration profile must be explicitly set to target Windows desktop platforms (e.g., <TargetFramework>net8.0-windows</TargetFramework> and <UseWindowsForms>true</UseWindowsForms>).


⚑ Quick Start Example

Here is how easy it is to spin up an interactive desktop GUI window with text input modules and custom styled buttons using TKCS:

using System;
using TKCS; // Import the wrapper engine namespace

class Program
{
    [STAThread] // Required execution thread behavior for Windows Forms UI loop engines
    static void Main()
    {
        // Enable OS native visual styling paradigms
        System.Windows.Forms.Application.EnableVisualStyles();

        // 1. Initialize the Root Window Frame (analogous to root = Tk() in Python)
        Tk root = new Tk(new text("TKCS Engine Playground Framework"), width: 500, height: 450);
        root.Show(); // Makes the current frame context active for child widgets

        // 2. Generate a custom descriptive label layout component
        label instructions = new label(
            new text("Enter your script system instructions inside the text field:")
        );

        // 3. Instantiate a custom text input processing module
        entry inputField = new entry(
            new text("Type parameters here..."),
            new Geometry(x: 20, y: 110, width: 250, height: 25)
        );

        // 4. Create an interactive command execution button matching your exact layout syntax
        button actionBtn = new button(
            new bgcolor("#1E1E1E"), 
            new textcolor("#00FF00"), 
            new onclick(() => {
                string currentContent = inputField.Text;
                System.Windows.Forms.MessageBox.Show($"Executing command: {currentContent}", "TKCS Success Callback");
            }), 
            new text("Run Automation Action"),
            new Geometry(x: 20, y: 160, width: 200, height: 45)
        );

        // 5. Fire the main lifecycle event message pump listener loop
        root.mainloop();
    }
}

πŸ—ΊοΈ Framework Mapping Overview

Tkinter (Python) TKCS Class (C#) Underlying Native WinForms Control
Tk() Tk System.Windows.Forms.Form
Button() button System.Windows.Forms.Button
Label() label System.Windows.Forms.Label
Entry() entry System.Windows.Forms.TextBox (Single Line)
Checkbutton() checkbutton System.Windows.Forms.CheckBox
Listbox() listbox System.Windows.Forms.ListBox
Scale() scale System.Windows.Forms.TrackBar
Text() text_widget System.Windows.Forms.TextBox (Multi-Line + Scroll)

πŸ› οΈ Formatting Layout Reference

Every component class accepts an optional Geometry configuration block to precisely anchor controls across explicit pixel metrics layouts:

new Geometry(int x, int y, int width, int height);

If omitting the layout parameter on initialization routines entirely, the toolkit defaults to standard cascade offset coordinates internally.


πŸ“„ License

This framework configuration is open-source software licensed under the MIT License. Feel free to modify, expand, or fork the framework logic pipeline properties.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0-alpha 74 5/17/2026
1.0.0 93 5/17/2026 1.0.0 is deprecated because it has critical bugs.