Skip to content

bilal-08/bun-tkinter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bun-Tkinter

Bun-Tkinter

Bun-Tkinter is a TypeScript wrapper for Tcl/Tk, offering a modern, object-oriented interface for developing GUI applications with Bun. Since this Library uses Bun:ffi, There's Zero external dependencies, except for Tcl itself.

A basic Window

🚀 Installation

To get started with Bun-Tkinter, clone the repository:

git clone https://github.com/bilal-08/Bun-Tkinter.git
cd Bun-Tkinter

📌 Note

Before running the examples, make sure to set the following environment variables to point to the necessary Tcl/Tk libraries:

(You can set these temporarily in PowerShell using the commands below.)

$env:TCL_LIBRARY = "C:\\B\\bun-tkinter\\lib\\tcl86t.dll"
$env:TK_LIBRARY = "C:\\B\\bun-tkinter\\lib\\tk86t.dll"

🎉 Running Examples

To familiarize yourself with the library, you can run the provided examples:

Note: uncomment more examples given the ./example.ts

bun run ./examples.ts

🛠 Example Code

Here’s a simple example demonstrating how to create a basic window using Bun-Tkinter:

import { createTkApp, runTkApp, Tk } from ".";

// Basic window example
function basicWindowExample() {
    // Define the window name and dimensions.
    const root = createTkApp("Basic Window", "300x200");
    const label = root.Label("Welcome to Tk with Bun!");
    label.pack();
    runTkApp(root);
}

📝 TODO

  • Add cross-platform executable files for macOS and Linux in the ./lib folder.

About

Bringing GUI to Bun. A wrapper around tcl/tk.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published