Removed all tcltk support. (0.40.5)
This commit is contained in:
parent
74a003236d
commit
4365546327
14 changed files with 5 additions and 328 deletions
59
examples/external/tcltk/tk_file_manager.fun
vendored
59
examples/external/tcltk/tk_file_manager.fun
vendored
|
|
@ -1,59 +0,0 @@
|
|||
#!/usr/bin/env fun
|
||||
|
||||
/*
|
||||
* This file is part of the Fun programming language.
|
||||
* https://fun-lang.xyz/
|
||||
*
|
||||
* Copyright 2025 Johannes Findeisen <you@hanez.org>
|
||||
* Licensed under the terms of the Apache-2.0 license.
|
||||
* https://opensource.org/license/apache-2-0
|
||||
*
|
||||
* Added: 2025-12-23
|
||||
*/
|
||||
|
||||
#include <ui/tk.fun>
|
||||
|
||||
print("Initializing Fun File Manager...")
|
||||
tk = TK()
|
||||
tk.title("Fun File Manager")
|
||||
|
||||
// Current directory
|
||||
dir = env("PWD")
|
||||
if (dir == "")
|
||||
dir = "."
|
||||
print("Current directory: " + dir)
|
||||
|
||||
tk.label("path", "Current Dir: " + dir)
|
||||
tk.pack("path")
|
||||
|
||||
// Files listbox
|
||||
tk.listbox("files")
|
||||
tk.pack("files")
|
||||
|
||||
// Populate listbox
|
||||
fun refresh(tk, dir)
|
||||
print("Refreshing file list for: " + dir)
|
||||
tk.clear("files")
|
||||
files = os_list_dir(dir)
|
||||
print("Found " + to_string(len(files)) + " entries.")
|
||||
for f in files
|
||||
tk.insert("files", "end", f)
|
||||
|
||||
refresh(tk, dir)
|
||||
|
||||
// Refresh button
|
||||
// Using tk.eval for button because tk.button currently exits the app.
|
||||
tk.eval("button .refresh -text {Refresh} -command {puts {Refresh requested}}")
|
||||
tk.pack("refresh")
|
||||
|
||||
// Exit button
|
||||
tk.button("exit", "Exit")
|
||||
tk.pack("exit")
|
||||
|
||||
print("Entering Tk loop...")
|
||||
tk.loop()
|
||||
print("Tk loop exited.")
|
||||
|
||||
/* Expected output:
|
||||
A GUI... ;)
|
||||
*/
|
||||
33
examples/external/tcltk/tk_hello.fun
vendored
33
examples/external/tcltk/tk_hello.fun
vendored
|
|
@ -1,33 +0,0 @@
|
|||
#!/usr/bin/env fun
|
||||
|
||||
/*
|
||||
* This file is part of the Fun programming language.
|
||||
* https://fun-lang.xyz/
|
||||
*
|
||||
* Copyright 2025 Johannes Findeisen <you@hanez.org>
|
||||
* Licensed under the terms of the Apache-2.0 license.
|
||||
* https://opensource.org/license/apache-2-0
|
||||
*
|
||||
* Added: 2025-12-09
|
||||
*/
|
||||
|
||||
// Demonstrates the Tk stdlib wrapper class using the new Tk opcodes.
|
||||
|
||||
include <ui/tk.fun>
|
||||
|
||||
tk = TK()
|
||||
|
||||
tk.title("Fun + Tk GUI")
|
||||
|
||||
tk.label("hello", "Hello, world!")
|
||||
tk.pack("hello")
|
||||
|
||||
tk.button("ok", "OK")
|
||||
tk.pack("ok")
|
||||
|
||||
// Enter GUI loop (no-op if built without FUN_WITH_TCLTK)
|
||||
tk.loop()
|
||||
|
||||
/* Expected output:
|
||||
A GUI... ;)
|
||||
*/
|
||||
38
examples/external/tcltk/tk_testing.fun
vendored
38
examples/external/tcltk/tk_testing.fun
vendored
|
|
@ -1,38 +0,0 @@
|
|||
#!/usr/bin/env fun
|
||||
|
||||
/*
|
||||
* This file is part of the Fun programming language.
|
||||
* https://fun-lang.xyz/
|
||||
*
|
||||
* Copyright 2025 Johannes Findeisen <you@hanez.org>
|
||||
* Licensed under the terms of the Apache-2.0 license.
|
||||
* https://opensource.org/license/apache-2-0
|
||||
*
|
||||
* Added: 2025-12-23
|
||||
*/
|
||||
|
||||
#include <ui/tk.fun>
|
||||
|
||||
print("Testing os_list_dir...")
|
||||
files = os_list_dir(".")
|
||||
print("Found " + to_string(len(files)) + " files.")
|
||||
if len(files) > 0
|
||||
print("First file: " + files[0])
|
||||
|
||||
print("Testing tk_bind parsing...")
|
||||
// We can't easily test Tk without an X server, but we can see if it crashes.
|
||||
// If built with FUN_WITH_TCLTK, it should at least initialize.
|
||||
// We use tk_eval to avoid full loop.
|
||||
rc = tk_eval("set x 1")
|
||||
print("tk_eval rc: " + to_string(rc))
|
||||
if rc == 0
|
||||
print("Tcl Result: " + tk_result())
|
||||
|
||||
/* Expected output:
|
||||
Testing os_list_dir...
|
||||
Found 23 files.
|
||||
First file: build
|
||||
Testing tk_bind parsing...
|
||||
tk_eval rc: 0
|
||||
Tcl Result: 1
|
||||
*/
|
||||
|
|
@ -320,9 +320,6 @@ using: 1
|
|||
cards)](./docs/external/pcsc.md): 1
|
||||
[openssl](./docs/external/openssl.md): 1
|
||||
[sqlite](./docs/external/sqlite.md): 1
|
||||
[tk: 1
|
||||
(tcl/tk: 1
|
||||
gui)](./docs/external/tcltk.md): 1
|
||||
[xml: 1
|
||||
(libxml2)](./docs/external/xml2.md): 1
|
||||
=: 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue