So thanks to the help of Björn I am able to declare GTK3 controls from scratch. Adding signals – GTK events – to such a widget works too in the case of a button:
Private Sub AttachSignals()
#If TargetLinux
InstanceDict.Value(Mid) = new WeakRef(Self)
Dim c As cstring = "clicked"
Call g_signal_connect_object(mid, c, AddressOf ActionHandler, nil, &h1ff)
#EndIf
End Sub
When I try the same for a GTKSwitch, but now with a “state-set” tag and a modified Handler that returns a Boolean as in the docs, this method will never fire. Here is the shared method head I am referencing:
Private Shared Function StateSetHandler(button as ptr, state as boolean, Data as ptr) As Boolean
Any ideas what might be the fault? Tell me if you need a demo project to test. And thanks a lot!
5 posts - 2 participants