Download The demexp Book - Linux
Transcript
A question backend contains three columns: the identifier and the descriptor of each
question, as well as a check box indicating if the question is public or not. It also stores the
selected question.
131a
hclsf.ml 129i+≡
class question_backend () =
let columns = new GTree.column_list in
let col_public = columns#add Gobject.Data.boolean in
let col_id = columns#add Gobject.Data.int in
let col_desc = columns#add Gobject.Data.string in
let store = GTree.list_store columns in
/ 130 131b .
let _ = store#set_sort_column_id col_id.GTree.index ‘DESCENDING in
object
method
method
method
method
col_id = col_id
col_desc = col_desc
col_public = col_public
store = store
val mutable selected_question : int option = None
method selected_question = selected_question
method set_selected_question s = selected_question <- s
end
All those backends are grouped in a common data structure.
131b
hclsf.ml 129i+≡
type backends = {
tags : tag_backend;
question_tags : tag_backend;
questions : question_backend;
}
/ 131a 132 .
131