• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GTK_IS_ENTRY函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTK_IS_ENTRY函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_IS_ENTRY函数的具体用法?C++ GTK_IS_ENTRY怎么用?C++ GTK_IS_ENTRY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTK_IS_ENTRY函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: update_bookmark_from_text

static void
update_bookmark_from_text (void)
{
	if (text_changed) {
		NautilusBookmark *bookmark, *bookmark_in_list;
		char *name;
		GdkPixbuf *pixbuf;
		guint selected_row;
		GtkTreeIter iter;
		GFile *location;

		g_assert (GTK_IS_ENTRY (name_field));
		g_assert (GTK_IS_ENTRY (uri_field));

		location = g_file_new_for_uri (gtk_entry_get_text (GTK_ENTRY (uri_field)));
		
		bookmark = nautilus_bookmark_new_with_icon (location, gtk_entry_get_text (GTK_ENTRY (name_field)),
							    name_text_changed, NULL);
		
		g_object_unref (location);

		selected_row = get_selected_row ();

		/* turn off list updating 'cuz otherwise the list-reordering code runs
		 * after repopulate(), thus reordering the correctly-ordered list.
		 */
		g_signal_handler_block (bookmarks, 
					bookmark_list_changed_signal_id);
		nautilus_bookmark_list_delete_item_at (bookmarks, selected_row);
		nautilus_bookmark_list_insert_item (bookmarks, bookmark, selected_row);
		g_signal_handler_unblock (bookmarks, 
					  bookmark_list_changed_signal_id);
		g_object_unref (bookmark);

		/* We also have to update the bookmark pointer in the list
		   store. */
		gtk_tree_selection_get_selected (bookmark_selection,
						 NULL, &iter);
		g_signal_handler_block (bookmark_list_store,
					row_changed_signal_id);

		bookmark_in_list = nautilus_bookmark_list_item_at (bookmarks,
								   selected_row);

		name = nautilus_bookmark_get_name (bookmark_in_list);

		pixbuf = nautilus_bookmark_get_pixbuf (bookmark_in_list, GTK_ICON_SIZE_MENU);

		gtk_list_store_set (bookmark_list_store, &iter,
				    BOOKMARK_LIST_COLUMN_BOOKMARK, bookmark_in_list,
				    BOOKMARK_LIST_COLUMN_NAME, name,
				    BOOKMARK_LIST_COLUMN_ICON, pixbuf,
				    -1);
		g_signal_handler_unblock (bookmark_list_store,
					  row_changed_signal_id);

		gdk_pixbuf_unref (pixbuf);
		g_free (name);
	}
}
开发者ID:Spheerys,项目名称:nautilus,代码行数:60,代码来源:nautilus-bookmarks-window.c


示例2: UT_DEBUGMSG

void TCPUnixAccountHandler::loadProperties()
{
	UT_DEBUGMSG(("TCPUnixAccountHandler::loadProperties()\n"));

	bool serve = getProperty("server") == "";

	if (server_button && GTK_IS_TOGGLE_BUTTON(server_button))
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(server_button), serve);

	if (client_button && GTK_IS_TOGGLE_BUTTON(client_button))
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(client_button), !serve);

	if (server_entry && GTK_IS_ENTRY(server_entry))
		gtk_entry_set_text(GTK_ENTRY(server_entry), getProperty("server").c_str());

	int port = DEFAULT_TCP_PORT;
	try {
		if (hasProperty("port"))
			port = boost::lexical_cast<int>(getProperty("port"));
	} catch (boost::bad_lexical_cast &) {
		UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN);
	}
	if (port_button && GTK_IS_ENTRY(port_button))
		gtk_spin_button_set_value(GTK_SPIN_BUTTON(port_button), port);

	if (allow_all_button && GTK_IS_TOGGLE_BUTTON(allow_all_button))
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(allow_all_button), hasProperty("allow-all") ? getProperty("allow-all") == "true" : false);

	bool autoconnect = hasProperty("autoconnect") ? getProperty("autoconnect") == "true" : true;
	if (autoconnect_button && GTK_IS_TOGGLE_BUTTON(autoconnect_button))
		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(autoconnect_button), autoconnect);
}
开发者ID:tchx84,项目名称:debian-abiword-packages,代码行数:32,代码来源:TCPUnixAccountHandler.cpp


示例3: addProperty

void SIPSimpleUnixAccountHandler::storeProperties()
{
	if (address_entry && GTK_IS_ENTRY(address_entry))
		addProperty("address", gtk_entry_get_text(GTK_ENTRY(address_entry)));

	if (password_entry && GTK_IS_ENTRY(password_entry))
		addProperty("password", gtk_entry_get_text(GTK_ENTRY(password_entry)));

	if (proxy_entry && GTK_IS_ENTRY(proxy_entry))
		addProperty("outbound-proxy", gtk_entry_get_text(GTK_ENTRY(proxy_entry)));

	if (autoconnect_button && GTK_IS_TOGGLE_BUTTON(autoconnect_button))
		addProperty("autoconnect", gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(autoconnect_button)) ? "true" : "false" );
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:14,代码来源:SIPSimpleUnixAccountHandler.cpp


示例4: e_widget_undo_attach

/**
 * e_widget_undo_attach:
 * @widget: a #GtkWidget, where to attach undo functionality
 * @focus_tracker: an #EFocusTracker, can be %NULL
 *
 * The function does nothing, if the widget is not of a supported type
 * for undo functionality, same as when the undo is already attached.
 * It is ensured that the actions of the provided @focus_tracker are
 * updated on change of the @widget.
 *
 * See @e_widget_undo_is_attached().
 *
 * Since: 3.12
 **/
void
e_widget_undo_attach (GtkWidget *widget,
                      EFocusTracker *focus_tracker)
{
	EUndoData *data;

	if (e_widget_undo_is_attached (widget))
		return;

	if (GTK_IS_EDITABLE (widget)) {
		data = g_new0 (EUndoData, 1);
		data->undo_len = DEFAULT_MAX_UNDO_LEVEL;
		data->undo_stack = g_new0 (EUndoInfo *, data->undo_len);

		g_object_set_data_full (G_OBJECT (widget), UNDO_DATA_KEY, data, free_undo_data);

		data->insert_handler_id = g_signal_connect (
			widget, "insert-text",
			G_CALLBACK (editable_undo_insert_text_cb), NULL);
		data->delete_handler_id = g_signal_connect (
			widget, "delete-text",
			G_CALLBACK (editable_undo_delete_text_cb), NULL);

		if (focus_tracker)
			g_signal_connect_swapped (
				widget, "changed",
				G_CALLBACK (e_focus_tracker_update_actions), focus_tracker);

		if (GTK_IS_ENTRY (widget))
			g_signal_connect (
				widget, "populate-popup",
				G_CALLBACK (widget_undo_populate_popup_cb), NULL);
	} else if (GTK_IS_TEXT_VIEW (widget)) {
开发者ID:UIKit0,项目名称:evolution,代码行数:47,代码来源:e-widget-undo.c


示例5: wxCHECK_MSG

bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices)
{
    GtkEntry* const entry = (GtkEntry*)GetEditable();
    wxCHECK_MSG(GTK_IS_ENTRY(entry), false, "auto completion doesn't work with this control");

    GtkListStore * const store = gtk_list_store_new(1, G_TYPE_STRING);
    GtkTreeIter iter;

#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
    for ( wxArrayString::const_iterator i = choices.begin();
          i != choices.end();
          ++i )
    {
        gtk_list_store_append(store, &iter);
        gtk_list_store_set(store, &iter,
                           0, (const gchar *)i->utf8_str(),
                           -1);
    }

    GtkEntryCompletion * const completion = gtk_entry_completion_new();
    gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(store));
    gtk_entry_completion_set_text_column(completion, 0);
    gtk_entry_set_completion(entry, completion);
    g_object_unref(completion);
    return true;
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:34,代码来源:textentry.cpp


示例6: ce_page_mac_entry_valid

gboolean
ce_page_mac_entry_valid (GtkEntry *entry, int type, const char *property_name, GError **error)
{
	const char *mac;

	g_return_val_if_fail (GTK_IS_ENTRY (entry), FALSE);

	mac = gtk_entry_get_text (entry);
	if (mac && *mac) {
		if (!nm_utils_hwaddr_valid (mac, nm_utils_hwaddr_len (type))) {
			const char *addr_type;

			addr_type = type == ARPHRD_ETHER ? _("MAC address") : _("HW address");
			if (property_name) {
				g_set_error (error, NMA_ERROR, NMA_ERROR_GENERIC,
				             _("invalid %s for %s (%s)"),
				             addr_type, property_name, mac);
			} else {
				g_set_error (error, NMA_ERROR, NMA_ERROR_GENERIC,
				             _("invalid %s (%s)"),
				             addr_type, mac);
			}
			return FALSE;
		}
	}
	return TRUE;
}
开发者ID:atulhjp,项目名称:network-manager-applet,代码行数:27,代码来源:ce-page.c


示例7: node

//--------------------------------------------------------------------------------
void DbMySQLTableEditorFKPage::cell_editing_started(GtkCellRenderer* cr, GtkCellEditable* ce, gchar* path, gpointer udata)
{
  DbMySQLTableEditorFKPage* self = reinterpret_cast<DbMySQLTableEditorFKPage*>(udata);

  bec::NodeId node(path);
  if ( node.is_valid() )
    self->_fk_node = node;

  if ( GTK_IS_ENTRY(ce) ) // Fill in name of the foreign key column
  {
    ::bec::FKConstraintListBE        *fk_be         = self->_be->get_fks();
    Gtk::Entry* entry = Glib::wrap(GTK_ENTRY(ce));

    std::string name;
    if (node.back() == fk_be->count()-1)
      fk_be->set_field(node, bec::FKConstraintListBE::Name, 1);

    fk_be->get_field(node, bec::FKConstraintListBE::Name, name);
    entry->set_text(name);
  }

  // clean up edit_done signal/slotl
  if ( self->_ce && self->_edit_conn )
  {
    g_signal_handler_disconnect (self->_ce, self->_edit_conn);
    self->_ce = 0;
    self->_edit_conn = 0;
  }

  if (GTK_IS_CELL_EDITABLE(ce))
  {
    self->_ce = ce;
    self->_edit_conn = g_signal_connect(ce, "editing-done", GCallback(&DbMySQLTableEditorFKPage::cell_editing_done), udata);
  }
}
开发者ID:abibell,项目名称:mysql-workbench,代码行数:36,代码来源:mysql_table_editor_fk_page.cpp


示例8: wxASSERT_MSG

wxSize wxChoice::DoGetSizeFromTextSize(int xlen, int ylen) const
{
    wxASSERT_MSG( m_widget, wxS("GetSizeFromTextSize called before creation") );

    // a GtkEntry for wxComboBox and a GtkCellView for wxChoice
    GtkWidget* childPart = gtk_bin_get_child(GTK_BIN(m_widget));

    // Set a as small as possible size for the control, so preferred sizes
    // return "natural" sizes, not taking into account the previous ones (which
    // seems to be GTK+3 behaviour)
    gtk_widget_set_size_request(m_widget, 0, 0);

    // We are interested in the difference of sizes between the whole contol
    // and its child part. I.e. arrow, separators, etc.
    GtkRequisition req;
    gtk_widget_get_preferred_size(childPart, NULL, &req);
    wxSize totalS = GTKGetPreferredSize(m_widget);

    wxSize tsize(xlen + totalS.x - req.width, totalS.y);

    // For a wxChoice, not for wxComboBox, add some margins
    if ( !GTK_IS_ENTRY(childPart) )
        tsize.IncBy(5, 0);

    // Perhaps the user wants something different from CharHeight
    if ( ylen > 0 )
        tsize.IncBy(0, ylen - GetCharHeight());

    return tsize;
}
开发者ID:chromylei,项目名称:third_party,代码行数:30,代码来源:choice.cpp


示例9: setValueFloat

/** set the widget value as float */
void XAP_UnixWidget::setValueFloat(float val)
{
	if (GTK_IS_ENTRY(m_widget)) {
		std::string str = UT_std_string_sprintf("%f", val);
		gtk_entry_set_text(GTK_ENTRY(m_widget), str.c_str());
	}
}
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:8,代码来源:xap_UnixWidget.cpp


示例10: cterm_set_term_title_dialog_onresponse

void cterm_set_term_title_dialog_onresponse(GtkWidget* dialog, int response, gpointer data) {
    CTerm* term = (CTerm*) data;
    GtkWidget* content_area;
    GtkWidget* widget;
    GtkWidget* entry = NULL;
    const gchar* new_title;
    GList* node;
    GList* list;

    if(response == GTK_RESPONSE_OK) {

        // Get entry widget from dialog
        content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
        list = GTK_BOX(content_area)->children;
        for(node = list; node; node = node->next) {
            widget = ((GtkBoxChild*) node->data)->widget;
            if(GTK_IS_ENTRY(widget)) {
                entry = widget;
                break;
            }
        }

        if(entry) {
            new_title = gtk_entry_get_text(GTK_ENTRY(entry));
            gtk_window_set_title(GTK_WINDOW(term->window), new_title);
        } else {
            fprintf(stderr, "Error: Could not find entry in dialog widget!\n");
        }

    }

    gtk_widget_destroy(dialog);
}
开发者ID:mbrown1413,项目名称:cterm,代码行数:33,代码来源:events.c


示例11: on_insert_clicked

/*
 *  Our callbacks to insert/find/retrieve text from one widget to another.
 */
static void
on_insert_clicked (GtkButton *button,
                   Widgets *w)
{
  g_return_if_fail (GTK_IS_TEXT_VIEW(w->textview));
  g_return_if_fail (GTK_IS_ENTRY(w->entry));

  /*
   *  The subtle difference between a text mark and a text iter: one is a
   *  GObject, the other is not. Also, when GtkTextIter is called "opaque", as
   *  in "private", it actually isn't all that private. But please, pretend to
   *  use it as if it were ... It is A-OK to put text iterators on the stack!
   *  Furthermore, iterators are invalidated after *every* use, so create one,
   *  use often!
   */
  GtkTextBuffer *buffer;
  GtkTextMark   *mark;
  GtkTextIter    iter = {0,};
  const gchar   *text;

  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(w->textview));
  text = gtk_entry_get_text (GTK_ENTRY(w->entry));

  /*
   *  Sets text marker to current cursor position. Also, cursors are simply
   *  *visible* text markers. -1 means "read until \0".
   */
  mark = gtk_text_buffer_get_insert (buffer);
  gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark);
  gtk_text_buffer_insert (buffer, &iter, text, -1);
}
开发者ID:mikhas,项目名称:gtk-tutorial,代码行数:34,代码来源:textview_iterators.c


示例12: _fcitx_im_context_set_capacity

void
_fcitx_im_context_set_capacity(FcitxIMContext* fcitxcontext, gboolean force)
{
    if (fcitx_client_is_valid(fcitxcontext->client)) {
        FcitxCapacityFlags flags = fcitxcontext->capacity & ~(CAPACITY_PREEDIT | CAPACITY_FORMATTED_PREEDIT | CAPACITY_PASSWORD);
        if (fcitxcontext->use_preedit)
            flags |= CAPACITY_PREEDIT | CAPACITY_FORMATTED_PREEDIT;

        if (fcitxcontext->client_window != NULL) {
            GtkWidget *widget;
            gdk_window_get_user_data (fcitxcontext->client_window,
                                      (gpointer *)&widget);
            if (GTK_IS_ENTRY (widget) &&
                    !gtk_entry_get_visibility (GTK_ENTRY (widget))) {
                flags |= CAPACITY_PASSWORD;
            }
        }

        gboolean update = FALSE;
        if (G_UNLIKELY(fcitxcontext->capacity != flags)) {
            fcitxcontext->capacity = flags;
            update = TRUE;
        }
        if (G_UNLIKELY(update || force))
            fcitx_client_set_capacity(fcitxcontext->client, fcitxcontext->capacity);
    }
}
开发者ID:eguopt,项目名称:fcitx,代码行数:27,代码来源:fcitximcontext-gio.c


示例13: confirm_callback

/* When enter is pressed in the confirm entry, move */
static void
confirm_callback (GtkWidget *widget, GtkDialog *dialog)
{
	GtkWidget *entry = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "secure-entry"));
	g_assert (GTK_IS_ENTRY (entry));
	gtk_widget_grab_focus (entry);
}
开发者ID:GNOME,项目名称:libcryptui,代码行数:8,代码来源:seahorse-passphrase.c


示例14: preferences_widget_sync_string

static void
preferences_widget_sync_string (const gchar *key, GtkWidget *widget)
{
	gchar *value;

	if (empathy_conf_get_string (empathy_conf_get (), key, &value) && value) {
		if (GTK_IS_ENTRY (widget)) {
			gtk_entry_set_text (GTK_ENTRY (widget), value);
		} else if (GTK_IS_RADIO_BUTTON (widget)) {
			if (strcmp (key, EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM) == 0) {
				GType        type;
				GEnumClass  *enum_class;
				GEnumValue  *enum_value;
				GSList      *list;
				GtkWidget   *toggle_widget;
				
				/* Get index from new string */
				type = empathy_contact_list_store_sort_get_type ();
				enum_class = G_ENUM_CLASS (g_type_class_peek (type));
				enum_value = g_enum_get_value_by_nick (enum_class, value);
				
				if (enum_value) { 
					list = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget));
					toggle_widget = g_slist_nth_data (list, enum_value->value);
					gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle_widget), TRUE);
				}
			} else {
				g_warning ("Unhandled key:'%s' just had string change", key);
			}
		}

		g_free (value);
	}
}
开发者ID:gcorvala,项目名称:gsoc2008,代码行数:34,代码来源:empathy-preferences.c


示例15: contacts_remove_entries

/* Helper method to clear the text in a GtkEntry or GtkTextView and hide it */
static void
contacts_remove_entries (GtkWidget *entry)
{
	if (GTK_IS_ENTRY (entry)) {
		if (gtk_widget_get_ancestor (entry, GTK_TYPE_COMBO_BOX_ENTRY))
			return;

		gtk_entry_set_text (GTK_ENTRY (entry), "");
		gtk_widget_hide (entry);
	} else if (GTK_IS_TEXT_VIEW (entry)) {
		GtkTextBuffer *buffer =
			gtk_text_view_get_buffer (GTK_TEXT_VIEW (entry));
			
		gtk_text_buffer_set_text (buffer, "", -1);
		
		entry = gtk_widget_get_ancestor (entry, GTK_TYPE_BIN);
		gtk_widget_hide (entry);
	} else if (GTK_IS_CONTAINER (entry)) {
		GList *c, *children =
			gtk_container_get_children (GTK_CONTAINER (entry));
		
		for (c = children; c; c = c->next)
			contacts_remove_entries (GTK_WIDGET (c->data));
		
		gtk_widget_hide (entry);
		
		g_list_free (children);
	}
}
开发者ID:GNOME,项目名称:contacts,代码行数:30,代码来源:contacts-edit-pane.c


示例16: g_signal_handler_disconnect

//--------------------------------------------------------------------------------
void DbMySQLTableEditorIndexPage::cell_editing_done(GtkCellEditable *ce) {
  if (_editing_done_id != 0 && _editable_cell != 0) {
    g_signal_handler_disconnect(_editable_cell, _editing_done_id);
    _editing_done_id = 0;
    _editable_cell = 0;
  }

  // If it's Gtk::Entry, we try to find out if maybe user leave edit field empty,
  // if so we revert it to the last known value or to the default one.
  if (GTK_IS_ENTRY(ce)) {
    GtkEntry *entry_widget = GTK_ENTRY(ce);
    if (entry_widget) {
      Gtk::Entry *entry = Glib::wrap(entry_widget);

      if (entry && entry->get_text_length() == 0) {
        Gtk::TreeModel::Path path;
        Gtk::TreeView::Column *column(0);
        _indexes_tv->get_cursor(path, column);
        bec::NodeId node(path.to_string());
        if (node.is_valid()) {
          std::string name = _user_index_name;
          if (name.empty())
            name = strfmt("index%i", path[0] + 1);

          _be->get_indexes()->set_field(node, MySQLTableIndexListBE::Name, name);
          entry->set_text(name);
        }
      }
    }
  }
}
开发者ID:pk-codebox-evo,项目名称:mysql-workbench,代码行数:32,代码来源:mysql_table_editor_index_page.cpp


示例17: gtk_search_bar_add

static void
gtk_search_bar_add (GtkContainer *container,
                    GtkWidget    *child)
{
  GtkSearchBar *bar = GTK_SEARCH_BAR (container);
  GtkSearchBarPrivate *priv = gtk_search_bar_get_instance_private (bar);

  /* When constructing the widget, we want the revealer to be added
   * as the first child of the search bar, as an implementation detail.
   * After that, the child added by the application should be added
   * to box_center.
   */
  if (priv->box_center == NULL)
    {
      GTK_CONTAINER_CLASS (gtk_search_bar_parent_class)->add (container, child);
    }
  else
    {
      gtk_container_add (GTK_CONTAINER (priv->box_center), child);
      /* If an entry is the only child, save the developer a couple of
       * lines of code
       */
      if (GTK_IS_ENTRY (child))
        gtk_search_bar_connect_entry (bar, GTK_ENTRY (child));
    }
}
开发者ID:GYGit,项目名称:gtk,代码行数:26,代码来源:gtksearchbar.c


