Dear All,
Am facing another problem, this time it’s about renaming button labels.
The loop works fine and outputs the values
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
as stings on the console as expected.
However, on the FLbuttons the numbers are not present. Instead, all buttons are labeld with “15” although.
FLButton label does not update
Thanks in advance for your time !
FLpanel “Control”, 660, 550, 100, 100, 5, 1 ; start of container
I think this has to do with memory allocation for the FLsetText opcode being continually overwritten within the loop. The way around the problem is to use a recursive UDO:
opcode SetText, 0, io
iNumber, iCount xin
gSeqStr[iCount] sprintf "1:%d ", iCount
FLsetText gSeqStr[iCount], giHaButArray[iCount]
if iCount < iNumber then
SetText iNumber, iCount+1
endif
endop
SetText 15
But I’ll say this before anyone else does… why don’t you use Cabbage widgets instead of the FLTK ones? For achieving this sort of thing they are much more flexible and they look more modern. Maybe you have a good reason for using FLTK but I had to ask really as this is the Cabbage forum
Many thanks for our quick response Ian,
Yes, i was considering an iterative approach as well, but thought that FLsetText could not be overwritten since each handle is stored in a different location in the array.
I get your point re Cabbage which looks fantastic. Saying this, it crashed several times and the link to the latest version doesn’t work.So i downloaded a version without the studio.
However, since still a fresher with Csound, i’d like to get the basics right first.
Cheers
Dominik