For some design reassons i need to make button with 2 lines of text, both of which should be centered and looks like usual button.
For first i simple tried "\n" for the button.gadget's GA_Text : it simple didnt' work, and \n treatet as fancy character.
Then, Javier point me out that we may try this way : create label.image object with LABLE_Text (this one handle \n fine), and then, attach it to a button:
twolinesimage = IIntuition->NewObject(NULL, "label.image", LABEL_Text, "Replace All\nin All Tabs", LABEL_Justification, LJ_CENTER, TAG_END); ... LAYOUT_AddChild, IIntuition->NewObject(NULL, "button.gadget", GA_Image, twolinesimage, TAG_DONE), ...
While it more or less work, it have 2 issues :
1). LABEL_Justification, LJ_CENTER/LJ_RIGHT/LJ_LEFT, for the Label object seems do not work. Text centered if you just have it one in layout, but you can't control it seems so to be one left or on right by Justification.
2). When we press on this "button", it acts not like usual button visually, but bring some background. Can it be done somehow so to act like a button when pressed ?
So question is : how to make a 2 lines button , which looks like button, and press like button (even if it will be not real button), and have centered text in.
Thanks!
Seems below code does the job.
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P