Correct Nick. I was trying to put only the part that you told me.
print (hotkeys_name[hotkey_number])
I can't see what to do and where. Sorry about this Nick, and thank you for all your help.
function create_hotkey (hotkey_number)
win = "hotkey_window_"..hotkey_number
hotkey = "hotkey_"..hotkey_number
colour = ColourNameToRGB ("gold")
offset = 115 + (67*hotkey_number)
-- make a miniwindow under the text
check (WindowCreate (win, -- window ID
offset, -- left
2, -- top
65, -- width
41, -- depth
12, -- center it (ignored anyway)
2, -- draw underneath (1) + absolute location (2)
colour)) -- background colour
-- load the icon background image if possible
button = "images/layout/button_background.png"
if WindowLoadImage (win, hotkey, GetInfo (66) .. button) == eOK then
check (WindowDrawImage (win, hotkey, 0, 0, 0, 0, 2)) -- draw it
end -- if
-- draw the 'F1' to 'F12' labels on the buttons
outlined_text (colour, win, "F"..tostring(hotkey_number), 6, 9, 23)
-- draw the label, if any
if hotkeys_name[hotkey_number] ~= nil then
outlined_text (colour, win, hotkeys_name[hotkey_number], 8, 9, 7)
end -- if
-- show the window
WindowShow (win, true)
-- create a hotspot over the timer
WindowAddHotspot(win, "hs_F"..tostring(hotkey_number), 0, 0, 65, 41, "", "", "hotkey_down", "hotkey_up" , "", "F"..tostring(hotkey_number), 1, 0)
end -- create_hotkey
function update_hotkey (hotkey_number)
if hotkeys[hotkey_number] ~= nil then
win = "hotkey_window_"..hotkey_number
hotkey = "hotkey_"..hotkey_number
colour = ColourNameToRGB ("gold")
button = "images/layout/button_background.png"
if WindowLoadImage (win, hotkey, GetInfo (66) .. button) == eOK then
check (WindowDrawImage (win, hotkey, 0, 0, 0, 0, 2)) -- draw it
end -- if
-- draw the label, if any
if hotkeys_name[hotkey_number] ~= nil then
outlined_text (colour, win, hotkeys_name[hotkey_number], 8, 9, 7)
end -- if
-- draw the 'F1' to 'F12' labels on the buttons
outlined_text (colour, win, "F"..tostring(hotkey_number), 6, 9, 23)
end -- if
end -- update_hotkey
|