https://www.hollywood-mal.com/docs/html ... utton.html
says:
But at least on my side with a button of Type #LAYERBUTTON, the `ID` is of typeID:
Contains the identifier of the button that triggered this event. This field is a number.
`#LIGHTUSERDATA`
Hence, I cannot find the actual button's ID in the message table (only the associated layer name).
Moreover, the documentation is lacking infos about the data types #USERDATA, #LIGHTUSERDATA and #THREAD:
https://www.hollywood-mal.com/docs/html ... Intro.html
So, what can I do with those data types?
Hier is a print out of all properties and types provided in the received message table of a button of type `#LAYERBUTTON` with HW10:
Code: Select all
MakeButton(Nil,#LAYERBUTTON, "LoadButton", { OnMouseDown = p_LoadButtonHandler } )
Function p_LoadButtonHandler(event)
DebugPrint("LoadButtonHandler called!")
p_DebugPrintTable(event, "----- event on loadbutton ----")
EndFunction
Function p_DebugPrintTable(table, msg)
If msg <> Nil Then DebugPrint(msg)
For k,v In Pairs(table)
If GetType(v) = #TABLE
p_DebugPrintTable(v,"Table ",k,":")
ElseIf GetType(v) = #LIGHTUSERDATA
DebugPrint(k,"=",v,"("..typeMap[GetType(v)]..")", "ToNumber:" ,ToNumber(v))
Else
DebugPrint(k,"=",v,"("..typeMap[GetType(v)]..")")
EndIf
Next
EndFunction
Thanks,LoadButton pressed!
----- event on loadbutton ----
action = OnMouseDown (#STRING)
layername = LoadButton (#STRING)
id = UserData: 0000000008CAC590 (#LIGHTUSERDATA) ToNumber: 147506576
layer = 11 (#NUMBER)
midmousedown = 0 (#NUMBER)
width = 0 (#NUMBER)
y = 0 (#NUMBER)
x = 0 (#NUMBER)
display = 1 (#NUMBER)
height = 0 (#NUMBER)
timestamp = 5.4103851318359 (#NUMBER)
rightmousedown = 0 (#NUMBER)
mousedown = 1 (#NUMBER)
Tom