static void nmt_mtu_entry_init (NmtMtuEntry *entry) { NmtMtuEntryPrivate *priv = NMT_MTU_ENTRY_GET_PRIVATE (entry); NmtNewtGrid *grid = NMT_NEWT_GRID (entry); NmtNewtWidget *real_entry, *label; real_entry = nmt_newt_entry_numeric_new (10, 0, 65535); priv->entry = NMT_NEWT_ENTRY (real_entry); label = nmt_newt_label_new (_("bytes")); priv->label = NMT_NEWT_LABEL (label); nmt_newt_grid_add (grid, real_entry, 0, 0); nmt_newt_grid_add (grid, label, 1, 0); nmt_newt_widget_set_padding (label, 1, 0, 0, 0); nmt_newt_entry_set_validator (priv->entry, mtu_validator, entry); g_object_bind_property_full (entry, "mtu", real_entry, "text", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE, mtu_transform_to_text, NULL, NULL, NULL); }
static void nmt_device_entry_init (NmtDeviceEntry *deventry) { NmtDeviceEntryPrivate *priv = NMT_DEVICE_ENTRY_GET_PRIVATE (deventry); NmtNewtWidget *entry; priv->hardware_type = G_TYPE_NONE; entry = nmt_newt_entry_new (-1, 0); priv->entry = NMT_NEWT_ENTRY (entry); nmt_newt_entry_set_validator (priv->entry, device_entry_validate, deventry); g_signal_connect (priv->entry, "notify::text", G_CALLBACK (entry_text_changed), deventry); #if 0 priv->button = nmt_newt_button_new (_("Select...")); g_signal_connect (priv->button, "clicked", G_CALLBACK (do_select_dialog), deventry); #endif }
static void nmt_ip_entry_init (NmtIPEntry *entry) { nmt_newt_entry_set_filter (NMT_NEWT_ENTRY (entry), ip_entry_filter, NULL); nmt_newt_entry_set_validator (NMT_NEWT_ENTRY (entry), ip_entry_validate, NULL); }
static void nmt_newt_entry_numeric_init (NmtNewtEntryNumeric *entry) { nmt_newt_entry_set_filter (NMT_NEWT_ENTRY (entry), newt_entry_numeric_filter, NULL); nmt_newt_entry_set_validator (NMT_NEWT_ENTRY (entry), newt_entry_numeric_validate, NULL); }