From: Duncan C. <dun...@wo...> - 2006-01-26 22:13:28
|
Wed Jan 25 15:46:26 PST 2006 Duncan Coutts <du...@co...> * Remove the mogul package hunk ./mogul/Graphics/UI/Gtk/Mogul/GetWidget.hs.pp 1 --- -*-haskell-*- --- The Monad GUI Library (Mogul): Retrieving a widget from the global store. --- --- Author : Axel Simon --- --- Created: 4 June 2001 --- --- Version $Revision: 1.3 $ from $Date: 2005/11/17 17:31:42 $ --- --- Copyright (C) 2001 Axel Simon --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License, or (at your option) any later version. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- | --- --- Retrieve a widget by name from the global store. --- -module Graphics.UI.Gtk.Mogul.GetWidget ( - getMisc, - getLabel, - getAccelLabel, -#ifndef DISABLE_DEPRECATED - getTipsQuery, -#endif - getArrow, - getImage, - getContainer, - getBin, - getAlignment, - getFrame, - getAspectFrame, - getButton, - getToggleButton, - getCheckButton, - getRadioButton, -#ifndef DISABLE_DEPRECATED - getOptionMenu, -#endif - getItem, - getMenuItem, - getCheckMenuItem, - getRadioMenuItem, - getTearoffMenuItem, -#ifndef DISABLE_DEPRECATED - getListItem, -#endif - getWindow, - getDialog, - getColorSelectionDialog, - getFileSelection, - getFontSelectionDialog, - getInputDialog, - getMessageDialog, - --getPlug, - getEventBox, - getHandleBox, - getScrolledWindow, - getViewport, - getBox, - getButtonBox, - getHButtonBox, - getVButtonBox, - getVBox, - getColorSelection, - getFontSelection, - getHBox, -#ifndef DISABLE_DEPRECATED - getCombo, -#endif - getStatusbar, -#ifndef DISABLE_DEPRECATED - getCList, - getCTree, -#endif - getFixed, - getPaned, - getHPaned, - getVPaned, - getLayout, -#ifndef DISABLE_DEPRECATED - getList, -#endif - getMenuShell, - getMenu, - getMenuBar, - getNotebook, - --getSocket, - getTable, - getTextView, - getToolbar, - getTreeView, - getCalendar, - getDrawingArea, - getEntry, - getSpinButton, - getRuler, - getHRuler, - getVRuler, - getRange, - getScale, - getHScale, - getVScale, - getScrollbar, - getHScrollbar, - getVScrollbar, - getSeparator, - getHSeparator, - getVSeparator, - getInvisible, -#ifndef DISABLE_DEPRECATED - getPreview, -#endif - getProgressBar - ) where - -import Graphics.UI.Gtk.Mogul.WidgetTable (widgetLookup) -import Graphics.UI.Gtk.Types - --- The get<Name> functions lookup a widget by name in the global store. Only --- widgets created by new<Name> can be retrieved this way. The function throws --- an exception if the widget was not found or is the wrong type. (EXPORTED) --- - -getMisc :: String -> IO Misc -getMisc name = [_$_] - widgetLookup name "Misc" mkMisc - -getLabel :: String -> IO Label -getLabel name = [_$_] - widgetLookup name "Label" mkLabel - -getAccelLabel :: String -> IO AccelLabel -getAccelLabel name = [_$_] - widgetLookup name "AccelLabel" mkAccelLabel - -#ifndef DISABLE_DEPRECATED -getTipsQuery :: String -> IO TipsQuery -getTipsQuery name = [_$_] - widgetLookup name "TipsQuery" mkTipsQuery -#endif - -getArrow :: String -> IO Arrow -getArrow name = [_$_] - widgetLookup name "Arrow" mkArrow - -getImage :: String -> IO Image -getImage name = [_$_] - widgetLookup name "Image" mkImage - -getContainer :: String -> IO Container -getContainer name = [_$_] - widgetLookup name "Container" mkContainer - -getBin :: String -> IO Bin -getBin name = [_$_] - widgetLookup name "Bin" mkBin - -getAlignment :: String -> IO Alignment -getAlignment name = [_$_] - widgetLookup name "Alignment" mkAlignment - -getFrame :: String -> IO Frame -getFrame name = [_$_] - widgetLookup name "Frame" mkFrame - -getAspectFrame :: String -> IO AspectFrame -getAspectFrame name = [_$_] - widgetLookup name "AspectFrame" mkAspectFrame - -getButton :: String -> IO Button -getButton name = [_$_] - widgetLookup name "Button" mkButton - -getToggleButton :: String -> IO ToggleButton -getToggleButton name = [_$_] - widgetLookup name "ToggleButton" mkToggleButton - -getCheckButton :: String -> IO CheckButton -getCheckButton name = [_$_] - widgetLookup name "CheckButton" mkCheckButton - -getRadioButton :: String -> IO RadioButton -getRadioButton name = [_$_] - widgetLookup name "RadioButton" mkRadioButton - -#ifndef DISABLE_DEPRECATED -getOptionMenu :: String -> IO OptionMenu -getOptionMenu name = [_$_] - widgetLookup name "OptionMenu" mkOptionMenu -#endif - -getItem :: String -> IO Item -getItem name = [_$_] - widgetLookup name "Item" mkItem - -getMenuItem :: String -> IO MenuItem -getMenuItem name = [_$_] - widgetLookup name "MenuItem" mkMenuItem - -getCheckMenuItem :: String -> IO CheckMenuItem -getCheckMenuItem name = [_$_] - widgetLookup name "CheckMenuItem" mkCheckMenuItem - -getRadioMenuItem :: String -> IO RadioMenuItem -getRadioMenuItem name = [_$_] - widgetLookup name "RadioMenuItem" mkRadioMenuItem - -getTearoffMenuItem :: String -> IO TearoffMenuItem -getTearoffMenuItem name = [_$_] - widgetLookup name "TearoffMenuItem" mkTearoffMenuItem - -#ifndef DISABLE_DEPRECATED -getListItem :: String -> IO ListItem -getListItem name = [_$_] - widgetLookup name "ListItem" mkListItem -#endif - -getWindow :: String -> IO Window -getWindow name = [_$_] - widgetLookup name "Window" mkWindow - -getDialog :: String -> IO Dialog -getDialog name = [_$_] - widgetLookup name "Dialog" mkDialog - -getColorSelectionDialog :: String -> IO ColorSelectionDialog -getColorSelectionDialog name = [_$_] - widgetLookup name "ColorSelectionDialog" mkColorSelectionDialog - -getFileSelection :: String -> IO FileSelection -getFileSelection name = [_$_] - widgetLookup name "FileSelection" mkFileSelection - -getFontSelectionDialog :: String -> IO FontSelectionDialog -getFontSelectionDialog name = [_$_] - widgetLookup name "FontSelectionDialog" mkFontSelectionDialog - -getInputDialog :: String -> IO InputDialog -getInputDialog name = [_$_] - widgetLookup name "InputDialog" mkInputDialog - -getMessageDialog :: String -> IO MessageDialog -getMessageDialog name = [_$_] - widgetLookup name "MessageDialog" mkMessageDialog - ---getPlug :: String -> IO Plug ---getPlug name = [_$_] --- widgetLookup name "Plug" mkPlug - -getEventBox :: String -> IO EventBox -getEventBox name = [_$_] - widgetLookup name "EventBox" mkEventBox - -getHandleBox :: String -> IO HandleBox -getHandleBox name = [_$_] - widgetLookup name "HandleBox" mkHandleBox - -getScrolledWindow :: String -> IO ScrolledWindow -getScrolledWindow name = [_$_] - widgetLookup name "ScrolledWindow" mkScrolledWindow - -getViewport :: String -> IO Viewport -getViewport name = [_$_] - widgetLookup name "Viewport" mkViewport - -getBox :: String -> IO Box -getBox name = [_$_] - widgetLookup name "Box" mkBox - -getButtonBox :: String -> IO ButtonBox -getButtonBox name = [_$_] - widgetLookup name "ButtonBox" mkButtonBox - -getHButtonBox :: String -> IO HButtonBox -getHButtonBox name = [_$_] - widgetLookup name "HButtonBox" mkHButtonBox - -getVButtonBox :: String -> IO VButtonBox -getVButtonBox name = [_$_] - widgetLookup name "VButtonBox" mkVButtonBox - -getVBox :: String -> IO VBox -getVBox name = [_$_] - widgetLookup name "VBox" mkVBox - -getColorSelection :: String -> IO ColorSelection -getColorSelection name = [_$_] - widgetLookup name "ColorSelection" mkColorSelection - -getFontSelection :: String -> IO FontSelection -getFontSelection name = [_$_] - widgetLookup name "FontSelection" mkFontSelection - -getHBox :: String -> IO HBox -getHBox name = [_$_] - widgetLookup name "HBox" mkHBox - -#ifndef DISABLE_DEPRECATED -getCombo :: String -> IO Combo -getCombo name = [_$_] - widgetLookup name "Combo" mkCombo -#endif - -getStatusbar :: String -> IO Statusbar -getStatusbar name = [_$_] - widgetLookup name "Statusbar" mkStatusbar - -#ifndef DISABLE_DEPRECATED -getCList :: String -> IO CList -getCList name = [_$_] - widgetLookup name "CList" mkCList - -getCTree :: String -> IO CTree -getCTree name = [_$_] - widgetLookup name "CTree" mkCTree -#endif - -getFixed :: String -> IO Fixed -getFixed name = [_$_] - widgetLookup name "Fixed" mkFixed - -getPaned :: String -> IO Paned -getPaned name = [_$_] - widgetLookup name "Paned" mkPaned - -getHPaned :: String -> IO HPaned -getHPaned name = [_$_] - widgetLookup name "HPaned" mkHPaned - -getVPaned :: String -> IO VPaned -getVPaned name = [_$_] - widgetLookup name "VPaned" mkVPaned - -getLayout :: String -> IO Layout -getLayout name = [_$_] - widgetLookup name "Layout" mkLayout - -#ifndef DISABLE_DEPRECATED -getList :: String -> IO List -getList name = [_$_] - widgetLookup name "List" mkList -#endif - -getMenuShell :: String -> IO MenuShell -getMenuShell name = [_$_] - widgetLookup name "MenuShell" mkMenuShell - -getMenu :: String -> IO Menu -getMenu name = [_$_] - widgetLookup name "Menu" mkMenu - -getMenuBar :: String -> IO MenuBar -getMenuBar name = [_$_] - widgetLookup name "MenuBar" mkMenuBar - -getNotebook :: String -> IO Notebook -getNotebook name = [_$_] - widgetLookup name "Notebook" mkNotebook - ---getSocket :: String -> IO Socket ---getSocket name = [_$_] --- widgetLookup name "Socket" mkSocket - -getTable :: String -> IO Table -getTable name = [_$_] - widgetLookup name "Table" mkTable - -getTextView :: String -> IO TextView -getTextView name = [_$_] - widgetLookup name "TextView" mkTextView - -getToolbar :: String -> IO Toolbar -getToolbar name = [_$_] - widgetLookup name "Toolbar" mkToolbar - -getTreeView :: String -> IO TreeView -getTreeView name = [_$_] - widgetLookup name "TreeView" mkTreeView - -getCalendar :: String -> IO Calendar -getCalendar name = [_$_] - widgetLookup name "Calendar" mkCalendar - -getDrawingArea :: String -> IO DrawingArea -getDrawingArea name = [_$_] - widgetLookup name "DrawingArea" mkDrawingArea - -getEntry :: String -> IO Entry -getEntry name = [_$_] - widgetLookup name "Entry" mkEntry - -getSpinButton :: String -> IO SpinButton -getSpinButton name = [_$_] - widgetLookup name "SpinButton" mkSpinButton - -getRuler :: String -> IO Ruler -getRuler name = [_$_] - widgetLookup name "Ruler" mkRuler - -getHRuler :: String -> IO HRuler -getHRuler name = [_$_] - widgetLookup name "HRuler" mkHRuler - -getVRuler :: String -> IO VRuler -getVRuler name = [_$_] - widgetLookup name "VRuler" mkVRuler - -getRange :: String -> IO Range -getRange name = [_$_] - widgetLookup name "Range" mkRange - -getScale :: String -> IO Scale -getScale name = [_$_] - widgetLookup name "Scale" mkScale - -getHScale :: String -> IO HScale -getHScale name = [_$_] - widgetLookup name "HScale" mkHScale - -getVScale :: String -> IO VScale -getVScale name = [_$_] - widgetLookup name "VScale" mkVScale - -getScrollbar :: String -> IO Scrollbar -getScrollbar name = [_$_] - widgetLookup name "Scrollbar" mkScrollbar - -getHScrollbar :: String -> IO HScrollbar -getHScrollbar name = [_$_] - widgetLookup name "HScrollbar" mkHScrollbar - -getVScrollbar :: String -> IO VScrollbar -getVScrollbar name = [_$_] - widgetLookup name "VScrollbar" mkVScrollbar - -getSeparator :: String -> IO Separator -getSeparator name = [_$_] - widgetLookup name "Separator" mkSeparator - -getHSeparator :: String -> IO HSeparator -getHSeparator name = [_$_] - widgetLookup name "HSeparator" mkHSeparator - -getVSeparator :: String -> IO VSeparator -getVSeparator name = [_$_] - widgetLookup name "VSeparator" mkVSeparator - -getInvisible :: String -> IO Invisible -getInvisible name = [_$_] - widgetLookup name "Invisible" mkInvisible - -#ifndef DISABLE_DEPRECATED -getPreview :: String -> IO Preview -getPreview name = [_$_] - widgetLookup name "Preview" mkPreview -#endif - -getProgressBar :: String -> IO ProgressBar -getProgressBar name = [_$_] - widgetLookup name "ProgressBar" mkProgressBar rmfile ./mogul/Graphics/UI/Gtk/Mogul/GetWidget.hs.pp hunk ./mogul/Graphics/UI/Gtk/Mogul/MDialog.hs 1 --- -*-haskell-*- --- The Monad GUI Library (Mogul): Dialog helper functions. --- --- Author : Axel Simon --- --- Created: 2 June 2001 --- --- Version $Revision: 1.2 $ from $Date: 2005/05/20 23:54:00 $ --- --- Copyright (C) 2001 Axel Simon --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License, or (at your option) any later version. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- | --- --- Simplify the construction of a non-modal dialog. --- - -module Graphics.UI.Gtk.Mogul.MDialog( - assureDialog - ) where - -import Graphics.UI.Gtk.Mogul.GetWidget (getDialog) -import Graphics.UI.Gtk.Mogul.NewWidget (newNamedDialog) -import Graphics.UI.Gtk.Mogul.WidgetTable (isValidName) -import Graphics.UI.Gtk (widgetShowAll, widgetGrabFocus) -import Graphics.UI.Gtk.Types - --- Move a dialog to the toplevel if it is already onscreen. Otherwise construct --- a new dialog with the given construction function. (EXPORTED) --- -assureDialog :: String -> (Dialog -> IO ()) -> (Dialog -> IO ()) -> IO () -assureDialog name construct fill = do - vn <- isValidName name - if vn then do - dia <- getDialog name - fill dia - -- FIXME: focus the window - return () - else do - dia <- newNamedDialog name - construct dia - fill dia - widgetShowAll dia - rmfile ./mogul/Graphics/UI/Gtk/Mogul/MDialog.hs hunk ./mogul/Graphics/UI/Gtk/Mogul/NewWidget.hs.pp 1 --- The Monad GUI Library (Mogul): Creation of new widgets. --- --- Author : Axel Simon --- --- Created: 2 June 2001 --- --- Version $Revision: 1.1 $ from $Date: 2005/11/11 23:01:08 $ --- --- Copyright (C) 2001 Axel Simon --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License, or (at your option) any later version. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- | --- --- These functions generate a new widget with a name. --- --- * The widget can later be lookup up by its name from the global store. As --- soon as the widget is destroyed it is deleted from the store. If a given --- name is still available can be tested by the 'isValidName' function. --- -module Graphics.UI.Gtk.Mogul.NewWidget ( - newTextBuffer, --- newTextTag, --- newTextTagTable, - newLabel, - newNamedLabel, - newAccelLabel, - newNamedAccelLabel, - newArrow, - newNamedArrow, - newImageFromFile, - newNamedImageFromFile, - newAlignment, - newNamedAlignment, - newFrame, - newNamedFrame, - newAspectFrame, - newNamedAspectFrame, - newButton, - newNamedButton, - newButtonWithLabel, - newNamedButtonWithLabel, - newButtonWithMnemonic, - newNamedButtonWithMnemonic, - newButtonFromStock, - newNamedButtonFromStock, - newToggleButton, - newNamedToggleButton, - newToggleButtonWithLabel, - newNamedToggleButtonWithLabel, - newCheckButton, - newNamedCheckButton, - newCheckButtonWithLabel, - newNamedCheckButtonWithLabel, - newCheckButtonWithMnemonic, - newNamedCheckButtonWithMnemonic, - newRadioButton, - newNamedRadioButton, - newRadioButtonWithLabel, - newNamedRadioButtonWithLabel, - newRadioButtonJoinGroup, - newNamedRadioButtonJoinGroup, - newRadioButtonJoinGroupWithLabel, - newNamedRadioButtonJoinGroupWithLabel, -#ifndef DISABLE_DEPRECATED - newOptionMenu, - newNamedOptionMenu, -#endif - newMenuItem, - newNamedMenuItem, - newMenuItemWithLabel, - newNamedMenuItemWithLabel, - newCheckMenuItem, - newNamedCheckMenuItem, - newCheckMenuItemWithLabel, - newNamedCheckMenuItemWithLabel, - newRadioMenuItem, - newNamedRadioMenuItem, - newRadioMenuItemWithLabel, - newNamedRadioMenuItemWithLabel, - newRadioMenuItemJoinGroup, - newNamedRadioMenuItemJoinGroup, - newRadioMenuItemJoinGroupWithLabel, - newNamedRadioMenuItemJoinGroupWithLabel, - newTearoffMenuItem, - newNamedTearoffMenuItem, - newWindow, - newNamedWindow, - newDialog, - newNamedDialog, - --newColorSelectionDialog, - --newFileSelection, - --newFontSelectionDialog, - --newPlug, - --newNamedPlug, - newEventBox, - newNamedEventBox, - newHandleBox, - newNamedHandleBox, - newScrolledWindow, - newNamedScrolledWindow, - newViewport, - newNamedViewport, - newVBox, - newNamedVBox, - --newColorSelection, - --newFontSelection, - newHBox, - newNamedHBox, -#ifndef DISABLE_DEPRECATED - newCombo, - newNamedCombo, -#endif - newStatusbar, - newNamedStatusbar, - newHPaned, - newNamedHPaned, - newVPaned, - newNamedVPaned, - newLayout, - newNamedLayout, - newMenu, - newNamedMenu, - newMenuBar, - newNamedMenuBar, - newNotebook, - newNamedNotebook, - --newSocket, - --newNamedSocket, - newTable, - newNamedTable, - newTextView, - newNamedTextView, - newToolbar, - newNamedToolbar, - newCalendar, - newNamedCalendar, - --newDrawingArea, - newEntry, - newNamedEntry, - newSpinButton, - newNamedSpinButton, - newSpinButtonWithRange, - newNamedSpinButtonWithRange, - newHScale, - newNamedHScale, - newVScale, - newNamedVScale, - newHScrollbar, - newNamedHScrollbar, - newVScrollbar, - newNamedVScrollbar, - newHSeparator, - newNamedHSeparator, - newVSeparator, - newNamedVSeparator, - newProgressBar, - newNamedProgressBar, - newAdjustment, - --newIMContext, - --newIMMulticontext, - --newItemFactory, - newTooltips, - newTreeView, - newNamedTreeView, - newTreeViewWithModel, - newNamedTreeViewWithModel, - newTreeViewColumn, - newIconFactory, - ) where - -import Graphics.UI.Gtk -import Graphics.UI.Gtk.Mogul.WidgetTable (WidgetName, newNamedWidget) - --- | see 'textBufferNew' --- -newTextBuffer :: Maybe TextTagTable -> IO TextBuffer -newTextBuffer = textBufferNew - --- | see 'textTagNew' --- ---newTextTag :: IO TextTag ---newTextTag = textTagNew - --- | see 'textTagTableNew' --- ---newTextTagTable :: IO TextTagTable ---newTextTagTable = textTagTableNew - --- | see 'labelNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedLabel :: WidgetName -> Maybe String -> IO Label -newNamedLabel name str = newNamedWidget name $ labelNew str - --- | see 'labelNew' --- -newLabel :: Maybe String -> IO Label -newLabel = labelNew - --- | see 'accelLabelNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedAccelLabel :: WidgetName -> String -> IO AccelLabel -newNamedAccelLabel name str = newNamedWidget name $ accelLabelNew str - --- | see 'accelLabelNew' --- -newAccelLabel :: String -> IO AccelLabel -newAccelLabel = accelLabelNew - --- | see 'arrowNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedArrow :: WidgetName -> ArrowType -> ShadowType -> IO Arrow -newNamedArrow name at st = newNamedWidget name $ arrowNew at st [_$_] - --- | see 'arrowNew' --- -newArrow :: ArrowType -> ShadowType -> IO Arrow -newArrow = arrowNew - --- | see 'imageNewFromFile' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedImageFromFile :: WidgetName -> FilePath -> IO Image -newNamedImageFromFile name fname = newNamedWidget name $ imageNewFromFile fname - --- | see 'imageNewFromFile' --- -newImageFromFile :: FilePath -> IO Image -newImageFromFile fname = imageNewFromFile fname - --- | see 'alignmentNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedAlignment :: [_$_] - WidgetName -> Float -> Float -> Float -> Float -> IO Alignment -newNamedAlignment name xalign yalign xscale yscale = [_$_] - newNamedWidget name $ alignmentNew xalign yalign xscale yscale [_$_] - --- | see 'alignmentNew' --- -newAlignment :: Float -> Float -> Float -> Float -> IO Alignment -newAlignment = alignmentNew - --- | see 'frameNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedFrame :: WidgetName -> IO Frame -newNamedFrame name = newNamedWidget name $ frameNew - --- | see 'frameNew' --- -newFrame :: IO Frame -newFrame = frameNew - --- | see 'aspectFrameNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedAspectFrame :: [_$_] - WidgetName -> Float -> Float -> Maybe Float -> IO AspectFrame -newNamedAspectFrame name xalign yalign ratio = newNamedWidget name $ - aspectFrameNew xalign yalign ratio - --- | see 'aspectFrameNew' --- -newAspectFrame :: Float -> Float -> Maybe Float -> IO AspectFrame -newAspectFrame = aspectFrameNew - [_$_] --- | see 'buttonNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedButton :: WidgetName -> IO Button -newNamedButton name = newNamedWidget name $ buttonNew - --- | see 'buttonNew' --- -newButton :: IO Button -newButton = buttonNew - --- | see 'buttonNewWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedButtonWithLabel :: WidgetName -> String -> IO Button -newNamedButtonWithLabel name lbl = newNamedWidget name $ buttonNewWithLabel lbl - --- | see 'buttonNewWithLabel' --- -newButtonWithLabel :: String -> IO Button -newButtonWithLabel lbl = buttonNewWithLabel lbl - --- | see 'buttonNewWithMnemonic' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedButtonWithMnemonic :: WidgetName -> String -> IO Button -newNamedButtonWithMnemonic name mn = newNamedWidget name $ buttonNewWithMnemonic mn - --- | see 'buttonNewWithMnemonic' --- -newButtonWithMnemonic :: String -> IO Button -newButtonWithMnemonic mn = buttonNewWithMnemonic mn - --- | see 'buttonNewFromStock' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedButtonFromStock :: WidgetName -> String -> IO Button -newNamedButtonFromStock name stock = newNamedWidget name $ buttonNewFromStock stock - --- | see 'buttonNewFromStock' --- -newButtonFromStock :: String -> IO Button -newButtonFromStock stock = buttonNewFromStock stock - --- | see 'toggleButtonNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedToggleButton :: WidgetName -> IO ToggleButton -newNamedToggleButton name = newNamedWidget name $ toggleButtonNew - --- | see 'toggleButtonNew' --- -newToggleButton :: IO ToggleButton -newToggleButton = toggleButtonNew - --- | see 'toggleButtonNewWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedToggleButtonWithLabel :: WidgetName -> String -> IO ToggleButton -newNamedToggleButtonWithLabel name lbl = newNamedWidget name $ [_$_] - toggleButtonNewWithLabel lbl - --- | see 'toggleButtonNewWithLabel' --- -newToggleButtonWithLabel :: String -> IO ToggleButton -newToggleButtonWithLabel lbl = [_$_] - toggleButtonNewWithLabel lbl - --- | see 'checkButtonNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedCheckButton :: WidgetName -> IO CheckButton -newNamedCheckButton name = newNamedWidget name $ checkButtonNew - --- | see 'checkButtonNew' --- -newCheckButton :: IO CheckButton -newCheckButton = checkButtonNew - --- | see 'checkButtonNewWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedCheckButtonWithLabel :: WidgetName -> String -> IO CheckButton -newNamedCheckButtonWithLabel name lbl = newNamedWidget name $ [_$_] - checkButtonNewWithLabel lbl - --- | see 'checkButtonNewWithLabel' --- -newCheckButtonWithLabel :: String -> IO CheckButton -newCheckButtonWithLabel lbl = checkButtonNewWithLabel lbl - --- | see 'checkButtonNewWithMnemonic' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedCheckButtonWithMnemonic :: WidgetName -> String -> IO CheckButton -newNamedCheckButtonWithMnemonic name mn = newNamedWidget name $ [_$_] - checkButtonNewWithMnemonic mn - --- | see 'checkButtonNewWithMnemonic' --- -newCheckButtonWithMnemonic :: String -> IO CheckButton -newCheckButtonWithMnemonic mn = checkButtonNewWithMnemonic mn - --- | see 'radioButtonNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedRadioButton :: WidgetName -> IO RadioButton -newNamedRadioButton name = newNamedWidget name $ radioButtonNew - --- | see 'radioButtonNew' --- -newRadioButton :: IO RadioButton -newRadioButton = radioButtonNew - --- | see 'radioButtonNewWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedRadioButtonWithLabel :: WidgetName -> String -> IO RadioButton -newNamedRadioButtonWithLabel name lbl = newNamedWidget name $ [_$_] - radioButtonNewWithLabel lbl - --- | see 'radioButtonNewWithLabel' --- -newRadioButtonWithLabel :: String -> IO RadioButton -newRadioButtonWithLabel lbl = radioButtonNewWithLabel lbl - --- | see 'radioButtonNewJoinGroup' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedRadioButtonJoinGroup :: WidgetName -> RadioButton -> IO RadioButton -newNamedRadioButtonJoinGroup name grp = newNamedWidget name $ [_$_] - radioButtonNewJoinGroup grp - --- | see 'radioButtonNewJoinGroup' --- -newRadioButtonJoinGroup :: RadioButton -> IO RadioButton -newRadioButtonJoinGroup grp = [_$_] - radioButtonNewJoinGroup grp - --- | see 'radioButtonNewJoinGroupWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedRadioButtonJoinGroupWithLabel :: [_$_] - WidgetName -> RadioButton -> String -> IO RadioButton -newNamedRadioButtonJoinGroupWithLabel name grp lbl = newNamedWidget name $ [_$_] - radioButtonNewJoinGroupWithLabel grp lbl - --- | see 'radioButtonNewJoinGroupWithLabel' --- -newRadioButtonJoinGroupWithLabel :: [_$_] - RadioButton -> String -> IO RadioButton -newRadioButtonJoinGroupWithLabel grp lbl = [_$_] - radioButtonNewJoinGroupWithLabel grp lbl - -#ifndef DISABLE_DEPRECATED --- | see 'optionMenuNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedOptionMenu :: WidgetName -> IO OptionMenu -newNamedOptionMenu name = newNamedWidget name $ optionMenuNew - --- | see 'optionMenuNew' --- -newOptionMenu :: IO OptionMenu -newOptionMenu = optionMenuNew -#endif - --- | see 'menuItemNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedMenuItem :: WidgetName -> IO MenuItem -newNamedMenuItem name = newNamedWidget name $ menuItemNew - --- | see 'menuItemNew' --- -newMenuItem :: IO MenuItem -newMenuItem = menuItemNew - --- | see 'menuItemNewWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedMenuItemWithLabel :: WidgetName -> String -> IO MenuItem -newNamedMenuItemWithLabel name lbl = newNamedWidget name $ menuItemNewWithLabel lbl - --- | see 'menuItemNewWithLabel' --- -newMenuItemWithLabel :: String -> IO MenuItem -newMenuItemWithLabel lbl = menuItemNewWithLabel lbl - --- | see 'checkMenuItemNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedCheckMenuItem :: WidgetName -> IO CheckMenuItem -newNamedCheckMenuItem name = newNamedWidget name $ checkMenuItemNew - --- | see 'checkMenuItemNew' --- -newCheckMenuItem :: IO CheckMenuItem -newCheckMenuItem = checkMenuItemNew - --- | see 'checkMenuItemNewWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedCheckMenuItemWithLabel :: WidgetName -> String -> IO CheckMenuItem -newNamedCheckMenuItemWithLabel name lbl = newNamedWidget name $ [_$_] - checkMenuItemNewWithLabel lbl - --- | see 'checkMenuItemNewWithLabel' --- -newCheckMenuItemWithLabel :: String -> IO CheckMenuItem -newCheckMenuItemWithLabel lbl = [_$_] - checkMenuItemNewWithLabel lbl - --- | see 'radioMenuItemNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedRadioMenuItem :: WidgetName -> IO RadioMenuItem -newNamedRadioMenuItem name = newNamedWidget name $ radioMenuItemNew - --- | see 'radioMenuItemNew' --- -newRadioMenuItem :: IO RadioMenuItem -newRadioMenuItem = radioMenuItemNew - --- | see 'radioMenuItemNewWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedRadioMenuItemWithLabel :: WidgetName -> String -> IO RadioMenuItem -newNamedRadioMenuItemWithLabel name lbl = newNamedWidget name $ [_$_] - radioMenuItemNewWithLabel lbl - --- | see 'radioMenuItemNewWithLabel' --- -newRadioMenuItemWithLabel :: String -> IO RadioMenuItem -newRadioMenuItemWithLabel lbl = radioMenuItemNewWithLabel lbl - --- | see 'radioMenuNewItemJoinGroup' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedRadioMenuItemJoinGroup :: WidgetName -> RadioMenuItem -> IO RadioMenuItem -newNamedRadioMenuItemJoinGroup name grp = newNamedWidget name $ [_$_] - radioMenuItemNewJoinGroup grp - --- | see 'radioMenuNewItemJoinGroup' --- -newRadioMenuItemJoinGroup :: RadioMenuItem -> IO RadioMenuItem -newRadioMenuItemJoinGroup grp = radioMenuItemNewJoinGroup grp - --- | see 'radioMenuItemNewJoinGroupWithLabel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedRadioMenuItemJoinGroupWithLabel :: [_$_] - WidgetName -> RadioMenuItem -> String -> IO RadioMenuItem -newNamedRadioMenuItemJoinGroupWithLabel name lbl grp = newNamedWidget name $ [_$_] - radioMenuItemNewJoinGroupWithLabel lbl grp - --- | see 'radioMenuItemNewJoinGroupWithLabel' --- -newRadioMenuItemJoinGroupWithLabel :: [_$_] - RadioMenuItem -> String -> IO RadioMenuItem -newRadioMenuItemJoinGroupWithLabel lbl grp = [_$_] - radioMenuItemNewJoinGroupWithLabel lbl grp - --- | see 'tearoffMenuItemNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedTearoffMenuItem :: WidgetName -> IO TearoffMenuItem -newNamedTearoffMenuItem name = newNamedWidget name $ tearoffMenuItemNew - --- | see 'tearoffMenuItemNew' --- -newTearoffMenuItem :: IO TearoffMenuItem -newTearoffMenuItem = tearoffMenuItemNew - --- | see 'windowNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedWindow :: WidgetName -> IO Window -newNamedWindow name = newNamedWidget name $ windowNew - --- | see 'windowNew' --- -newWindow :: IO Window -newWindow = windowNew - --- | see 'dialogNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedDialog :: WidgetName -> IO Dialog -newNamedDialog name = newNamedWidget name $ dialogNew - --- | see 'dialogNew' --- -newDialog :: IO Dialog -newDialog = dialogNew - --- | see 'colorSelectionDialogNew' --- ---newColorSelectionDialog :: WidgetName -> IO ColorSelectionDialog ---newColorSelectionDialog name = newNamedWidget name $ colorSelectionDialogNew - --- | see 'fileSelectionNew' --- ---newFileSelection :: WidgetName -> IO FileSelection ---newFileSelection name = newNamedWidget name $ fileSelectionNew - --- | see 'fontSelectionDialogNew' --- ---newFontSelectionDialog :: WidgetName -> IO FontSelectionDialog ---newFontSelectionDialog name = newNamedWidget name $ fontSelectionDialogNew - --- | see 'plugNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- ---newNamedPlug :: WidgetName -> XID -> IO Plug ---newNamedPlug name wn = newNamedWidget name $ plugNew wn - --- | see 'plugNew' --- ---newPlug :: XID -> IO Plug ---newPlug = plugNew [_$_] - --- | see 'eventBoxNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedEventBox :: WidgetName -> IO EventBox -newNamedEventBox name = newNamedWidget name $ eventBoxNew - --- | see 'eventBoxNew' --- -newEventBox :: IO EventBox -newEventBox = eventBoxNew - --- | see 'handleBoxNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedHandleBox :: WidgetName -> IO HandleBox -newNamedHandleBox name = newNamedWidget name $ handleBoxNew - --- | see 'handleBoxNew' --- -newHandleBox :: IO HandleBox -newHandleBox = handleBoxNew - --- | see 'scrolledWindowNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedScrolledWindow :: [_$_] - WidgetName -> Maybe Adjustment -> Maybe Adjustment -> IO ScrolledWindow -newNamedScrolledWindow name hAdj vAdj = newNamedWidget name $ [_$_] - scrolledWindowNew hAdj vAdj [_$_] - --- | see 'scrolledWindowNew' --- -newScrolledWindow :: Maybe Adjustment -> Maybe Adjustment -> IO ScrolledWindow -newScrolledWindow hAdj vAdj = scrolledWindowNew hAdj vAdj [_$_] - --- | see 'viewportNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedViewport :: WidgetName -> Adjustment -> Adjustment -> IO Viewport -newNamedViewport name hAdj vAdj = newNamedWidget name $ viewportNew hAdj vAdj [_$_] - --- | see 'viewportNew' --- -newViewport :: Adjustment -> Adjustment -> IO Viewport -newViewport hAdj vAdj = viewportNew hAdj vAdj [_$_] - --- | see 'vBoxNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedVBox :: WidgetName -> Bool -> Int -> IO VBox -newNamedVBox name homogeneous spacing = newNamedWidget name $ [_$_] - vBoxNew homogeneous spacing - --- | see 'vBoxNew' --- -newVBox :: Bool -> Int -> IO VBox -newVBox homogeneous spacing = vBoxNew homogeneous spacing - --- | see 'colorSelectionNew' --- ---newColorSelection :: WidgetName -> IO colorSelection ---newColorSelection name = newNamedWidget name $ colorSelectionNew - --- | see 'fontSelectionNew' --- ---newFontSelection :: WidgetName -> IO FontSelection ---newFontSelection name = newNamedWidget name $ fontSelectionNew - --- | see 'hBoxNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedHBox :: WidgetName -> Bool -> Int -> IO HBox -newNamedHBox name homogeneous spacing = newNamedWidget name $ [_$_] - hBoxNew homogeneous spacing - --- | see 'hBoxNew' --- -newHBox :: Bool -> Int -> IO HBox -newHBox homogeneous spacing = hBoxNew homogeneous spacing - -#ifndef DISABLE_DEPRECATED --- | see 'comboNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedCombo :: WidgetName -> IO Combo -newNamedCombo name = newNamedWidget name $ comboNew - --- | see 'comboNew' --- -newCombo :: IO Combo -newCombo = comboNew -#endif - --- | see 'statusbarNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedStatusbar :: WidgetName -> IO Statusbar -newNamedStatusbar name = newNamedWidget name $ statusbarNew - --- | see 'statusbarNew' --- -newStatusbar :: IO Statusbar -newStatusbar = statusbarNew - --- | see 'hPanedNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedHPaned :: WidgetName -> IO HPaned -newNamedHPaned name = newNamedWidget name $ hPanedNew - --- | see 'hPanedNew' --- -newHPaned :: IO HPaned -newHPaned = hPanedNew - --- | see 'vPanedNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedVPaned :: WidgetName -> IO VPaned -newNamedVPaned name = newNamedWidget name $ vPanedNew - --- | see 'vPanedNew' --- -newVPaned :: IO VPaned -newVPaned = vPanedNew - --- | see 'layoutNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedLayout :: WidgetName -> Maybe Adjustment -> Maybe Adjustment -> IO Layout -newNamedLayout name hadjustment vadjustment = newNamedWidget name $ [_$_] - layoutNew hadjustment vadjustment - --- | see 'layoutNew' --- -newLayout :: Maybe Adjustment -> Maybe Adjustment -> IO Layout -newLayout hadjustment vadjustment = layoutNew hadjustment vadjustment - --- | see 'menuNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedMenu :: WidgetName -> IO Menu -newNamedMenu name = newNamedWidget name $ menuNew - --- | see 'menuNew' --- -newMenu :: IO Menu -newMenu = menuNew - --- | see 'menuBarNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedMenuBar :: WidgetName -> IO MenuBar -newNamedMenuBar name = newNamedWidget name $ menuBarNew - --- | see 'menuBarNew' --- -newMenuBar :: IO MenuBar -newMenuBar = menuBarNew - --- | see 'notebookNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedNotebook :: WidgetName -> IO Notebook -newNamedNotebook name = newNamedWidget name $ notebookNew - --- | see 'notebookNew' --- -newNotebook :: IO Notebook -newNotebook = notebookNew - --- | see 'socketNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- ---newNamedSocket :: WidgetName -> IO Socket ---newNamedSocket name = newNamedWidget name $ socketNew - --- | see 'socketNew' --- ---newSocket :: IO Socket ---newSocket = socketNew - --- | see 'tableNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedTable :: WidgetName -> Int -> Int -> Bool -> IO Table -newNamedTable name rows columns homogeneous = newNamedWidget name $ [_$_] - tableNew rows columns homogeneous - --- | see 'tableNew' --- -newTable :: Int -> Int -> Bool -> IO Table -newTable rows columns homogeneous = [_$_] - tableNew rows columns homogeneous - --- | see 'textViewNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedTextView :: WidgetName -> IO TextView -newNamedTextView name = newNamedWidget name $ textViewNew - --- | see 'textViewNew' --- -newTextView :: IO TextView -newTextView = textViewNew - --- | see 'toolbarNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedToolbar :: WidgetName -> IO Toolbar -newNamedToolbar name = newNamedWidget name toolbarNew [_$_] - --- | see 'toolbarNew' --- -newToolbar :: IO Toolbar -newToolbar = toolbarNew - --- Create a new 'TreeView' that displays that data of a 'TreeModel' (which --- may either be a 'TreeStore' or a 'ListStore'. --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedTreeView :: TreeModelClass tm => WidgetName -> tm -> IO TreeView -newNamedTreeView name tm = newNamedWidget name $ treeViewNewWithModel tm - --- Create a new 'TreeView' that displays that data of a 'TreeModel' (which --- may either be a 'TreeStore' or a 'ListStore'. --- -newTreeView :: TreeModelClass tm => tm -> IO TreeView -newTreeView tm = treeViewNewWithModel tm - --- | see 'textViewNewWithModel' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedTreeViewWithModel :: TreeModelClass tm => WidgetName -> tm -> [_$_] - IO TreeView -newNamedTreeViewWithModel name tm = [_$_] - newNamedWidget name $ treeViewNewWithModel tm - --- | see 'textViewNewWithModel' --- -newTreeViewWithModel :: TreeModelClass tm => tm -> IO TreeView -newTreeViewWithModel = treeViewNewWithModel - --- | see 'treeViewColumnNew' --- -newTreeViewColumn :: IO TreeViewColumn -newTreeViewColumn = treeViewColumnNew - --- | see 'calendarNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedCalendar :: WidgetName -> IO Calendar -newNamedCalendar name = newNamedWidget name $ calendarNew - --- | see 'calendarNew' --- -newCalendar :: IO Calendar -newCalendar = calendarNew - --- | see 'drawingAreaNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- ---newNamedDrawingArea :: WidgetName -> IO DrawingArea ---newNamedDrawingArea name = newNamedWidget name $ drawingAreaNew - --- | see 'drawingAreaNew' --- ---newDrawingArea :: IO DrawingArea ---newDrawingArea = drawingAreaNew - --- | see 'entryNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedEntry :: WidgetName -> IO Entry -newNamedEntry name = newNamedWidget name $ entryNew - --- | see 'entryNew' --- -newEntry :: IO Entry -newEntry = entryNew - --- | see 'spinButtonNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedSpinButton :: String -> Adjustment -> Double -> Int -> IO SpinButton -newNamedSpinButton name adj climbRate digits = newNamedWidget name $ [_$_] - spinButtonNew adj climbRate digits - --- | see 'spinButtonNew' --- -newSpinButton :: Adjustment -> Double -> Int -> IO SpinButton -newSpinButton adj climbRate digits = spinButtonNew adj climbRate digits - --- | see 'spinButtonNewWithRange' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedSpinButtonWithRange :: [_$_] - WidgetName -> Double -> Double -> Double -> IO SpinButton -newNamedSpinButtonWithRange name min max step = newNamedWidget name $ - spinButtonNewWithRange min max step - --- | see 'spinButtonNewWithRange' --- -newSpinButtonWithRange :: Double -> Double -> Double -> IO SpinButton -newSpinButtonWithRange min max step = spinButtonNewWithRange min max step - --- | see 'hScaleNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedHScale :: WidgetName -> Adjustment -> IO HScale -newNamedHScale name adj = newNamedWidget name $ hScaleNew adj - --- | see 'hScaleNew' --- -newHScale :: Adjustment -> IO HScale -newHScale adj = hScaleNew adj - --- | see 'vScaleNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedVScale :: WidgetName -> Adjustment -> IO VScale -newNamedVScale name adj = newNamedWidget name $ vScaleNew adj - --- | see 'vScaleNew' --- -newVScale :: Adjustment -> IO VScale -newVScale adj = vScaleNew adj - --- | see 'hScrollbarNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedHScrollbar :: WidgetName -> Adjustment -> IO HScrollbar -newNamedHScrollbar name adj = newNamedWidget name $ hScrollbarNew adj - --- | see 'hScrollbarNew' --- -newHScrollbar :: Adjustment -> IO HScrollbar -newHScrollbar adj = hScrollbarNew adj - --- | see 'vScrollbarNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedVScrollbar :: WidgetName -> Adjustment -> IO VScrollbar -newNamedVScrollbar name adj = newNamedWidget name $ vScrollbarNew adj - --- | see 'vScrollbarNew' --- -newVScrollbar :: Adjustment -> IO VScrollbar -newVScrollbar adj = vScrollbarNew adj - --- | see 'hSeparatorNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedHSeparator :: WidgetName -> IO HSeparator -newNamedHSeparator name = newNamedWidget name $ hSeparatorNew - --- | see 'hSeparatorNew' --- -newHSeparator :: IO HSeparator -newHSeparator = hSeparatorNew - --- | see 'vSeparatorNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedVSeparator :: WidgetName -> IO VSeparator -newNamedVSeparator name = newNamedWidget name $ vSeparatorNew - --- | see 'vSeparatorNew' --- -newVSeparator :: IO VSeparator -newVSeparator = vSeparatorNew - --- | see 'progressBarNew' --- --- * The supplied name can later be used to lookup the widget in the global --- store. --- -newNamedProgressBar :: WidgetName -> IO ProgressBar -newNamedProgressBar name = newNamedWidget name $ progressBarNew - --- | see 'progressBarNew' --- -newProgressBar :: IO ProgressBar -newProgressBar = progressBarNew - --- | see 'adjustmentNew' --- -newAdjustment :: Double -> Double -> Double -> Double -> Double -> Double -> [_$_] - IO Adjustment -newAdjustment value lower upper stepIncrement pageIncrement pageSize = [_$_] - adjustmentNew value lower upper stepIncrement pageIncrement pageSize - --- | see 'iMContextNew' --- ---newIMContext :: IO iMContext ---newIMContext = iMContextNew - --- | see 'iMMulticontextNew' --- ---newIMMulticontext :: IO iMMulticontext ---newIMMulticontext = iMMulticontextNew - --- | see 'itemFactoryNew' --- ---newItemFactory :: IO ItemFactory ---newItemFactory = itemFactoryNew - --- | see 'tooltipsNew' --- -newTooltips :: IO Tooltips -newTooltips = tooltipsNew - - --- | see 'name' --- -newIconFactory :: IO IconFactory -newIconFactory = iconFactoryNew - rmfile ./mogul/Graphics/UI/Gtk/Mogul/NewWidget.hs.pp hunk ./mogul/Graphics/UI/Gtk/Mogul/TreeList.hs 1 --- -*-haskell-*- --- The Monad GUI Library (Mogul): Widget TreeView --- --- Author : Axel Simon --- --- Created: 2 June 2001 --- --- Version $Revision: 1.3 $ from $Date: 2005/05/20 23:54:00 $ --- --- Copyright (C) 2001 Axel Simon --- --- This library is free software; you can redistribute it and/or --- modify it under the terms of the GNU Lesser General Public --- License as published by the Free Software Foundation; either --- version 2.1 of the License, or (at your option) any later version. --- --- This library is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --- Lesser General Public License for more details. --- --- | --- --- This module provides all object for a widget displaying data organized --- in a table. [_$_] --- --- * There are two flavors: A simple list organizes --- data in rows and a tree which provides the possibility to impose a --- hierarchical structure on the entries of one column. --- --- * The widget is composed of two parts: A database holding rows of data and --- the widget object itself which displays items based on the database. --- Several widgets may use a single storage object. The data in the database --- may be what is directly displayed like strings and images or it may be --- some meta information like the padding or color of an item. Several --- attributes in the storage object may be used to display one column --- in the widget. In contrast each row in the store corresponds to a row --- in the widget. --- --- * The widget that displays the data and can be inserted like any other --- into a container is called 'TreeView'. This widget is itself --- a container for 'TreeViewColumn's which has a title at the top --- of the column. Each 'TreeViewColumn' in turn can contain --- several 'Renderer'. There are currently three --- 'Renderer', one for each of the following items: [_$_] --- text, 'Pixbuf' and 'ToggleButton'. --- --- * The database is called store, specifically for simple lists it is --- 'ListStore' and for hierachical data it is called [_$_] --- 'TreeStore'. A store is created from a skeleton. [_$_] --- '' Attributes can be added to an empty [_$_] --- 'ListSkel' or 'TreeSkel' skeleton which yields --- a functions to access the attribute and an 'Association'. --- After the skeleton is turned into a store by calling either --- 'newListStore' or 'newTreeStore', [_$_] --- 'Association's can be inserted together with an appropriate --- 'Renderer' into a 'TreeViewColumn'. --- --- TODO --- --- * Figure out if properties in the store have priority over global --- properties when both are set. --- -module Graphics.UI.Gtk.Mogul.TreeList ( - -- * ListStore - ListSkel, - emptyListSkel, - listSkelAddAttribute, - newListStore, - -- * TreeStore - TreeSkel, - emptyTreeSkel, - treeSkelAddAttribute, - newTreeStore, - -- * Widget - Association, - Renderer, - treeViewColumnNewText, - treeViewColumnNewPixbuf, - treeViewColumnNewToggle, - treeViewColumnAssociate, - -- * CellRenderer - cellRendererSetAttribute, - cellRendererGetAttribute, - -- * CellRendererText - onEdited, - afterEdited, [_$_] - ) where - -import Monad (liftM, mapM, mapM_, foldM) -import System.Glib.GType (typeInstanceIsA) -import Graphics.UI.Gtk hiding ( - -- TreeModel - treeModelGetValue, - treeModelGetIter, - treeModelGetPath, - -- ListStore - listStoreNew, - listStoreSetValue, - -- TreeStore - treeStoreNew, - treeStoreSetValue, - -- TreeViewColumn - treeViewColumnAddAttribute, - -- CellRendererText - onEdited, - afterEdited, - -- TreeView - treeViewGetPathAtPos) - -import Data.IORef (IORef(..), newIORef, readIORef, writeIORef) -import Control.Exception (throw, Exception(AssertionFailed)) - -import qualified Graphics.UI.Gtk as Gtk - - --- | A skeleton of a 'ListStore' database. --- --- * This datastructure describes what columns the database will have when --- it is finally created by 'newListStore'. --- -newtype ListSkel = ListSkel (IORef ListSkelState) - -data ListSkelState = LSSPrepare [TMType] - | LSSActive ListStore - - --- | Returns an empty 'ListSkel'. --- -emptyListSkel :: IO ListSkel -emptyListSkel = liftM ListSkel (newIORef (LSSPrepare [])) - --- | Reserve a new column in --- 'ListSkel' to hold values for the given attribute. --- --- * The type of the column is determined by the given 'Attribute' --- of the 'ViewColumn' which should be stored here. It is possible --- to associate this column with several 'ViewColumn's. --- -listSkelAddAttribute :: CellRendererClass cr => [_$_] - ListSkel -> [_$_] - Attribute cr argTy -> - IO (Association cr, - TreeIter -> IO argTy, - TreeIter -> argTy -> IO ()) -listSkelAddAttribute (ListSkel statusRef) [_$_] - (Attribute prop ty toGen fromGen) = do - status <- readIORef statusRef - case status of [_$_] - LSSPrepare tTree -> do - writeIORef statusRef (LSSPrepare (ty++tTree)) - let columnNo = length tTree - let cols = length ty - return (Association prop columnNo, - \ti -> do - status <- readIORef statusRef - case status of [_$_] - LSSPrepare _ -> throw $ AssertionFailed [_$_] - "Modul.TreeStore<readValue>: \ - \skeleton was not converted to a TreeStore before data access." - LSSActive ls -> mapM (Gtk.treeModelGetValue ls ti) [_$_] - [columnNo..columnNo+cols-1] - >>= fromGen, - \ti arg -> do - status <- readIORef statusRef - case status of [_$_] - LSSPrepare _ -> throw $ AssertionFailed [_$_] - "Modul.TreeStore<writeValue>: \ - \skeleton was not converted to a TreeStore before data access." - LSSActive ls -> liftM (zip [columnNo..]) (toGen arg) >>= [_$_] - mapM_ (uncurry (Gtk.listStoreSetValue ls ti)) - ) - - --- | Create a new 'ListStore' database. --- --- * This method throws an exception if the skeleton has been used before. --- -newListStore :: ListSkel -> IO ListStore -newListStore (ListSkel statusRef) = do - status <- readIORef statusRef - case status of - LSSPrepare tList -> do - ls <- Gtk.listStoreNew (reverse tList) - writeIORef statusRef (LSSActive ls) - return ls - LSSActive _ -> throw $ AssertionFailed [_$_] - "Mogul.newListStore: tried to reuse a ListStore skeleton." - - --- | A skeleton of a 'TreeStore' database. --- --- * This datastructure describes what columns the database will have when --- it is finally created by 'newTreeStore' --- -newtype TreeSkel = TreeSkel (IORef TreeSkelState) - -data TreeSkelState = TSSPrepare [TMType] - | TSSActive TreeStore - - --- | Returns an empty 'TreeSkel'. --- -emptyTreeSkel :: IO TreeSkel -emptyTreeSkel = liftM TreeSkel (newIORef (TSSPrepare [])) - --- | Reserve a new column in --- 'TreeSkel' to hold values for the given attribute. --- --- * The type of the column is determined by the given 'Attribute' --- of the 'ViewColumn' which should be stored here. It is possible --- to associate this column with several 'ViewColumn's. --- -treeSkelAddAttribute :: CellRendererClass r => TreeSkel -> [_$_] - Attribute r argTy -> - IO (Association r, - ... [truncated message content] |