gtk_valueIOWidget

gtk_valueIOWidget — Defines a specialised GtkHBox with three button to open, save and save as XML value files.

Synopsis

                    VisuUiValueIo;
gboolean            (*VisuUiValueIoCallback)            (const gchar *filename,
                                                         GError **error);
                    VisuUiValueIoClass;
void                visu_ui_value_io_connectOnOpen      (VisuUiValueIo *valueio,
                                                         VisuUiValueIoCallback open);
void                visu_ui_value_io_connectOnSave      (VisuUiValueIo *valueio,
                                                         VisuUiValueIoCallback save);
gchar *             visu_ui_value_io_getFilename        (GtkWindow *parent);
GtkWidget *         visu_ui_value_io_new                (GtkWindow *parent,
                                                         const gchar *tipsOpen,
                                                         const gchar *tipsSave,
                                                         const gchar *tipsSaveAs);
gboolean            visu_ui_value_io_setFilename        (VisuUiValueIo *valueio,
                                                         const gchar *filename);
void                visu_ui_value_io_setSensitiveOpen   (VisuUiValueIo *valueio,
                                                         gboolean status);
void                visu_ui_value_io_setSensitiveSave   (VisuUiValueIo *valueio,
                                                         gboolean status);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkWidget
               +----GtkContainer
                     +----GtkBox
                           +----GtkHBox
                                 +----VisuUiValueIo

Implemented Interfaces

VisuUiValueIo implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Description

Details

VisuUiValueIo

typedef struct _VisuUiValueIo VisuUiValueIo;

Private structure to store informations of a VisuUiValueIo object.

Since 3.5


VisuUiValueIoCallback ()

gboolean            (*VisuUiValueIoCallback)            (const gchar *filename,
                                                         GError **error);

Prototypes of functions to be called when an IO file is saved or opened, see visu_ui_value_io_connectOnOpen() and visu_ui_value_io_connectOnSave().

filename :

the name of the file to be saved or opened ;

error :

a location to store a possible error.

Returns :

should return TRUE if the action of the callback succeed.

VisuUiValueIoClass

typedef struct _VisuUiValueIoClass VisuUiValueIoClass;

Private structure to store informations of a VisuUiValueIoClass object.

Since 3.5


visu_ui_value_io_connectOnOpen ()

void                visu_ui_value_io_connectOnOpen      (VisuUiValueIo *valueio,
                                                         VisuUiValueIoCallback open);

Set the function to call when the open button is clicked.

valueio :

a VisuUiValueIo widget.

open :

a method.

Since 3.5


visu_ui_value_io_connectOnSave ()

void                visu_ui_value_io_connectOnSave      (VisuUiValueIo *valueio,
                                                         VisuUiValueIoCallback save);

Set the function to call when the save or save-as button is clicked.

valueio :

a VisuUiValueIo widget.

save :

a method.

Since 3.5


visu_ui_value_io_getFilename ()

gchar *             visu_ui_value_io_getFilename        (GtkWindow *parent);

Open a save dialog window with XML filter to choose the name of a file. This is the default action that can be connect to a VisuUiValueIo widget using visu_ui_value_io_connectOnSave().

parent :

a parent to display the dialog on.

Returns :

a filename that should be freed later with g_free() by the caller.

Since 3.5


visu_ui_value_io_new ()

GtkWidget *         visu_ui_value_io_new                (GtkWindow *parent,
                                                         const gchar *tipsOpen,
                                                         const gchar *tipsSave,
                                                         const gchar *tipsSaveAs);

A VisuUiValueIo widget is like a GtkComboBox widget, but it is already filled with predefined line patterns (call stipple). Using this widget is a convienient way to share stipples between all part of V_Sim and to give a consistent look of all stipple selection.

parent :

the parent used to show the file dialog.

tipsOpen :

a tooltip to show on open button.

tipsSave :

a tooltip to show on save button.

tipsSaveAs :

a tooltip to show on save-as button.

Returns :

a newly created VisuUiValueIo widget. [transfer full]

Since 3.5


visu_ui_value_io_setFilename ()

gboolean            visu_ui_value_io_setFilename        (VisuUiValueIo *valueio,
                                                         const gchar *filename);

Call the open routine previously set by visu_ui_value_io_connectOnOpen() on filename and update the buttons accordingly.

valueio :

a VisuUiValueIo widget.

filename :

a location on disk.

Returns :

TRUE on success of the open routine.

Since 3.5


visu_ui_value_io_setSensitiveOpen ()

void                visu_ui_value_io_setSensitiveOpen   (VisuUiValueIo *valueio,
                                                         gboolean status);

Modify the sensitivity of the open button, depending on status.

valueio :

a VisuUiValueIo widget.

status :

a boolean.

Since 3.5


visu_ui_value_io_setSensitiveSave ()

void                visu_ui_value_io_setSensitiveSave   (VisuUiValueIo *valueio,
                                                         gboolean status);

Modify the sensitivity of the save button, depending on status.

valueio :

a VisuUiValueIo widget.

status :

a boolean.

Since 3.5