Button Pixmaps
BlitzMax Forums/MaxGUI Module/Button Pixmaps
| ||
I'm trying to create some buttons with images. I'm using LogicGui to create the code but have also tried fiddling with it and just cannot get it to work.But = CreateButton("",13,14,109,72,tabber_Tab2,BUTTON_PUSH|BUTTON_RADIO) Local Pixmap_But:TPixmap = LoadPixmapPNG ( "image.png" ) SetGadgetPixmap( But , Pixmap_But ,GADGETPIXMAP_ICON|GADGETPIXMAP_NOTEXT ) Am I doing something wrong? |
| ||
IIRC no radio, checkbox or OK buttons are allowed for cross-platform reason. So try a simple push or cancel button. [EDIT] mixed ok and cancel button and corrected it. |
| ||
Yeah, I tried all types and none of them work. |
| ||
I just tried it and it's working here fine for standard push buttons and cancel buttons! I'm using MaxGui 1.39 and checked with different images, all are working. Could it be your chosen image? |
| ||
Hmm, could be but its just a simple png. I'll try it with a different image and see if that works. Did you try it with a push radio button? As that's what I'm aiming for. If not I'll have to code my own, poss using the new panel sunken/raised borders :) |
| ||
@Ghostdancer: What platform are you on? |
| ||
I did the first test on XP and have now also checked Win7 Home 64 bit, both do work for me. Push radio buttons are no problem, worked fine. |
| ||
I've tried different images but no joy :( I'm using Windows XP |
| ||
Did you try rebuilding MaxGui, not that I see a specific reason, but just to make sure your installation is ok. |
| ||
Aye, tried that and I'm using then latest version of maxgui (1.4) |
| ||
Aye, tried that and I'm using then latest version of maxgui (1.4) Short, self-contained runnable code example please. :-) |
| ||
Was already writing a short example and as it happens it works just fine. There must be something in my main application thats preventing it from working but not sure what (its using identical code). Sorry to have bothered you with this and thanks for helping. I'll investigate further... |
| ||
You don't happen to be importing an executable icon into the project, do you? Using an object (.o) file? Does it automagically work if you comment your import out? :-) |
| ||
Ah, that's exactly what I'm doing and if I comment out the import the button pixmap does indeed work :) Good call, thank you, I would never have figured that out. How come the import stops it working and is there any way around this? |
| ||
You have to make sure that when you create your object file, you also include a manifest file so that Windows uses the latest version of its common control library (which have icon support). When you import your own object file, it overrides the default manifest object file which Win32MaxGUIEx includes, which explains why the examples work, but your project doesn't. See here for information on creating an all-in-one object file. |
| ||
Nice one, thanks Seb. All working now :) |