October 26, 2020, 12:41:19 AM

Author Topic: SetGadgetPixmap - Why doesn't this work?  (Read 1951 times)

Offline TomToad

  • Hero Member
  • *****
  • Posts: 517
SetGadgetPixmap - Why doesn't this work?
« on: September 30, 2017, 11:59:55 PM »
Docs say this should work with BUTTON_PUSH types.  Tried both 28x28 and 12x12 pixmaps.  Neither show up.
Code: [Select]
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.

Offline degac

  • Full Member
  • ***
  • Posts: 159
    • graphio.net
Re: SetGadgetPixmap - Why doesn't this work?
« Reply #1 on: October 01, 2017, 06:52:46 AM »
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

Offline Henri

  • Sr. Member
  • ****
  • Posts: 263
Re: SetGadgetPixmap - Why doesn't this work?
« Reply #2 on: October 01, 2017, 08:16:37 AM »
It works for me if I add 'Import maxgui.xpmanifest'

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

Offline TomToad

  • Hero Member
  • *****
  • Posts: 517
Re: SetGadgetPixmap - Why doesn't this work?
« Reply #3 on: October 01, 2017, 12:37:00 PM »
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.

Offline Juiceter

  • Jr. Member
  • **
  • Posts: 65
Re: SetGadgetPixmap - Why doesn't this work?
« Reply #4 on: November 27, 2017, 03:37:13 PM »
Works here too. When you click the button it just shades it.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal