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

C++ GTK_ICON_VIEW函数代码示例

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

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



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

示例1: ok_button_clicked_cb

static void
ok_button_clicked_cb (GtkWidget  *widget,
		      DialogData *data)
{
	GList *list;

	list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (data->icon_view));
	if (list != NULL) {
		GtkTreePath  *path;
		GtkTreeModel *model;
		GtkTreeIter   iter;

		path = list->data;
		model = gtk_icon_view_get_model (GTK_ICON_VIEW (data->icon_view));
		if (gtk_tree_model_get_iter (model, &iter, path)) {
			GdkPixbuf *image;

			gtk_tree_model_get (model, &iter, IMAGE_COLUMN, &image, -1);
			goo_window_set_cover_image_from_pixbuf (data->window, image);

			g_object_unref (image);
		}

		g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
		g_list_free (list);
	}
}
开发者ID:tjanez,项目名称:goobox,代码行数:27,代码来源:dlg-cover-chooser.c


示例2: wp_button_press_cb

static gboolean
wp_button_press_cb (GtkWidget      *widget,
                    GdkEventButton *event,
                    AppearanceData *data)
{
  GtkCellRenderer *cell;
  GdkEventButton *button_event = (GdkEventButton *) event;

  if (event->type != GDK_BUTTON_PRESS)
    return FALSE;

  if (gtk_icon_view_get_item_at_pos (GTK_ICON_VIEW (widget),
                                     button_event->x, button_event->y,
                                     NULL, &cell)) {
    if (g_object_get_data (G_OBJECT (cell), "buttons")) {
      gint w, h;
      GtkCellRenderer *cell2 = NULL;
      gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
      if (gtk_icon_view_get_item_at_pos (GTK_ICON_VIEW (widget),
                                         button_event->x + w, button_event->y,
                                         NULL, &cell2) && cell == cell2)
        next_frame (data, cell, -1);
      else
        next_frame (data, cell, 1);
      return TRUE;
    }
  }

  return FALSE;
}
开发者ID:kottroll,项目名称:mate-control-center,代码行数:30,代码来源:appearance-desktop.c


示例3: gsb_select_icon_selection_changed

/**
 * callback pour traiter les changements de sélection dans le GtkIconView
 *
 * \param le GtkIconView appellant
 *
 * \return
 *
 * */
void gsb_select_icon_selection_changed ( GtkIconView *icon_view,
                                         gpointer user_data )
{
    GList * liste;
    GtkTreePath *path;
    GtkTreeModel *model;
    GtkTreeIter iter;
    gchar *name_icon = NULL;

    liste = gtk_icon_view_get_selected_items ( GTK_ICON_VIEW ( icon_view ) );

    /* Could happen if selection is unset, exiting then. */
    if ( ! liste )
	return;

    path = liste -> data;

    model = gtk_icon_view_get_model ( GTK_ICON_VIEW ( icon_view ) );
    if (gtk_tree_model_get_iter ( GTK_TREE_MODEL (model), &iter, path ))
        gtk_tree_model_get (model, &iter, TEXT_COLUMN, &name_icon, -1);
    name_icon = my_strdelimit ( name_icon, "\n", "" );
    devel_debug ( name_icon );
    if ( name_icon && strlen ( name_icon ) > 0 )
    {
        new_icon = g_strconcat ( path_icon, G_DIR_SEPARATOR_S,
                                 name_icon, NULL );
        gtk_entry_set_text ( GTK_ENTRY (GTK_BIN (entry_text)->child ),
                                 new_icon );
        gtk_widget_set_sensitive (bouton_OK, TRUE );
    }
}
开发者ID:wazari972,项目名称:Grisbi,代码行数:39,代码来源:gsb_select_icon.c


示例4: hcp_app_view_set_n_columns