示例18: on_menuitem_edit_activate

static void on_menuitem_edit_activate(void)
{
	GtkWidget *widget = gtk_window_get_focus(gui.window);
	bool selectable = false;
	bool editable = false;
	bool selection_ready = false;
	bool clipboard_ready = false;

	if (GTK_IS_ENTRY(widget)) {
		selectable = gtk_entry_get_text_length(GTK_ENTRY(widget));
		editable = gtk_editable_get_editable(GTK_EDITABLE(widget));
		selection_ready = gtk_editable_get_selection_bounds(
			GTK_EDITABLE(widget), NULL, NULL);
		clipboard_ready = gtk_clipboard_wait_is_text_available(
			gtk_clipboard_get(GDK_NONE));
	}

	gtk_widget_set_sensitive(GTK_WIDGET(gui.menuitem_cut),
		selection_ready && editable);
	gtk_widget_set_sensitive(GTK_WIDGET(gui.menuitem_copy),
		selection_ready);
	gtk_widget_set_sensitive(GTK_WIDGET(gui.menuitem_paste),
		editable && clipboard_ready);
	gtk_widget_set_sensitive(GTK_WIDGET(gui.menuitem_delete),
		selection_ready && editable);
	gtk_widget_set_sensitive(GTK_WIDGET(gui.menuitem_select_all),
		selectable);
}
开发者ID:eaglexmw,项目名称:gtkhash,代码行数:28,代码来源:callbacks.c


示例19: widget_entry_changed_cb

static void
widget_entry_changed_cb (GtkWidget *widget,
                         gpointer data)
{
	const gchar *value;
	gint port = -1;
	GConfClient *client;

	client = gconf_client_get_default ();

	/*
	 * Do not change the order of comparison -
	 * GtkSpinButton is an extended form of GtkEntry
	*/
	if (GTK_IS_SPIN_BUTTON (widget)) {
		port = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (widget));
		gconf_client_set_int (client, (const gchar *) data, port, NULL);
		d(g_print ("%s:%s: %s is SpinButton: value = [%d]\n", G_STRLOC, G_STRFUNC, (const gchar *)data, port));
	} else if (GTK_IS_ENTRY (widget)) {
		value = gtk_entry_get_text (GTK_ENTRY (widget));
		gconf_client_set_string (client, (const gchar *) data, value, NULL);
		d(g_print ("%s:%s: %s is Entry: value = [%s]\n", G_STRLOC, G_STRFUNC, (const gchar *)data, value));
	}

	g_object_unref (client);
}
开发者ID:jdapena,项目名称:evolution,代码行数:26,代码来源:em-network-prefs.c


示例20: wxCHECK_MSG

bool wxTextEntry::DoAutoCompleteStrings(const wxArrayString& choices)
{
    GtkEntry* const entry = (GtkEntry*)GetEditable();
    wxCHECK_MSG(GTK_IS_ENTRY(entry), false, "auto completion doesn't work with this control");

    GtkListStore * const store = gtk_list_store_new(1, G_TYPE_STRING);
    GtkTreeIter iter;

    for ( wxArrayString::const_iterator i = choices.begin();
          i != choices.end();
          ++i )
    {
        gtk_list_store_append(store, &iter);
        gtk_list_store_set(store, &iter,
                           0, (const gchar *)i->utf8_str(),
                           -1);
    }

    GtkEntryCompletion * const completion = gtk_entry_completion_new();
    gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(store));
    gtk_entry_completion_set_text_column(completion, 0);
    gtk_entry_set_completion(entry, completion);
    g_object_unref(completion);
    return true;
}
开发者ID:CodeTickler,项目名称:wxWidgets,代码行数:25,代码来源:textentry.cpp



注:本文中的GTK_IS_ENTRY函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_IS_MENU函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_IS_EDITABLE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap