Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | gtk_nodes_node_new () |
GtkWidget * | gtk_nodes_node_item_add () |
void | gtk_nodes_node_item_remove () |
void | gtk_nodes_node_item_set_expand () |
void | gtk_nodes_node_item_set_fill () |
void | gtk_nodes_node_item_set_packing () |
void | gtk_nodes_node_set_label () |
gdouble | gtk_nodes_node_get_socket_radius () |
void | gtk_nodes_node_set_socket_radius () |
gboolean | gtk_nodes_node_get_expanded () |
void | gtk_nodes_node_set_expanded () |
void | gtk_nodes_node_block_expander () |
void | gtk_nodes_node_unblock_expander () |
GList * | gtk_nodes_node_get_sinks () |
GList * | gtk_nodes_node_get_sources () |
gchar * | gtk_nodes_node_export_properties () |
void | gtk_nodes_node_set_icon_name () |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBox ╰── GtkNodesNode
The GtkNodesNode widget is a widget container drived from GtkBox. Widgets added to the node are assigned a GtkNodesNodeSocket. The user must configure the type of socket and connect to the socket-incoming signal in order to be able to receive the data passed through a connection.
The Node can be collapsed by clicking the GtkExpander which will hide the node items, and show a compact representation of the node with just the GtkExpander and the sockets visible.
While possible, using a GtkNodesNode outside of a GtkNodesNodeView does not make much sense.
The placement of sockets is currently only properly supported for the GTK_ORIENTATION_VERTICAL orientation
Custom GtkNodesNode widgets can save and restore their internal child
widget states and other properties and special tags by by implementing
the proper GtkBuildable interfaces. To export the configuration,
node_export_properties()
must be implemented and is expected to return
valid xml output which is integrated into the xml output produced
by GtkNodesNodeView.
For example, to restore the value of an internal spin button widget, the function would return an allocated string containing:
<child> <object> 5 </object> </child>GtkWidget * gtk_nodes_node_item_add (GtkNodesNode *node
,GtkWidget *widget
,GtkNodesNodeSocketIO type
);
void gtk_nodes_node_item_remove (GtkNodesNode *node
,GtkWidget *widget
);
This removes an item and its corresponding socket from a GtkNodesNode ´
void gtk_nodes_node_item_set_expand (GtkNodesNode *node
,GtkWidget *child
,gboolean expand
);
void gtk_nodes_node_item_set_fill (GtkNodesNode *node
,GtkWidget *child
,gboolean fill
);
void gtk_nodes_node_item_set_packing (GtkNodesNode *node
,GtkWidget *child
,GtkPackType pack_type
);
void gtk_nodes_node_set_socket_radius (GtkNodesNode *node
,const gdouble radius
);
void gtk_nodes_node_set_expanded (GtkNodesNode *node
,gboolean expanded
);
void
gtk_nodes_node_block_expander (GtkNodesNode *node
);
The expander is very very nasty in that it responds to an isolated "release" event, which I'm apparently unable to block. If the node is contained in a GtkNodesNodeView, it will therefore expand/contract if someone clicks the label when executing a node "drag" motion.
Note: gtk_nodes_node_block_expander()
repeatedly will affect the state only once
void
gtk_nodes_node_unblock_expander (GtkNodesNode *node
);
Unblocks the expander from receiving signals
gchar *
gtk_nodes_node_export_properties (GtkNodesNode *node
);
This returns an XML description of the internal state configuration, so it can be restored with GtkBuilder. NULL will be returned if the derived GtkNodesNode subclass did not implement this function
[virtual export_properties]
void gtk_nodes_node_set_icon_name (GtkNodesNode *node
,const gchar *icon_name
);
“height”
property “height” int
The height of the node
Owner: GtkNodesNode
Flags: Read / Write
Default value: 0
“id”
property“id” guint
The numeric identifier of the node
Owner: GtkNodesNode
Flags: Read / Write
Default value: 0
“width”
property “width” int
The width of the node
Owner: GtkNodesNode
Flags: Read / Write
Default value: 0
“x”
property “x” int
The x position of the node
Owner: GtkNodesNode
Flags: Read / Write
Default value: 0
“node-func-clicked”
signalvoid user_function (GtkNodesNode *widget, gpointer user_data)
The ::node-func-clicked signal is emitted when the user clicks the functional node button on a node socket.
widget |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“node-socket-connect”
signalvoid user_function (GtkNodesNode *widget, GtkWidget *sink, GtkWidget *source, gpointer user_data)
The ::node-socket-connect signal is emitted when a drag on a node socket results in a successful connection
widget |
the object which received the signal. |
|
sink |
the socket which emitted the signal. |
|
source |
the source which connected to the sink |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“node-socket-destroyed”
signalvoid user_function (GtkNodesNode *widget, GtkWidget *socket, gpointer user_data)
The ::node-socket-destroyed signal is emitted when a node socket disconnects from a source socket
widget |
the object which received the signal. |
|
socket |
the socket which emitted the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“node-socket-disconnect”
signalvoid user_function (GtkNodesNode *widget, GtkWidget *sink, GtkWidget *source, gpointer user_data)
The ::node-socket-disconnect signal is emitted when a node socket disconnects from a source socket
widget |
the object which received the signal. |
|
sink |
the socket which emitted the signal. |
|
source |
the source which was connected to the sink |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“node-socket-drag-begin”
signalvoid user_function (GtkNodesNode *widget, int x, int y, gpointer user_data)
The ::node-socket-drag-begin signal is emitted when the user initiates a drag on a node socket. Coordinates are given with respect to the parent.
widget |
the object which received the signal. |
|
x |
the x coordinate of the event |
|
y |
the y coordinate of the event |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“node-socket-drag-end”
signalvoid user_function (GtkNodesNode *widget, gpointer user_data)
The ::node-socket-drag-end signal is emitted when the user ends a drag operation on a node socket.
widget |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First