static void
hcp_app_view_set_n_columns  (GtkWidget      *widget,
                             gpointer        data)
{
    gint n_columns;
/* 4px is the HCP_GRID_X_PADDING */
#define PORTRAIT_WIDTH   480      - 3 * HILDON_MARGIN_DOUBLE
#define LANDSCAPE_WIDTH (800 / 2) - 2 * HILDON_MARGIN_DOUBLE

    if (! HCP_IS_GRID (widget))
        return;

    n_columns = GPOINTER_TO_INT (data);

/*
 * g_debug ("WIDTH = %d", (n_columns == 1) ? PORTRAIT_WIDTH : LANDSCAPE_WIDTH);
 */

    /* grid view, set proper no. of colunms */
    gtk_icon_view_set_columns (GTK_ICON_VIEW (widget), n_columns);
    gtk_icon_view_set_item_width (GTK_ICON_VIEW (widget),
                                  (n_columns == 1) ? 
                                   PORTRAIT_WIDTH : 
                                   LANDSCAPE_WIDTH);
    hcp_grid_refresh_icons (HCP_GRID (widget));
}
开发者ID:android-808,项目名称:hildon-control-panel,代码行数:26,代码来源:hcp-app-view.c


示例5: mud_connections_show_icon_dialog

// Iconview Dialog
static void
mud_connections_show_icon_dialog(MudConnections *conn)
{
    GladeXML *glade;
    gint result;

    glade = glade_xml_new(GLADEDIR "/muds.glade", "iconselect", NULL);
    conn->priv->icon_dialog = glade_xml_get_widget(glade, "iconselect");
    conn->priv->icon_dialog_view = glade_xml_get_widget(glade, "view");
    conn->priv->icon_dialog_chooser =
	glade_xml_get_widget(glade, "chooser");
    g_object_unref(glade);

    conn->priv->icon_dialog_view_model =
	GTK_TREE_MODEL(gtk_list_store_new(MODEL_COLUMN_N,
					  G_TYPE_STRING,
					  GDK_TYPE_PIXBUF));

    gtk_icon_view_set_model(GTK_ICON_VIEW(conn->priv->icon_dialog_view),
			    conn->priv->icon_dialog_view_model);
    gtk_icon_view_set_text_column(
	GTK_ICON_VIEW(conn->priv->icon_dialog_view),
	MODEL_COLUMN_STRING);
    gtk_icon_view_set_pixbuf_column(
	GTK_ICON_VIEW(conn->priv->icon_dialog_view),
	MODEL_COLUMN_PIXBUF);

    if(conn->priv->icon_current != NULL)
	g_free(conn->priv->icon_current);
    conn->priv->icon_current = NULL;

    g_signal_connect(
	conn->priv->icon_dialog_chooser, "current-folder-changed",
		     G_CALLBACK(mud_connections_icon_fileset_cb),
		     conn);
    g_signal_connect(conn->priv->icon_dialog_view, "selection-changed",
		     G_CALLBACK(mud_connections_icon_select_cb),
		     conn);

    g_object_set(conn->priv->icon_dialog_view, "item-width", 64, NULL);
    gtk_file_chooser_set_current_folder(
	GTK_FILE_CHOOSER(conn->priv->icon_dialog_chooser),
	"/usr/share/icons");

    result = gtk_dialog_run(GTK_DIALOG(conn->priv->icon_dialog));
    gtk_widget_destroy(conn->priv->icon_dialog);

    if(result == GTK_RESPONSE_OK)
    {
	if(conn->priv->icon_current == NULL)
	    return;

	GdkPixbuf *icon = gdk_pixbuf_new_from_file_at_size(
	    conn->priv->icon_current, 48, 48, NULL);
	gtk_image_set_from_pixbuf(GTK_IMAGE(conn->priv->icon_image),
				  icon);
	g_object_unref(icon);
    }
}
开发者ID:ghoulsblade,项目名称:gnome-mud,代码行数:60,代码来源:mud-connections.c


示例6: load_themes

