Imagebutton doesn't show a brush

Discuss GUI programming with the MUI Royale plugin here
Post Reply
User avatar
jPV
Posts: 466
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Imagebutton doesn't show a brush

Post 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

sinisrus
Posts: 342
Joined: Tue Apr 21, 2015 5:43 pm

Re: Imagebutton doesn't show a brush

Post 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

User avatar
jPV
Posts: 466
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Imagebutton doesn't show a brush

Post by jPV »

There's "Brush:<id>" in that list too...

sinisrus
Posts: 342
Joined: Tue Apr 21, 2015 5:43 pm

Re: Imagebutton doesn't show a brush

Post by sinisrus »

yes it works with the class <image> but not with class <imagebutton>

User avatar
airsoftsoftwair
Posts: 4984
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Imagebutton doesn't show a brush

Post 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.

Post Reply