News for hackers. Stuff that matters.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by oblio on Thursday November 28, 2024 @02:38PM (#42268014)
He he, is this based on Tcl? It for sure seems at least inspired by Tcl/Tk.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by felixr on Thursday November 28, 2024 @02:56PM (#42268142)
These are Go bindings for Tk, a cross-platform widget toolkit initially developed as extension for Tcl. Nowadays a lot of languages have bindings for Tcl/Tk. Python for example has been including tkinter [0] for a long time.

[0]: https://docs.python.org/3/library/tkinter.html

Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by Pet_Ant on Thursday November 28, 2024 @03:09PM (#42268228)
Really? Would love to see a binding for Powershell. Just for cross-platform shell scripts to be able to disable a pop-up for input etc. Just makes them more accessible.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by shakna on Thursday November 28, 2024 @10:01PM (#42270422)
That would be WPF. It uses Tk under the covers.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by shakna on Friday November 29, 2024 @12:08AM (#42271002)
Ah, my bad. It is inspired by Tk. Should still be usable across most things today.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by Pet_Ant on Friday November 29, 2024 @10:46AM (#42274619)
I believe that has been removed in later versions as the old examples I find online don't work in Powershell

> InvalidOperation: Unable to find type System.Windows.Forms.MessageBoxButtons].

Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by shakna on Sunday December 01, 2024 @07:13AM (#42288025)
This still works today for me:

    Add-Type -AssemblyName PresentationFramework
    [XML]$form = @"
       <Window 
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            Title="MainWindow" Height="450" Width="800">
        <Grid>
            
        </Grid>
        </Window>
    "@

    $NR = (New-Object System.Xml.XmlNodeReader $form)
    $window = [Windows.Markup.XamlReader]::Load($NR)

    $window.ShowDialog()
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by fuzztester on Thursday November 28, 2024 @05:32PM (#42269019)
yes, perl, python and ruby, for example.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by fuzztester on Thursday November 28, 2024 @05:34PM (#42269034)
yes, for python, from 1.5 or early 2.x versions onwards, iirc. I've used py a bit from 1.5 and much more from early 2.x, is how i know this.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by zoom6628 on Thursday November 28, 2024 @10:42PM (#42270601)
Seems Tk is now the default cross platform UI for any language. It is doing for local apps what JavaScript has not - a usable toolset for majority of use cases without a ton of overhead and interference. I e only played with tcl/tk over the years - now will put in some hard yards to try in depth. Golang+tk for heavy lifting and server side and tcl/tk for scripts and as hoc things. After 50 years of casual/prof development this might be my personal version of nirvana. YMMV.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by euroderf on Friday November 29, 2024 @11:47AM (#42275071)
> Seems Tk is now the default cross platform UI for any language.

So let's hope someone writes a wasm binding.

Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by dlachausse on Thursday November 28, 2024 @02:57PM (#42268150)
Similarly to Python Tkinter, it actually embeds Tcl/Tk and provides a Go interface to it.
Re:Tk9.0: CGo-free, cross platform GUI toolkit for Go by tecleandor on Thursday November 28, 2024 @02:56PM (#42268137)
And latest Tcl/Tk is v9 I think. So I guess there should be something...