static void
load_themes (DialogData *data)
{
	GFile        *style_dir;
	GFile        *data_dir;
	char         *default_theme;
	GtkTreeModel *model;
	GtkTreeIter   iter;

	/* local themes */

	style_dir = gth_user_dir_get_file_for_read (GTH_DIR_DATA, PIX_DIR, "albumthemes", NULL);
	add_themes_from_dir (data, style_dir);
	g_object_unref (style_dir);

	/* system themes */

	data_dir = g_file_new_for_path (WEBALBUM_DATADIR);
	style_dir = _g_file_get_child (data_dir, "albumthemes", NULL);
	add_themes_from_dir (data, style_dir);
	g_object_unref (style_dir);
	g_object_unref (data_dir);

	/**/

	gtk_widget_set_size_request (GET_WIDGET ("theme_iconview"), (150 * 3), 140);
	gtk_widget_realize (GET_WIDGET ("theme_iconview"));

	default_theme = g_settings_get_string (data->settings, PREF_WEBALBUMS_THEME);

	model = GTK_TREE_MODEL (GET_WIDGET ("theme_liststore"));
	if (gtk_tree_model_get_iter_first (model, &iter)) {
		do {
			char *name;

			gtk_tree_model_get(model, &iter, THEME_COLUMN_ID, &name, -1);

			if (g_strcmp0 (name, default_theme) == 0) {
				GtkTreePath *path;

				path = gtk_tree_model_get_path (model, &iter);
				gtk_icon_view_select_path (GTK_ICON_VIEW (GET_WIDGET ("theme_iconview")), path);
				gtk_icon_view_scroll_to_path (GTK_ICON_VIEW (GET_WIDGET ("theme_iconview")), path, TRUE, 0.5, 0.5);

				gtk_tree_path_free (path);
				g_free (name);
				break;
			}

			g_free (name);
		}
		while (gtk_tree_model_iter_next (model, &iter));
	}

	g_free (default_theme);
}
开发者ID:linuxmint,项目名称:pix,代码行数:56,代码来源:dlg-web-exporter.c


示例7: addGroup

	void addGroup (const gchar *name, const gchar *icon_path,
	               const gchar *nick, const gchar *sort_key)
	{
		// calculate position
		int pos;
		{
			std::list <std::string>::iterator it;
			for (it = sort_keys.begin(), pos = 0; it != sort_keys.end(); it++, pos++)
				if (strcmp (it->c_str(), sort_key) >= 0)
					break;
			sort_keys.insert (it, sort_key);
		}

		// label widget
		GtkWidget *tab_label, *image, *label;

		GdkPixbuf *icon = NULL;
		if (icon_path) {
			GError *error = 0;
			std::string path = ICONS + std::string (icon_path) + ".png";
			icon = gdk_pixbuf_new_from_file (path.c_str(), &error);
			if (!icon)
				g_warning ("Could not load icon: %s.\nReason: %s", icon_path, error->message);
		}

		tab_label = gtk_hbox_new (FALSE, 0);
		label = gtk_label_new (name);
		if (icon)
			image = gtk_image_new_from_pixbuf (icon);

		if (icon)
			gtk_box_pack_start (GTK_BOX (tab_label), image, FALSE, FALSE, 0);
		gtk_box_pack_start (GTK_BOX (tab_label), label, TRUE, TRUE, icon ? 6 : 0);

		// page widget
		GtkListStore *store = gtk_list_store_new (3, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING);
		m_stores [nick] = store;

		GtkWidget *icons_view;
		icons_view = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store));
		gtk_icon_view_set_text_column   (GTK_ICON_VIEW (icons_view), 0);
		gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (icons_view), 1);
		g_signal_connect(G_OBJECT (icons_view), "item-activated",
		                 G_CALLBACK (executeCommand), this);

		GtkWidget *page;
		page = gtk_scrolled_window_new (NULL, NULL);
		gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (page),
			GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
		gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (page), GTK_SHADOW_IN);
		gtk_container_add (GTK_CONTAINER (page), icons_view);

		// add those to the notebook
		gtk_widget_show_all (tab_label);
		gtk_notebook_insert_page_menu (GTK_NOTEBOOK (m_widget), page, tab_label, NULL, pos);
	}
