* Three state toggle

For plugin authors to discuss plugin programming
Post Reply
avatar
jelv
Megastar
Posts: 646
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Three state toggle

Post by jelv »

Has anyone successfully set up a three state iup.toggle?

Reducing it to the absolute minimum

Code: Select all

local tglTest = iup.toggle{3state = 'YES'}
gives the error
3State.png
3State.png (4.71 KiB) Viewed 93 times
I'm suspecting it isn't being parsed correctly as it begins with a number.
John Elvin
User avatar
Mark1834
Megastar
Posts: 2535
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Three state toggle

Post by Mark1834 »

{3state = 'YES'} is an alternative and shorter version of {['3state'] = 'YES'}. IUP controls are defined as Lua tables, and the short version is permitted only if the key is a valid Lua variable name. If you use the full version, it should work as intended.
Mark Draper
avatar
jelv
Megastar
Posts: 646
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Three state toggle

Post by jelv »

Thanks Mark
John Elvin
Post Reply