makeOrderView :: WithModel => t -> IO () -> IO (PropertyView Bool)
makeOrderView parent onState = do
  view <- makePropertyView (, False) parent onState
  let store = propertyViewStore view
      right = propertyViewRight view

  treeViewSetRulesHint right True

  column <- treeViewColumnNew
  treeViewColumnSetTitle column "Order"
  treeViewAppendColumn right column
  cell <- cellRendererComboNew
  treeViewColumnPackStart column cell True
  cellLayoutSetAttributes column cell store $ \(_, dir) ->
    [ cellText := dirToString dir ]

  cmod <- listStoreNewDND [False, True] Nothing Nothing
  let clid = makeColumnIdString 0
  customStoreSetColumn cmod clid dirToString
  cell `set` [ cellTextEditable   := True
             , cellComboHasEntry  := False
             , cellComboTextModel := (cmod, clid) ]
  cell `on` edited $ \[n] str -> do
    (prop, dir) <- listStoreGetValue store n
    let dir' = stringToDir str
    unless (dir' == dir) $
      listStoreSetValue store n (prop, dir')

  return view
makeOrderView :: WithModel => t -> IO () -> IO (PropertyView Bool)
makeOrderView parent onState = do
  view <- makePropertyView (, False) parent onState
  let store = propertyViewStore view
      right = propertyViewRight view

  treeViewSetRulesHint right True

  column <- treeViewColumnNew
  treeViewColumnSetTitle column "Order"
  treeViewAppendColumn right column
  cell <- cellRendererComboNew
  treeViewColumnPackStart column cell True
  cellLayoutSetAttributes column cell store $ \(_, dir) ->
    [ cellText := dirToString dir ]

  cmod <- listStoreNewDND [False, True] Nothing Nothing
  let clid = makeColumnIdString 0
  customStoreSetColumn cmod clid dirToString
  cell `set` [ cellTextEditable   := True
             , cellComboHasEntry  := False
             , cellComboTextModel := (cmod, clid) ]
  cell `on` edited $ \[n] str -> do
    (prop, dir) <- listStoreGetValue store n
    let dir' = stringToDir str
    unless (dir' == dir) $
      listStoreSetValue store n (prop, dir')

  return view
makeOrderView parent onState = do
  view <- makePropertyView (, False) parent onState
  let store = propertyViewStore view
      right = propertyViewRight view

  treeViewSetRulesHint right True

  column <- treeViewColumnNew
  treeViewColumnSetTitle column "Order"
  treeViewAppendColumn right column
  cell <- cellRendererComboNew
  treeViewColumnPackStart column cell True
  cellLayoutSetAttributes column cell store $ \(_, dir) ->
    [ cellText := dirToString dir ]

  cmod <- listStoreNewDND [False, True] Nothing Nothing
  let clid = makeColumnIdString 0
  customStoreSetColumn cmod clid dirToString
  cell `set` [ cellTextEditable   := True
             , cellComboHasEntry  := False
             , cellComboTextModel := (cmod, clid) ]
  cell `on` edited $ \[n] str -> do
    (prop, dir) <- listStoreGetValue store n
    let dir' = stringToDir str
    unless (dir' == dir) $
      listStoreSetValue store n (prop, dir')

  return view