开发者ID:anaselli,项目名称:libyui-gtk,代码行数:56,代码来源:ycc.cpp


示例8: fcitx_main_window_init

static void
fcitx_main_window_init(FcitxMainWindow* self)
{
    GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
    GtkWidget* hbox = gtk_hbox_new(FALSE, 0);

    self->pagestore = _fcitx_main_window_create_model();
    self->pageview = gtk_icon_view_new_with_model(GTK_TREE_MODEL(self->pagestore));

    gtk_icon_view_set_pixbuf_column(GTK_ICON_VIEW(self->pageview), PAGE_LIST_ICON);
    gtk_icon_view_set_text_column(GTK_ICON_VIEW(self->pageview), PAGE_LIST_NAME);
#if GTK_CHECK_VERSION(2, 22, 0)
    gtk_icon_view_set_item_orientation(GTK_ICON_VIEW(self->pageview), GTK_ORIENTATION_VERTICAL);
#endif

    _fcitx_main_window_add_im_page(self);
    _fcitx_main_window_add_config_file_page(self);
    _fcitx_main_window_add_addon_page(self);

    gtk_widget_set_size_request(GTK_WIDGET(self), -1, 500);

    self->vbox = gtk_vbox_new(FALSE, 0);
    self->pagelabel = gtk_label_new("");
    gtk_label_set_use_markup(GTK_LABEL(self->pagelabel), true);
    gtk_misc_set_alignment(GTK_MISC(self->pagelabel), 0, 0.5);

    gtk_box_pack_start(GTK_BOX(self->vbox), self->pagelabel, FALSE, FALSE, 14);
    GtkWidget* scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_NEVER);
    gtk_container_add(GTK_CONTAINER(scrolledwindow), self->pageview);
    gtk_box_pack_start(GTK_BOX(hbox), scrolledwindow, FALSE, TRUE, 4);
    gtk_box_pack_start(GTK_BOX(hbox), self->vbox, TRUE, TRUE, 8);
    gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 8);

    gtk_container_add(GTK_CONTAINER(self), vbox);

    gtk_icon_view_set_selection_mode(GTK_ICON_VIEW(self->pageview), GTK_SELECTION_SINGLE);
    gtk_icon_view_set_item_padding(GTK_ICON_VIEW(self->pageview), 0);
    gtk_icon_view_set_margin(GTK_ICON_VIEW(self->pageview), 0);
    gtk_icon_view_set_column_spacing(GTK_ICON_VIEW(self->pageview), 0);
    gtk_icon_view_set_row_spacing(GTK_ICON_VIEW(self->pageview), 0);
    gtk_icon_view_set_item_width(GTK_ICON_VIEW(self->pageview), 96);

    g_signal_connect_swapped(G_OBJECT(self), "destroy", G_CALLBACK(gtk_main_quit), NULL);
    g_signal_connect(G_OBJECT(self->pageview), "selection-changed",
                     G_CALLBACK(_fcitx_main_window_selection_changed_cb), self);

    GtkTreePath* path = gtk_tree_model_get_path(GTK_TREE_MODEL(self->pagestore), &self->impage->iter);
    gtk_icon_view_select_path(GTK_ICON_VIEW(self->pageview), path);
    gtk_tree_path_free(path);

    gtk_window_set_icon_name(GTK_WINDOW(self), "fcitx-configtool");
    gtk_window_set_title(GTK_WINDOW(self), _("Fcitx Config"));
}
开发者ID:niubenben,项目名称:fcitx.fcitx-config,代码行数:54,代码来源:main_window.c


示例9: cheese_thumb_view_constructed

