gtk_valueIOWidget

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

Synopsis

#define             VALUE_IO_TYPE
#define             VALUE_IO                            (obj)
#define             VALUE_IO_CLASS                      (klass)
#define             IS_VALUE_IO                         (obj)
#define             IS_VALUE_IO_CLASS                   (klass)
                    ValueIO;
                    ValueIOClass;
GType               valueIO_get_type                    (void);
GtkWidget*          valueIONew                          (GtkWindow *parent,
                                                         const gchar *tipsOpen,
                                                         const gchar *tipsSave,
                                                         const gchar *tipsSaveAs);
gboolean            (*ValueIOCallback)                  (const gchar *filename,
                                                         GError **error);
void                valueIOConnect_open                 (ValueIO *valueio,
                                                         ValueIOCallback open);
void                valueIOConnect_save                 (ValueIO *valueio,
                                                         ValueIOCallback save);
void                valueIOSet_openSensitive            (ValueIO *valueio,
                                                         gboolean status);
void                valueIOSet_saveSensitive            (ValueIO *valueio,
                                                         gboolean status);
gboolean            valueIOSet_filename                 (ValueIO *valueio,
                                                         const gchar *filename);
gchar*              valueIOGet_saveFilename             (GtkWindow *parent);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBox
                                 +----GtkHBox
                                       +----ValueIO

Implemented Interfaces

ValueIO implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Description

Details

VALUE_IO_TYPE

#define VALUE_IO_TYPE         (valueIO_get_type ())

Get the associated GType to the ValueIO objects.

Since 3.5


VALUE_IO()

#define VALUE_IO(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALUE_IO_TYPE, ValueIO))

Cast the given object to a ValueIO object.

obj :

the widget to cast.

Since 3.5


VALUE_IO_CLASS()

#define VALUE_IO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALUE_IO_TYPE, ValueIOClass))

Cast the given class to a ValueIOClass object.

klass :

the class to cast.

Since 3.5


IS_VALUE_IO()

#define IS_VALUE_IO(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALUE_IO_TYPE))

Get if the given object is a valid ValueIO object.

obj :

the object to test.

Since 3.5


IS_VALUE_IO_CLASS()

#define IS_VALUE_IO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALUE_IO_TYPE))

Get if the given class is a valid ValueIOClass class.

klass :

the class to test.

Since 3.5


ValueIO

typedef struct _ValueIO ValueIO;

Private structure to store informations of a ValueIO object.

Since 3.5


ValueIOClass

typedef struct _ValueIOClass ValueIOClass;

Private structure to store informations of a ValueIOClass object.

Since 3.5


valueIO_get_type ()

GType               valueIO_get_type                    (void);

GType are unique numbers to identify objects.

Returns :

the GType associated with ValueIO objects.

Since 3.5


valueIONew ()

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

A ValueIO 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 ValueIO widget.

Since 3.5


ValueIOCallback ()

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

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

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.

valueIOConnect_open ()

void                valueIOConnect_open                 (ValueIO *valueio,
                                                         ValueIOCallback open);

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

valueio :

a ValueIO widget.

open :

a method.

Since 3.5


valueIOConnect_save ()

void                valueIOConnect_save                 (ValueIO *valueio,
                                                         ValueIOCallback save);

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

valueio :

a ValueIO widget.

save :

a method.

Since 3.5


valueIOSet_openSensitive ()

void                valueIOSet_openSensitive            (ValueIO *valueio,
                                                         gboolean status);

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

valueio :

a ValueIO widget.

status :

a boolean.

Since 3.5


valueIOSet_saveSensitive ()

void                valueIOSet_saveSensitive            (ValueIO *valueio,
                                                         gboolean status);

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

valueio :

a ValueIO widget.

status :

a boolean.

Since 3.5


valueIOSet_filename ()

gboolean            valueIOSet_filename                 (ValueIO *valueio,
                                                         const gchar *filename);

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

valueio :

a ValueIO widget.

filename :

a location on disk.

Returns :

TRUE on success of the open routine.

Since 3.5


valueIOGet_saveFilename ()

gchar*              valueIOGet_saveFilename             (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 ValueIO widget using valueIOConnect_save().

parent :

a parent to display the dialog on.

Returns :

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

Since 3.5