SetGadgetPixmap - Why doesn't this work?

Started by TomToad, September 30, 2017, 23:59:55

Previous topic - Next topic

TomToad

Docs say this should work with BUTTON_PUSH types.  Tried both 28x28 and 12x12 pixmaps.  Neither show up.
SuperStrict
Import MaxGUI.drivers

Global Icon:TPixmap = LoadPixmap("SpinDown.png")
If Not Icon Then RuntimeError("Icon not loaded")
Global MainWindow:TGadget = CreateWindow("Test",0,0,600,400,Null)
Global Button:TGadget = CreateButton("Click",250,180,100,30,MainWindow,BUTTON_PUSH)
SetGadgetPixmap Button,Icon,GADGETPIXMAP_ICON

AddHook EmitEventHook, MyHook

Repeat
WaitEvent()
Forever

Function MyHook:Object(Id:Int, Data:Object, Contect:Object)
Local Event:TEvent = TEvent(Data)

Select Event.id
Case EVENT_WINDOWCLOSE, EVENT_APPTERMINATE
End
End Select
End Function
------------------------------------------------
8 rabbits equals 1 rabbyte.

degac

Just tested, it does work as expected.
Of course the gadget text is replaced by the pixmap.
If there's a problem, there's at least one solution.
www.blitzmax.org

Henri

It works for me if I add 'Import maxgui.xpmanifest'

-Henri
- Got 01100011 problems, but the bit ain't 00000001

TomToad

Quote from: Henri on October 01, 2017, 08:16:37
It works for me if I add 'Import maxgui.xpmanifest'

-Henri
Thanks, importing xpmanifest works great, but it does remove the 3D look of the buttons.
------------------------------------------------
8 rabbits equals 1 rabbyte.

Juiceter

Works here too. When you click the button it just shades it.