static void
cheese_thumb_view_constructed (GObject *object)
{
  CheeseThumbView *thumb_view = CHEESE_THUMB_VIEW (object);
  CheeseThumbViewPrivate *priv = cheese_thumb_view_get_instance_private (thumb_view);
  
  G_OBJECT_CLASS (cheese_thumb_view_parent_class)->constructed (object);

  gtk_icon_view_set_model (GTK_ICON_VIEW (thumb_view), GTK_TREE_MODEL (priv->store));

  gtk_widget_set_size_request (GTK_WIDGET (thumb_view),
                               THUMB_VIEW_MINIMUM_WIDTH,
                               THUMB_VIEW_MINIMUM_HEIGHT);

  gtk_icon_view_set_margin (GTK_ICON_VIEW (thumb_view), 0);
  gtk_icon_view_set_row_spacing (GTK_ICON_VIEW (thumb_view), 0);
  gtk_icon_view_set_column_spacing (GTK_ICON_VIEW (thumb_view), 0);

  gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (thumb_view), 0);

  gtk_icon_view_set_columns (GTK_ICON_VIEW (thumb_view), -1);

  gtk_icon_view_enable_model_drag_source (GTK_ICON_VIEW (thumb_view), GDK_BUTTON1_MASK,
                                          target_table, G_N_ELEMENTS (target_table),
                                          GDK_ACTION_COPY);
  gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (thumb_view), GTK_SELECTION_MULTIPLE);

  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (priv->store),
                                        THUMBNAIL_BASENAME_URL_COLUMN, GTK_SORT_ASCENDING);
                                        
  cheese_thumb_view_fill (thumb_view);
  cheese_thumb_view_set_vertical (thumb_view, FALSE);
}
开发者ID:Cobra-Kao,项目名称:ropon,代码行数:33,代码来源:cheese-thumb-view.c


示例10: gsb_select_icon_create_icon_view

/**
 * Crée le GtkIconView
 *
 * \param nom de l'icône
 *
 * \return le GtkIconView rempli avec l'icône sélectionnée au premier plan
 *
 * */
GtkWidget * gsb_select_icon_create_icon_view ( gchar * name_icon )
{
    GtkTreePath * tree_path;

    /* construct the GtkIconView */
    icon_view = gtk_icon_view_new ();
    gtk_icon_view_set_margin ( GTK_ICON_VIEW ( icon_view ), 0 );
    gtk_icon_view_set_spacing (GTK_ICON_VIEW ( icon_view ), 0 );
    gtk_icon_view_set_selection_mode (GTK_ICON_VIEW ( icon_view ),
                            GTK_SELECTION_SINGLE );
    gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW ( icon_view ), PIXBUF_COLUMN);
    gtk_icon_view_set_text_column (GTK_ICON_VIEW ( icon_view ), TEXT_COLUMN);


    /* remplissage et positionnement initial du curseur dans le GtkIconView */
    tree_path = gsb_select_icon_fill_icon_view ( name_icon );

    gtk_icon_view_select_path ( GTK_ICON_VIEW ( icon_view ), tree_path );
    gtk_icon_view_set_cursor (GTK_ICON_VIEW ( icon_view ), tree_path,
                            NULL, TRUE);
    gtk_icon_view_scroll_to_path (GTK_ICON_VIEW ( icon_view ),
                            tree_path, TRUE, 0.5, 0 );

    return icon_view;
}
开发者ID:wazari972,项目名称:Grisbi,代码行数:33,代码来源:gsb_select_icon.c


示例11: cheese_thumb_view_set_vertical

void
cheese_thumb_view_set_vertical (CheeseThumbView *thumb_view, gboolean vertical)
{
  CheeseThumbViewPrivate *priv = cheese_thumb_view_get_instance_private (thumb_view);

  priv->vertical = vertical;
  if (!priv->vertical && priv->n_items)
    gtk_icon_view_set_columns(GTK_ICON_VIEW (thumb_view), priv->n_items);
  else
    gtk_icon_view_set_columns(GTK_ICON_VIEW (thumb_view), 1);

  gtk_widget_set_hexpand (GTK_WIDGET (thumb_view), !vertical);
  gtk_widget_set_vexpand (GTK_WIDGET (thumb_view), vertical);
}
开发者ID:Cobra-Kao,项目名称:ropon,代码行数:14,代码来源:cheese-thumb-view.c


示例12: gtk_icon_view_item_accessible_get_image_position

