GwySciText

GwySciText — Text entry with markup and special symbol helper widgets

Synopsis

#include <libgwydgets/gwydgets.h>

struct              GwySciText;
struct              GwySciTextClass;
GtkWidget *         gwy_sci_text_new                    (void);
gchar *             gwy_sci_text_get_text               (GwySciText *sci_text);
void                gwy_sci_text_set_text               (GwySciText *sci_text,
                                                         const gchar *new_text);
gboolean            gwy_sci_text_get_has_preview        (GwySciText *sci_text);
void                gwy_sci_text_set_has_preview        (GwySciText *sci_text,
                                                         gboolean has_preview);
GtkWidget *         gwy_sci_text_get_entry              (GwySciText *sci_text);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBox
                                 +----GtkVBox
                                       +----GwySciText

Implemented Interfaces

GwySciText implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Properties

  "has-preview"              gboolean              : Read / Write

Signals

  "edited"                                         : Run First

Description

Details

struct GwySciText

struct GwySciText;


struct GwySciTextClass

struct GwySciTextClass {
    GtkVBoxClass parent_class;

    /* Signals */
    void (*edited)(GwySciText *sci_text);

    void (*reserved1)(void);
    void (*reserved2)(void);
};


gwy_sci_text_new ()

GtkWidget *         gwy_sci_text_new                    (void);

Creates a new scientific text entry.

Returns :

A newly created scientific text entry.

gwy_sci_text_get_text ()

gchar *             gwy_sci_text_get_text               (GwySciText *sci_text);

Gets the text in a scientific text entry.

The text is already in UTF-8 with all entities converted.

sci_text :

A scientific text widget.

Returns :

The text as a newly allocated string. It should be freed when no longer used.

gwy_sci_text_set_text ()

void                gwy_sci_text_set_text               (GwySciText *sci_text,
                                                         const gchar *new_text);

Sets the text a scientific text widget displays.

It can contain both UTF-8 and entities. UTF-8 characters corresponding to known entities are converted to entities, other characters are left as they are.

sci_text :

A scientific text widget.

new_text :

The text to display.

gwy_sci_text_get_has_preview ()

gboolean            gwy_sci_text_get_has_preview        (GwySciText *sci_text);

Tests the display of a preview in a scientific text entry.

sci_text :

A scientific text widget.

Returns :

TRUE if there is a preview, FALSE if preview is not shown.

gwy_sci_text_set_has_preview ()

void                gwy_sci_text_set_has_preview        (GwySciText *sci_text,
                                                         gboolean has_preview);

Sets the display of a preview in a scientific text entry.

sci_text :

A scientific text widget.

has_preview :

TRUE to display a preview, FALSE to disable it.

gwy_sci_text_get_entry ()

GtkWidget *         gwy_sci_text_get_entry              (GwySciText *sci_text);

Gets the entry widget of a scientific text entry.

sci_text :

A scientific text widget.

Returns :

The entry widget, no reference is added.

Property Details

The "has-preview" property

  "has-preview"              gboolean              : Read / Write

The :has-preview property controls whether a GwySciText has a preview.

Default value: TRUE

Signal Details

The "edited" signal

void                user_function                      (GwySciText *gwyscitext,
                                                        gpointer    user_data)       : Run First

The ::edited signal is emitted when the text in its entry changes to a valid markup. If you need to react to all changes in entry contents, you can use gwy_sci_text_get_entry() to get the entry and connect to its signal.

gwyscitext :

The GwySciText which received the signal.

user_data :

user data set when the signal handler was connected.