TKCS 1.0.0
USE THE 1.1.0-ALPHA VERSION. 1.0.0 IS EXTREMELY UNSTABLE.
See the version list below for details.
dotnet add package TKCS --version 1.0.0
NuGet\Install-Package TKCS -Version 1.0.0
<PackageReference Include="TKCS" Version="1.0.0" />
<PackageVersion Include="TKCS" Version="1.0.0" />
<PackageReference Include="TKCS" />
paket add TKCS --version 1.0.0
#r "nuget: TKCS, 1.0.0"
#:package TKCS@1.0.0
#addin nuget:?package=TKCS&version=1.0.0
#tool nuget:?package=TKCS&version=1.0.0
TKCS (Tkinter CSharp) π
A lightweight, object-oriented Windows Forms wrapper library that mirrors classic Python Tkinter layout design and syntax conventions natively in C#.
π Features
- Tkinter Syntax: Use familiar Python-like constructors like
button,label, andentryinside theTKCSnamespace. - 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
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 |