Since you have editable combo box i assuming that you want to add or delete entrys manually.
dialog comby {
title "" size -1 -1 124 86
option dbu
button "CLOSE", 1, 2 2 37 12, ok
button "ADD", 2, 2 20 37 12
button "DELETE", 3, 2 32 37 12
combo 4, 40 2 80 80, sort edit drop
}
Now we will set variable to entered value in combo box
on *:dialog:comby:edit:4: {
set %tempmessage $did(4)
}
;now we will write that in text file whe you click add button
on *:dialog:comby:sclick:2: {
;first we will check does variable have value
if (%tempmessage) {
write data.txt %tempmessage
;we will put that data in your combo box
loadbuf -ro comby 4 data.txt
;and unset variable beaocouse we don`t want to 2 times add same data in case you click add button twice
}
}
now deleting
on *:dialog:comby:sclick:4: {
;we will set variable to line number you want to delete from your text file
set %line $did(4).sel
}
on *:dialog:comby:sclick:3: {
;again check for variable to have value
if (%line) {
write -dl $+ %line data.txt
;and load data in combo box without entry that you deleted
loadbuf -ro comby 4 data.txt
unset %line
}
}
and last thing,you want that data to be in combobox when you open dialog
on *:dialog:comby:init:*: {
if ($lines(data.txt) != 0) { loadbuf -ro comby 4 data.txt }
}
or if you want to check is there text file you can do so like this
on *:dialog:comby:init:*: {
if ($exists(data.txt)) && ($lines(data.txt) != 0) { loadbuf -ro comby 4 data.txt }
}
If this is what you want i am glad to help in case that you need something else you can post it again with more info about what you want to do.