Skip to content

Test of ubFormattedWidth #5

@trevixdesign

Description

@trevixdesign

I did a test of a Universal button similar to "next card>" where the ">" is a SVG drawing, supposily always aligned right.
Label is aligned left
Icon gravity is right
The change of label is not reflected on the formatted width, being herratic...Please note: the width in msg is opposite to the width in the property inspector.
The only way to make it works is to put a "wait x seconds with messages" after the change of label and before the ubFormattedWidth function
Any help is appreciated. Thanks

This is the code, from another button, used to verify the formatted width:

on mouseUp pMouseButton
     put the topRight of  widget "UbtnTest"  into tTopRight
     put the buttonText of widget "UbtnTest" into tLabel
     if tLabel = "next card" then
          set the buttonText of widget "UbtnTest" to "up"
     else
          set the buttonText of widget "UbtnTest" to "next card"
     end if
--wait 1 seconds with messages
     put the ubFormattedWidth of widget "UbtnTest" into tWidth
     put tWidth into msg
     set the width of widget "UbtnTest" to tWidth 
     set the topRight of widget "UbtnTest" to tTopRight
end mouseUp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions