Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
The FileChooserButton
is a widget that lets the user select a
file. It implements the FileChooser
interface. Visually, it is a
file name with a button to bring up a FileChooserDialog
.
The user can then use that dialog to change the file associated with
that button. This widget does not support setting the
FileChooser
:select-multiple
property to True
.
Create a button to let the user select a file in /etc
C code
{ GtkWidget *button; button = gtk_file_chooser_button_new (_("Select a file"), GTK_FILE_CHOOSER_ACTION_OPEN); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button), "/etc"); }
The FileChooserButton
supports the GtkFileChooserActions
FileChooserActionOpen
and FileChooserActionSelectFolder
.
The 'GI.Gtk.Objects.FileChooserButton.FileChooserButton' will ellipsize the label, and will thus request little horizontal space. To give the button more space, you should call 'GI.Gtk.Objects.Widget.widgetGetPreferredSize', 'GI.Gtk.Objects.FileChooserButton.fileChooserButtonSetWidthChars', or pack the button in such a way that other interface elements give space to the widget.
- newtype FileChooserButton = FileChooserButton (ManagedPtr FileChooserButton)
- class GObject o => IsFileChooserButton o
- toFileChooserButton :: IsFileChooserButton o => o -> IO FileChooserButton
- noFileChooserButton :: Maybe FileChooserButton
- data FileChooserButtonGetFocusOnClickMethodInfo
- fileChooserButtonGetFocusOnClick :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> m Bool
- data FileChooserButtonGetTitleMethodInfo
- fileChooserButtonGetTitle :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> m Text
- data FileChooserButtonGetWidthCharsMethodInfo
- fileChooserButtonGetWidthChars :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> m Int32
- fileChooserButtonNew :: (HasCallStack, MonadIO m) => Text -> FileChooserAction -> m FileChooserButton
- fileChooserButtonNewWithDialog :: (HasCallStack, MonadIO m, IsDialog a) => a -> m FileChooserButton
- data FileChooserButtonSetFocusOnClickMethodInfo
- fileChooserButtonSetFocusOnClick :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> Bool -> m ()
- data FileChooserButtonSetTitleMethodInfo
- fileChooserButtonSetTitle :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> Text -> m ()
- data FileChooserButtonSetWidthCharsMethodInfo
- fileChooserButtonSetWidthChars :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> Int32 -> m ()
- data FileChooserButtonDialogPropertyInfo
- constructFileChooserButtonDialog :: (IsFileChooserButton o, IsFileChooser a) => a -> IO (GValueConstruct o)
- fileChooserButtonDialog :: AttrLabelProxy "dialog"
- data FileChooserButtonTitlePropertyInfo
- constructFileChooserButtonTitle :: IsFileChooserButton o => Text -> IO (GValueConstruct o)
- fileChooserButtonTitle :: AttrLabelProxy "title"
- getFileChooserButtonTitle :: (MonadIO m, IsFileChooserButton o) => o -> m Text
- setFileChooserButtonTitle :: (MonadIO m, IsFileChooserButton o) => o -> Text -> m ()
- data FileChooserButtonWidthCharsPropertyInfo
- constructFileChooserButtonWidthChars :: IsFileChooserButton o => Int32 -> IO (GValueConstruct o)
- fileChooserButtonWidthChars :: AttrLabelProxy "widthChars"
- getFileChooserButtonWidthChars :: (MonadIO m, IsFileChooserButton o) => o -> m Int32
- setFileChooserButtonWidthChars :: (MonadIO m, IsFileChooserButton o) => o -> Int32 -> m ()
- type C_FileChooserButtonFileSetCallback = Ptr () -> Ptr () -> IO ()
- type FileChooserButtonFileSetCallback = IO ()
- data FileChooserButtonFileSetSignalInfo
- afterFileChooserButtonFileSet :: (GObject a, MonadIO m) => a -> FileChooserButtonFileSetCallback -> m SignalHandlerId
- genClosure_FileChooserButtonFileSet :: FileChooserButtonFileSetCallback -> IO Closure
- mk_FileChooserButtonFileSetCallback :: C_FileChooserButtonFileSetCallback -> IO (FunPtr C_FileChooserButtonFileSetCallback)
- noFileChooserButtonFileSetCallback :: Maybe FileChooserButtonFileSetCallback
- onFileChooserButtonFileSet :: (GObject a, MonadIO m) => a -> FileChooserButtonFileSetCallback -> m SignalHandlerId
- wrap_FileChooserButtonFileSetCallback :: FileChooserButtonFileSetCallback -> Ptr () -> Ptr () -> IO ()
Exported types
newtype FileChooserButton Source #
GObject FileChooserButton Source # | |
IsImplementorIface FileChooserButton Source # | |
IsObject FileChooserButton Source # | |
IsWidget FileChooserButton Source # | |
IsContainer FileChooserButton Source # | |
IsBox FileChooserButton Source # | |
IsOrientable FileChooserButton Source # | |
IsFileChooser FileChooserButton Source # | |
IsBuildable FileChooserButton Source # | |
IsFileChooserButton FileChooserButton Source # | |
((~) * info (ResolveFileChooserButtonMethod t FileChooserButton), MethodInfo * info FileChooserButton p) => IsLabel t (FileChooserButton -> p) Source # | |
((~) * info (ResolveFileChooserButtonMethod t FileChooserButton), MethodInfo * info FileChooserButton p) => IsLabelProxy t (FileChooserButton -> p) Source # | |
HasAttributeList * FileChooserButton Source # | |
type AttributeList FileChooserButton Source # | |
type SignalList FileChooserButton Source # | |
class GObject o => IsFileChooserButton o Source #
toFileChooserButton :: IsFileChooserButton o => o -> IO FileChooserButton Source #
Methods
getFocusOnClick
data FileChooserButtonGetFocusOnClickMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsFileChooserButton a) => MethodInfo * FileChooserButtonGetFocusOnClickMethodInfo a signature Source # | |
fileChooserButtonGetFocusOnClick Source #
:: (HasCallStack, MonadIO m, IsFileChooserButton a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 3.20)Use widgetGetFocusOnClick
instead
Returns whether the button grabs focus when it is clicked with the mouse.
See fileChooserButtonSetFocusOnClick
.
Since: 2.10
getTitle
data FileChooserButtonGetTitleMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsFileChooserButton a) => MethodInfo * FileChooserButtonGetTitleMethodInfo a signature Source # | |
fileChooserButtonGetTitle Source #
:: (HasCallStack, MonadIO m, IsFileChooserButton a) | |
=> a |
|
-> m Text | Returns: a pointer to the browse dialog’s title. |
Retrieves the title of the browse dialog used by button
. The returned value
should not be modified or freed.
Since: 2.6
getWidthChars
data FileChooserButtonGetWidthCharsMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsFileChooserButton a) => MethodInfo * FileChooserButtonGetWidthCharsMethodInfo a signature Source # | |
fileChooserButtonGetWidthChars Source #
:: (HasCallStack, MonadIO m, IsFileChooserButton a) | |
=> a |
|
-> m Int32 | Returns: an integer width (in characters) that the button will use to size itself. |
Retrieves the width in characters of the button
widget’s entry and/or label.
Since: 2.6
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> FileChooserAction |
|
-> m FileChooserButton | Returns: a new button widget. |
Creates a new file-selecting button widget.
Since: 2.6
newWithDialog
fileChooserButtonNewWithDialog Source #
:: (HasCallStack, MonadIO m, IsDialog a) | |
=> a |
|
-> m FileChooserButton | Returns: a new button widget. |
Creates a FileChooserButton
widget which uses dialog
as its
file-picking window.
Note that dialog
must be a Dialog
(or subclass) which
implements the FileChooser
interface and must not have
DialogFlagsDestroyWithParent
set.
Also note that the dialog needs to have its confirmative button
added with response ResponseTypeAccept
or ResponseTypeOk
in
order for the button to take over the file selected in the dialog.
Since: 2.6
setFocusOnClick
data FileChooserButtonSetFocusOnClickMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsFileChooserButton a) => MethodInfo * FileChooserButtonSetFocusOnClickMethodInfo a signature Source # | |
fileChooserButtonSetFocusOnClick Source #
:: (HasCallStack, MonadIO m, IsFileChooserButton a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 3.20)Use widgetSetFocusOnClick
instead
Sets whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.
Since: 2.10
setTitle
data FileChooserButtonSetTitleMethodInfo Source #
((~) * signature (Text -> m ()), MonadIO m, IsFileChooserButton a) => MethodInfo * FileChooserButtonSetTitleMethodInfo a signature Source # | |
fileChooserButtonSetTitle Source #
:: (HasCallStack, MonadIO m, IsFileChooserButton a) | |
=> a |
|
-> Text |
|
-> m () |
Modifies the title
of the browse dialog used by button
.
Since: 2.6
setWidthChars
data FileChooserButtonSetWidthCharsMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsFileChooserButton a) => MethodInfo * FileChooserButtonSetWidthCharsMethodInfo a signature Source # | |
fileChooserButtonSetWidthChars Source #
:: (HasCallStack, MonadIO m, IsFileChooserButton a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the width (in characters) that button
will use to nChars
.
Since: 2.6
Properties
dialog
data FileChooserButtonDialogPropertyInfo Source #
constructFileChooserButtonDialog :: (IsFileChooserButton o, IsFileChooser a) => a -> IO (GValueConstruct o) Source #
fileChooserButtonDialog :: AttrLabelProxy "dialog" Source #
title
data FileChooserButtonTitlePropertyInfo Source #
constructFileChooserButtonTitle :: IsFileChooserButton o => Text -> IO (GValueConstruct o) Source #
fileChooserButtonTitle :: AttrLabelProxy "title" Source #
getFileChooserButtonTitle :: (MonadIO m, IsFileChooserButton o) => o -> m Text Source #
setFileChooserButtonTitle :: (MonadIO m, IsFileChooserButton o) => o -> Text -> m () Source #
widthChars
data FileChooserButtonWidthCharsPropertyInfo Source #
constructFileChooserButtonWidthChars :: IsFileChooserButton o => Int32 -> IO (GValueConstruct o) Source #
fileChooserButtonWidthChars :: AttrLabelProxy "widthChars" Source #
getFileChooserButtonWidthChars :: (MonadIO m, IsFileChooserButton o) => o -> m Int32 Source #
setFileChooserButtonWidthChars :: (MonadIO m, IsFileChooserButton o) => o -> Int32 -> m () Source #
Signals
fileSet
type FileChooserButtonFileSetCallback = IO () Source #
afterFileChooserButtonFileSet :: (GObject a, MonadIO m) => a -> FileChooserButtonFileSetCallback -> m SignalHandlerId Source #
mk_FileChooserButtonFileSetCallback :: C_FileChooserButtonFileSetCallback -> IO (FunPtr C_FileChooserButtonFileSetCallback) Source #
onFileChooserButtonFileSet :: (GObject a, MonadIO m) => a -> FileChooserButtonFileSetCallback -> m SignalHandlerId Source #
wrap_FileChooserButtonFileSetCallback :: FileChooserButtonFileSetCallback -> Ptr () -> Ptr () -> IO () Source #