Logo Search packages:      
Sourcecode: inkscape version File versions

SPKnot* sp_knot_new ( SPDesktop desktop,
const gchar *  tip 

Return new knot object.

Definition at line 449 of file knot.cpp.

References SPKnot::_event_handler_id, SPKnot::desktop, SPKnot::flags, SPKnot::item, sp_canvas_item_new(), sp_knot_handler(), and SPKnot::tip.

Referenced by sp_node_ensure_knot_exists(), and sp_nodepath_node_new().

    g_return_val_if_fail(desktop != NULL, NULL);

    SPKnot * knot = (SPKnot*) g_object_new(SP_TYPE_KNOT, 0);

    knot->desktop = desktop;
    knot->flags = SP_KNOT_VISIBLE;
    if (tip) {
        knot->tip = g_strdup (tip);

    knot->item = sp_canvas_item_new(sp_desktop_controls (desktop),
                                    "anchor", GTK_ANCHOR_CENTER,
                                    "size", 8.0,
                                    "filled", TRUE,
                                    "fill_color", 0xffffff00,
                                    "stroked", TRUE,
                                    "stroke_color", 0x01000000,
                                    "mode", SP_KNOT_MODE_XOR,

    knot->_event_handler_id = gtk_signal_connect(GTK_OBJECT(knot->item), "event",
                                                 GTK_SIGNAL_FUNC(sp_knot_handler), knot);

    return knot;

Generated by  Doxygen 1.6.0   Back to index