static void
gtk_icon_view_item_accessible_get_image_position (AtkImage    *image,
                                                  gint        *x,
                                                  gint        *y,
                                                  AtkCoordType coord_type)
{
  GtkIconViewItemAccessible *item;
  GdkRectangle box;

  item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);

  if (!GTK_IS_ICON_VIEW (item->widget))
    return;

  if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
    return;

  atk_component_get_position (ATK_COMPONENT (image), x, y, coord_type);

  if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
    {
      *x+= box.x - item->item->cell_area.x;
      *y+= box.y - item->item->cell_area.y;
    }

}
开发者ID:Pfiver,项目名称:gtk,代码行数:26,代码来源:gtkiconviewaccessible.c


示例13: gtk_icon_view_item_accessible_get_image_size

static void
gtk_icon_view_item_accessible_get_image_size (AtkImage *image,
                                              gint     *width,
                                              gint     *height)
{
  GtkIconViewItemAccessible *item;
  GdkRectangle box;

  item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);

  if (!GTK_IS_ICON_VIEW (item->widget))
    return;

  if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
    return;

  *width = 0;
  *height = 0;

  if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
    {
      *width = box.width;
      *height = box.height;
    }
}
开发者ID:Pfiver,项目名称:gtk,代码行数:25,代码来源:gtkiconviewaccessible.c


示例14: gtk_icon_view_accessible_remove_selection

static gboolean
gtk_icon_view_accessible_remove_selection (AtkSelection *selection,
                                           gint          i)
{
  GtkWidget *widget;
  GtkIconView *icon_view;
  GtkIconViewItem *item;
  GList *l;
  gint count;

  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
  if (widget == NULL)
    return FALSE;

  icon_view = GTK_ICON_VIEW (widget);
  l = icon_view->priv->items;
  count = 0;
  while (l)
    {
      item = l->data;
      if (item->selected)
        {
          if (count == i)
            {
              _gtk_icon_view_unselect_item (icon_view, item);
              return TRUE;
            }
          count++;
        }
      l = l->next;
    }

  return FALSE;
}
开发者ID:Pfiver,项目名称:gtk,代码行数:34,代码来源:gtkiconviewaccessible.c


示例15: gtk_icon_view_accessible_get_selection_count

static gint
gtk_icon_view_accessible_get_selection_count (AtkSelection *selection)
{
  GtkWidget *widget;
  GtkIconView *icon_view;
  GtkIconViewItem *item;
  GList *l;
  gint count;

  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
  if (widget == NULL)
    return 0;

  icon_view = GTK_ICON_VIEW (widget);

  l = icon_view->priv->items;
  count = 0;
  while (l)
    {
      item = l->data;

      if (item->selected)
        count++;

      l = l->next;
    }

  return count;
}
开发者ID:Pfiver,项目名称:gtk,代码行数:29,代码来源:gtkiconviewaccessible.c


示例16: gtk_icon_view_accessible_ref_selection

static AtkObject*
gtk_icon_view_accessible_ref_selection (AtkSelection *selection,
                                        gint          i)
{
  GList *l;
  GtkWidget *widget;
  GtkIconView *icon_view;
  GtkIconViewItem *item;

  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
  if (widget == NULL)
    return NULL;

  icon_view = GTK_ICON_VIEW (widget);

  l = icon_view->priv->items;
  while (l)
    {
      item = l->data;
      if (item->selected)
        {
          if (i == 0)
            return atk_object_ref_accessible_child (gtk_widget_get_accessible (widget), item->index);
          else
            i--;
        }
      l = l->next;
    }

  return NULL;
}
开发者ID:Pfiver,项目名称:gtk,代码行数:31,代码来源:gtkiconviewaccessible.c


示例17: hcp_app_view_get_selected_app

