Page 1 of 1

Imagebutton doesn't show a brush

Posted: Tue Dec 21, 2021 4:49 pm
by jPV
If I try to use a custom brush in the imagebutton, I only get some predefined MUI image (on MorphOS). Shouldn't it work just like with the image class?

Code: Select all

@DISPLAY {hidden=True}
@REQUIRE "muiroyale"

Function p_EventFunc(msg)
   Switch msg.Class
   Case "Window":
      Switch msg.Attribute
      Case "CloseRequest":
         End
      EndSwitch
   EndSwitch
EndFunction

CreateBrush(1, 32, 32, #RED)

gui$ = [[<?xml version="1.0" encoding="iso-8859-1"?>
<application base="HELLOWORLD">
   <window title="Example GUI" muiid="MAIN" notify="closerequest" width="Visible:10">
      <hgroup>
         <vgroup>
            <image source="brush:1"/>
            <imagebutton source="brush:1"/>
         </vgroup>
         <rectangle/>
      </hgroup>
   </window>
</application>]]

mui.CreateGUI(gui$)

InstallEventHandler({MUIRoyale = p_EventFunc})

Repeat
   WaitEvent
Forever
Image

Re: Imagebutton doesn't show a brush

Posted: Thu Dec 23, 2021 3:30 pm
by sinisrus
Hello,

it doesn't work on Os4 ! For this use <button> class

Code: Select all

<imagebutton source="popup"/>
Imagebutton class work only with image object:

– ArrowDown
– ArrowLeft
– ArrowRight
– ArrowUp
– Assign
– Brush:<id>
– CheckMark
– Chip
– Cycle
– Disk
– Drawer
– HardDisk
– ListCursor
– ListSelCur
– ListSelect
– Network
– PopDrawer
– PopFile
– PopUp
– PropKnob
– RadioButton
– SliderKnob
– TapeDown
– TapePause
– TapePlay
– TapePlayback
– TapeRecord
– TapeStop
– TapeUp
– Volume

Re: Imagebutton doesn't show a brush

Posted: Fri Dec 24, 2021 9:47 am
by jPV
There's "Brush:<id>" in that list too...

Re: Imagebutton doesn't show a brush

Posted: Fri Dec 24, 2021 10:37 am
by sinisrus
yes it works with the class <image> but not with class <imagebutton>

Re: Imagebutton doesn't show a brush

Posted: Mon Dec 27, 2021 12:56 pm
by airsoftsoftwair
jPV wrote: Tue Dec 21, 2021 4:49 pm If I try to use a custom brush in the imagebutton, I only get some predefined MUI image (on MorphOS). Shouldn't it work just like with the image class?
Yes, since Imagebutton class derives from Image class it should actually work. Looks like this is broken. Will fix it.