1ab0af9896
travis build: 27
commit: e4bb5104e8
auto-pushed to gh-pages
11 lines
12 KiB
HTML
11 lines
12 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>HSFM.GUI.Gtk.Utils</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
|
|
window.onload = function () {pageLoad();setSynopsis("mini_HSFM-GUI-Gtk-Utils.html");};
|
|
//]]>
|
|
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/HSFM-GUI-Gtk-Utils.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">hsfm-gtk</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">HSFM.GUI.Gtk.Utils</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:getSelectedTreePaths">getSelectedTreePaths</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [TreePath]</li><li class="src short"><a href="#v:getSelectedItems">getSelectedItems</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [<a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a>]</li><li class="src short"><a href="#v:withItems">withItems</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> ([<a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a>] -> <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> ()) -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:fileListStore">fileListStore</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a> -> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (ListStore <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a>)</li><li class="src short"><a href="#v:getFirstItem">getFirstItem</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a></li><li class="src short"><a href="#v:getCurrentDir">getCurrentDir</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a></li><li class="src short"><a href="#v:pushStatusBar">pushStatusBar</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-String.html#t:String">String</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (ContextId, MessageId)</li><li class="src short"><a href="#v:popStatusbar">popStatusbar</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:rawPathToIter">rawPathToIter</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> TreePath -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Maybe.html#t:Maybe">Maybe</a> TreeIter)</li><li class="src short"><a href="#v:rawPathToItem">rawPathToItem</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> TreePath -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Maybe.html#t:Maybe">Maybe</a> <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a>)</li><li class="src short"><a href="#v:addHistory">addHistory</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Eq.html#t:Eq">Eq</a> a => a -> [a] -> [a]</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:getSelectedTreePaths" class="def">getSelectedTreePaths</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [TreePath] <a href="src/HSFM-GUI-Gtk-Utils.html#getSelectedTreePaths" class="link">Source</a> <a href="#v:getSelectedTreePaths" class="selflink">#</a></p></div><div class="top"><p class="src"><a id="v:getSelectedItems" class="def">getSelectedItems</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> [<a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a>] <a href="src/HSFM-GUI-Gtk-Utils.html#getSelectedItems" class="link">Source</a> <a href="#v:getSelectedItems" class="selflink">#</a></p><div class="doc"><p>Gets the currently selected item of the treeView, if any.</p></div></div><div class="top"><p class="src"><a id="v:withItems" class="def">withItems</a> <a href="src/HSFM-GUI-Gtk-Utils.html#withItems" class="link">Source</a> <a href="#v:withItems" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> ([<a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a>] -> <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> ())</td><td class="doc"><p>action to carry out</p></td></tr><tr><td class="src">-> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Carry out an action on the currently selected item.</p><p>If there is no item selected, does nothing.</p></div></div><div class="top"><p class="src"><a id="v:fileListStore" class="def">fileListStore</a> <a href="src/HSFM-GUI-Gtk-Utils.html#fileListStore" class="link">Source</a> <a href="#v:fileListStore" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a></td><td class="doc"><p>current dir</p></td></tr><tr><td class="src">-> <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a></td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (ListStore <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a>)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Create the <code>ListStore</code> of files/directories from the current directory.
|
|
This is the function which maps the Data.DirTree data structures
|
|
into the GTK+ data structures.</p></div></div><div class="top"><p class="src"><a id="v:getFirstItem" class="def">getFirstItem</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a> <a href="src/HSFM-GUI-Gtk-Utils.html#getFirstItem" class="link">Source</a> <a href="#v:getFirstItem" class="selflink">#</a></p><div class="doc"><p>Currently unsafe. This is used to obtain any item, which will
|
|
fail if there is none.</p></div></div><div class="top"><p class="src"><a id="v:getCurrentDir" class="def">getCurrentDir</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a> <a href="src/HSFM-GUI-Gtk-Utils.html#getCurrentDir" class="link">Source</a> <a href="#v:getCurrentDir" class="selflink">#</a></p><div class="doc"><p>Reads the current directory from MyView.</p><p>This reads the MVar and may block the main thread if it's
|
|
empty.</p></div></div><div class="top"><p class="src"><a id="v:pushStatusBar" class="def">pushStatusBar</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-String.html#t:String">String</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (ContextId, MessageId) <a href="src/HSFM-GUI-Gtk-Utils.html#pushStatusBar" class="link">Source</a> <a href="#v:pushStatusBar" class="selflink">#</a></p><div class="doc"><p>Push a message to the status bar.</p></div></div><div class="top"><p class="src"><a id="v:popStatusbar" class="def">popStatusbar</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyGUI">MyGUI</a> -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> () <a href="src/HSFM-GUI-Gtk-Utils.html#popStatusbar" class="link">Source</a> <a href="#v:popStatusbar" class="selflink">#</a></p><div class="doc"><p>Pop a message from the status bar.</p></div></div><div class="top"><p class="src"><a id="v:rawPathToIter" class="def">rawPathToIter</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> TreePath -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Maybe.html#t:Maybe">Maybe</a> TreeIter) <a href="src/HSFM-GUI-Gtk-Utils.html#rawPathToIter" class="link">Source</a> <a href="#v:rawPathToIter" class="selflink">#</a></p><div class="doc"><p>Turn a path on the rawModel into a path that we can
|
|
use at the outermost model layer.</p></div></div><div class="top"><p class="src"><a id="v:rawPathToItem" class="def">rawPathToItem</a> :: <a href="HSFM-GUI-Gtk-Data.html#t:MyView">MyView</a> -> TreePath -> <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/System-IO.html#t:IO">IO</a> (<a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Maybe.html#t:Maybe">Maybe</a> <a href="HSFM-GUI-Gtk-Data.html#t:Item">Item</a>) <a href="src/HSFM-GUI-Gtk-Utils.html#rawPathToItem" class="link">Source</a> <a href="#v:rawPathToItem" class="selflink">#</a></p><div class="doc"><p>Turn a path on the rawModel into the corresponding item
|
|
that we can use at the outermost model layer.</p></div></div><div class="top"><p class="src"><a id="v:addHistory" class="def">addHistory</a> :: <a href="https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Eq.html#t:Eq">Eq</a> a => a -> [a] -> [a] <a href="src/HSFM-GUI-Gtk-Utils.html#addHistory" class="link">Source</a> <a href="#v:addHistory" class="selflink">#</a></p><div class="doc"><p>Makes sure the list is max 5. This is probably not very efficient
|
|
but we don't care, since it's a small list anyway.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html> |