* IUP images on buttons

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
avatar
jelv
Superstar
Posts: 365
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

IUP images on buttons

Post by jelv » 30 Apr 2023 20:24

I'm experimenting with putting images from https://www.tecgraf.puc-rio.br/iup/en/iupimglib.html on to a flat button and having issues with the sizing. The documentation says the images are supposed to be 32x32, but they look to be being displayed as 16x16.

For example, in the documentation "IUP_MessageHelp" is shown as
Image

But fbtnTest = iup.flatbutton{image = 'IUP_MessageInfo'} displays as
InfoImage.png
InfoImage.png (768 Bytes) Viewed 440 times
Has anyone used these successfully? They look to be the images used by iup.messagedlg which display as expected.

PS. You need to include require('iupluaimglib') to use them.
John Elvin

User avatar
Mark1834
Megastar
Posts: 2146
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: IUP images on buttons

Post by Mark1834 » 01 May 2023 08:05

John,

An interesting addition - it could create some nice attractive plugin menus and forms.

Trial and error worked - add iup.SetGlobal('IMAGESTOCKSIZE', 32) to the top of the script to set the default size. It's not obvious why that is necessary, but IUP can be unpredictable at times!
Mark Draper

avatar
jelv
Superstar
Posts: 365
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: IUP images on buttons

Post by jelv » 01 May 2023 08:47

Thanks Mark.
John Elvin

Post Reply