GwySciText

GwySciText — Text entry with markup and special symbol helper widgets

Functions

Properties

gboolean has-preview Read / Write

Signals

void edited Run First

Types and Values

struct GwySciText
struct GwySciTextClass

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBox
                    ╰── GwySciText

Implemented Interfaces

GwySciText implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Includes

#include <libgwydgets/gwydgets.h>

Description

Functions

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_markup()

gchar *
gwy_sci_text_get_markup (GwySciText *scitext);

Gets the markup in a scientific text entry.

The returned string may contain Pango markup. Use pango_parse_markup() to remove it if clean text is required.

Parameters

scitext

A scientific text widget.

 

Returns

The markup as a newly allocated string.


gwy_sci_text_set_markup()

void
gwy_sci_text_set_markup (GwySciText *scitext,
                         const gchar *markup);

Sets the text a scientific text widget displays.

The text can contain Pango markup. In principle, the markup can even be more general than the one produced by GwySciText itself. The user will not be able to edit such markup using the buttons, but can still do so manually.

Parameters

scitext

A scientific text widget.

 

markup

The markup to edit.

 

gwy_sci_text_get_has_preview()

gboolean
gwy_sci_text_get_has_preview (GwySciText *scitext);

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

Parameters

scitext

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 *scitext,
                              gboolean has_preview);

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

Parameters

scitext

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 *scitext);

Gets the entry widget of a scientific text entry.

It can be used as a target of a mnemonic label or possibly to watch all changes (not just changes to a valid markup).

Parameters

scitext

A scientific text widget.

 

Returns

The entry widget, no reference is added.

Types and Values

struct GwySciText

struct GwySciText;

struct GwySciTextClass

struct GwySciTextClass {
    GtkBoxClass parent_class;

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

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

Property Details

The “has-preview” property

  “has-preview”              gboolean

Whether scientific text has a preview.

Owner: GwySciText

Flags: Read / Write

Default value: TRUE

Signal Details

The “edited” signal

void
user_function (GwySciText *gwyscitext,
               gpointer    user_data)

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.

Parameters

gwyscitext

The GwySciText which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First