B4J Question How to style and set tooltip for each SegmentedButton item?

m4.s

Member
Licensed User
Longtime User
As a follow-up to this useful thread:

Add Images to Segmented Control Possible? | B4X Programming Forum

I need to instead set the [button] item background color, text color and tooltip text (each with different values).

Seems the function would start with this:

B4X:
Sub SetStyleAndTooltip(SegmentedButton As SegmentedButton, Index As Int, ?? As ??)
   Dim ToggleButton As JavaObject = SegmentedButton
   ToggleButton = ToggleButton.RunMethodJO("getButtons", Null).RunMethod("get", Array(Index))
   ToggleButton.RunMethod("set?", Array(??))
   ToggleButton.RunMethod("set?", Array(??))
   ToggleButton.RunMethod("set?", Array(??))
End Sub
 

m4.s

Member
Licensed User
Longtime User
You example code worked like a charm Erel (after adding tooltip text function argument and dimensioning the xui variable). Thank you!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…