Update of /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk/Mogul
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30366/mogul/Graphics/UI/Gtk/Mogul
Modified Files:
TreeList.hs
Log Message:
Made Mogul's TreePath which is [Int] the only TreePath, even in TreeModel.
Completed DrawWindow (gdk_window).
Make apiGen Makefile work with different versions.
Index: TreeList.hs
===================================================================
RCS file: /cvsroot/gtk2hs/gtk2hs/mogul/Graphics/UI/Gtk/Mogul/TreeList.hs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- TreeList.hs 8 Jan 2005 16:40:16 -0000 1.1
+++ TreeList.hs 17 Feb 2005 00:13:21 -0000 1.2
@@ -79,17 +79,12 @@
treeViewColumnNewPixbuf,
treeViewColumnNewToggle,
treeViewColumnAssociate,
- treeViewGetPathAtPos,
-- * CellRenderer
cellRendererSetAttribute,
cellRendererGetAttribute,
-- * CellRendererText
onEdited,
afterEdited,
- -- * TreeModel
- TreePath,
- treeModelGetIter,
- treeModelGetPath
) where
import Monad (liftM, mapM, mapM_, foldM)
@@ -97,21 +92,6 @@
import Graphics.UI.Gtk hiding (
-- TreeModel
treeModelGetValue,
- TreePath,
- treePathNew,
- treePathNewFromString,
- treePathToString,
- treePathNewFirst,
- treePathAppendIndex,
- treePathPrependIndex,
- treePathGetDepth,
- treePathGetIndices,
- treePathCopy,
- treePathCompare,
- treePathNext,
- treePathPrev,
- treePathUp,
- treePathDown,
treeModelGetIter,
treeModelGetPath,
-- ListStore
@@ -345,31 +325,6 @@
mapM_ (\(attr,col) ->
Gtk.treeViewColumnAddAttribute tvc ren attr col) assocs'
--- | Map a pixel to the specific cell.
---
--- * Finds the path at the 'Point' @(x, y)@. The
--- coordinates @x@ and @y@ are relative to the top left
--- corner of the 'TreeView' drawing window. As such, coordinates
--- in a mouse click event can be used directly to determine the cell
--- which the user clicked on. This is therefore a way to realize for
--- popup menus.
---
--- * The returned point is the input point relative to the cell's upper
--- left corner. The whole 'TreeView' is divided between all cells.
--- The returned point is relative to the rectangle this cell occupies
--- within the 'TreeView'.
---
-treeViewGetPathAtPos :: TreeViewClass tv => tv -> Point ->
- IO (Maybe (TreePath, TreeViewColumn, Point))
-treeViewGetPathAtPos tv pt = do
- maybePath <- Gtk.treeViewGetPathAtPos tv pt
- case maybePath of
- Nothing -> return Nothing
- Just (realPath, col, relPt) -> do
- -- convert path component to mogul's TreePath representation
- path <- Gtk.treePathGetIndices realPath
- return $ Just (path, col, relPt)
-
-- | Set an 'Attribute' globally.
--
-- * An 'Attribute' of a 'Renderer' can either be set
@@ -400,27 +355,3 @@
IO (ConnectId CellRendererText)
onEdited (Renderer ren _) = Gtk.onEdited ren
afterEdited (Renderer ren _) = Gtk.afterEdited ren
-
--- | A simple way of addressing nodes.
---
--- These integer lists are used to address nodes in a hierarchical
--- 'ListStore' structure.
---
-type TreePath = [Int]
-
--- | Turn a 'TreePath' into an abstract 'TreeIter'ator.
---
-treeModelGetIter :: TreeModelClass tm => tm -> TreePath -> IO (Maybe TreeIter)
-treeModelGetIter _ [] = throw $ AssertionFailed "Mogul.treeModelGetIter: \
- \a path must contain at least one element."
-treeModelGetIter tm tp = do
- realPath <- Gtk.treePathNew
- mapM_ (Gtk.treePathAppendIndex realPath) tp
- Gtk.treeModelGetIter tm realPath
-
--- | Turn an abstract 'TreeIter' into a 'TreePath'.
---
-treeModelGetPath :: TreeModelClass tm => tm -> TreeIter -> IO TreePath
-treeModelGetPath tm ti = do
- realPath <- Gtk.treeModelGetPath tm ti
- Gtk.treePathGetIndices realPath
|