static HCPApp *
hcp_app_view_get_selected_app (GtkWidget *widget, GtkTreePath *path)
{
  GtkTreeModel *model;
  HCPApp *app = NULL;
  GtkTreeIter iter;
  gint item_pos;

  g_return_val_if_fail (widget, NULL);
  g_return_val_if_fail (GTK_IS_ICON_VIEW (widget), NULL);
  g_return_val_if_fail (path, NULL);

  model = gtk_icon_view_get_model (GTK_ICON_VIEW (widget));

  if (path == NULL) return NULL;

  item_pos = gtk_tree_path_get_indices (path) [0];

  if (gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (model), 
                                     &iter, NULL, item_pos)) {
    gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 
                        HCP_STORE_APP, &app,
                        -1);
  }

  return app;
}
开发者ID:android-808,项目名称:hildon-control-panel,代码行数:27,代码来源:hcp-app-view.c


示例18: mud_connections_icon_select_cb

static void
mud_connections_icon_select_cb(GtkIconView *view, MudConnections *conn)
{
    GList *selected =
	gtk_icon_view_get_selected_items(
	    GTK_ICON_VIEW(conn->priv->icon_dialog_view));
    GtkTreeIter iter;
    gchar *buf;

    if(g_list_length(selected) == 0)
	return;

    gtk_tree_model_get_iter(conn->priv->icon_dialog_view_model,
			    &iter, (GtkTreePath *)selected->data);
    gtk_tree_model_get(conn->priv->icon_dialog_view_model,
		       &iter, 0, &buf, -1);

    if(conn->priv->icon_current != NULL)
	g_free(conn->priv->icon_current);

    conn->priv->icon_current = g_strconcat(
	gtk_file_chooser_get_current_folder(
	    GTK_FILE_CHOOSER(conn->priv->icon_dialog_chooser)),
	G_DIR_SEPARATOR_S,
	buf, NULL);

    g_free(buf);

    g_list_foreach(selected, (GFunc)gtk_tree_path_free, NULL);
    g_list_free(selected);
}
开发者ID:ghoulsblade,项目名称:gnome-mud,代码行数:31,代码来源:mud-connections.c


示例19: search_entry_key_press_event_cb

static gboolean
search_entry_key_press_event_cb (GtkEntry    *entry,
                                 GdkEventKey *event,
                                 GnomeControlCenterPrivate   *priv)
{
  if (event->keyval == GDK_KEY_Return)
    {
      GtkTreePath *path;

      path = gtk_tree_path_new_first ();

      priv->last_time = event->time;

      gtk_icon_view_item_activated (GTK_ICON_VIEW (priv->search_view), path);

      gtk_tree_path_free (path);
      return TRUE;
    }

  if (event->keyval == GDK_KEY_Escape)
    {
      gtk_entry_set_text (entry, "");
      return TRUE;
    }

  return FALSE;
}
开发者ID:tigersoldier,项目名称:gnome-control-center,代码行数:27,代码来源:gnome-control-center.c


示例20: gd_thumb_nav_constructed

static void
gd_thumb_nav_constructed (GObject *object)
{
    GdThumbNav *self = GD_THUMB_NAV (object);
    GdThumbNavPrivate *priv = self->priv;

    G_OBJECT_CLASS (gd_thumb_nav_parent_class)->constructed (object);

    if (priv->thumbview != NULL) {
        gtk_container_add (GTK_CONTAINER (priv->sw), priv->thumbview);
        gtk_widget_show_all (priv->sw);

        gtk_icon_view_set_columns (GTK_ICON_VIEW (priv->thumbview),
                                   G_MAXINT);

        gtk_widget_set_size_request (priv->thumbview, -1, -1);
        gd_sidebar_thumbnails_set_item_height (GD_SIDEBAR_THUMBNAILS (priv->thumbview),
                                               115);

        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw),
                                        GTK_POLICY_AUTOMATIC,
                                        GTK_POLICY_NEVER);
    }

    gd_thumb_nav_set_show_buttons (self, priv->show_buttons);
}
开发者ID:azzurroverde,项目名称:gnome-documents,代码行数:26,代码来源:gd-thumb-nav.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_INFO_BAR函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_HEADER_BAR函数代码示例发布时间: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