Button from Image

BlitzMax Forums/MaxGUI Module/Button from Image

Richard Betson(Posted 2012) [#1]
Hi, does MaxGUI allow images to be used for buttons. I tried the below code and can't get it to work.




rs22(Posted 2012) [#2]
It works for me if I import maxgui.xpmanifest.


Richard Betson(Posted 2012) [#3]
Really? Hmmm.
I had no idea you could do "Import maxgui.xpmanifest". Doing that does work. :) Thanks.

I may just use panels (as buttons) instead of buttons, as I will be porting my project to Linux and Mac and I am thinking it may be less of a problem using panels (as buttons) instead of buttons.

- Rich -

Last edited 2012


jsp(Posted 2012) [#4]
I had no idea you could do "Import maxgui.xpmanifest".

Or you could import your own manifest to define application icon and meta data. At least that was the reason the default manifest was taken out.

Using panels is probably a good idea, buttons with images are limited and not really cross platform.
Unfortunately there is a bug on Mac (memory leak) when setting continuously a new image but that should be no problem for static picture, otherwise use a canvas.


Richard Betson(Posted 2012) [#5]
Unfortunately there is a bug on Mac (memory leak) when setting continuously a new image but that should be no problem for static picture, otherwise use a canvas.


I had planed to update the panel with up/down images. On Mac this would be a fail? Perhaps freeing the panel gadget and recreating it would be a fix as I'm not sure canvas will let me display a button image the same as a panel would.


jsp(Posted 2012) [#6]
I wouldn't bother if you change the image only sometimes. The image is probably quite small so only a few bytes lost...
I compiled Grisu's Pocket Radio Player and he used a panel as equalizer, so images changed fast and the memory went up as hell.
Using a canvas for the same thing was no problem and it can look the same, but a panel is easier to handle.


Richard Betson(Posted 2012) [#7]
Right on.

BTW, nice GUI. Based on MaxGUI?


jsp(Posted 2012) [#8]
Yes, Grisu used only MaxGui to be cross platform (and some canvasses for special stuff).