コード例 #1
0
ファイル: gnomedruid.c プロジェクト: jubalh/deadbeef
static void
gb_gnome_druid_insert_page_before (GtkWidget * menuitem,
				   GnomeDruidPage *page)
{
  GtkWidget *parent, *new_page;
  GnomeDruidPage *prev_page;
  GList *children, *elem;

  parent = GTK_WIDGET (page)->parent;
  g_return_if_fail (GNOME_IS_DRUID (parent));

  children = gtk_container_get_children (GTK_CONTAINER (parent));
  elem = g_list_find (children, page);
  g_return_if_fail (elem != NULL);

  new_page = gb_widget_new ("GnomeDruidPageStandard", parent);
  gtk_widget_show_all (new_page);

  if (elem->prev)
    prev_page = GNOME_DRUID_PAGE (elem->prev->data);
  else
    prev_page = NULL;

  g_list_free (children);

  gnome_druid_insert_page (GNOME_DRUID (parent), prev_page,
			   GNOME_DRUID_PAGE (new_page));

  gb_gnome_druid_show_page (parent, new_page);

  gnome_druid_set_page (GNOME_DRUID (parent), GNOME_DRUID_PAGE (new_page));
  tree_add_widget (GTK_WIDGET (new_page));
}
コード例 #2
0
ファイル: gnome-druid.c プロジェクト: DarkAngelII/libgnomeui
/**
 * gnome_druid_append_page:
 * @druid: A #GnomeDruid widget.
 * @page: The #GnomeDruidPage to be appended.
 *
 * Description: This will append @page onto the end of the internal list.
 * Since #GnomeDruid is just a container, you will need to also call
 * gtk_widget_show() on the page, otherwise the page will not be shown.
 **/
void
gnome_druid_append_page (GnomeDruid *druid,
			 GnomeDruidPage *page)
{
	GList *list;
	g_return_if_fail (druid != NULL);
	g_return_if_fail (GNOME_IS_DRUID (druid));
	g_return_if_fail (page != NULL);
	g_return_if_fail (GNOME_IS_DRUID_PAGE (page));

	list = g_list_last (druid->_priv->children);
	if (list) {
		gnome_druid_insert_page (druid, GNOME_DRUID_PAGE (list->data), page);
	} else {
		gnome_druid_insert_page (druid, NULL, page);
	}
}
コード例 #3
0
ファイル: gnome-druid.c プロジェクト: DarkAngelII/libgnomeui
/**
 * gnome_druid_prepend_page:
 * @druid: A Druid widget.
 * @page: The page to be inserted.
 *
 * Description: This will prepend a GnomeDruidPage into the internal list of
 * pages that the @druid has. Since #GnomeDruid is just a container, you will
 * need to also call gtk_widget_show() on the page, otherwise the page will not
 * be shown.
 **/
void
gnome_druid_prepend_page (GnomeDruid *druid,
			  GnomeDruidPage *page)
{
	g_return_if_fail (druid != NULL);
	g_return_if_fail (GNOME_IS_DRUID (druid));
	g_return_if_fail (page != NULL);
	g_return_if_fail (GNOME_IS_DRUID_PAGE (page));

	gnome_druid_insert_page (druid, NULL, page);
}
コード例 #4
0
ファイル: gnomedruid.c プロジェクト: jubalh/deadbeef
static void
gb_gnome_druid_insert_page_after (GtkWidget * menuitem,
				  GnomeDruidPage *page)
{
  GtkWidget *parent, *new_page;

  parent = GTK_WIDGET (page)->parent;
  g_return_if_fail (GNOME_IS_DRUID (parent));

  new_page = gb_widget_new ("GnomeDruidPageStandard", parent);
  gtk_widget_show_all (new_page);

  gnome_druid_insert_page (GNOME_DRUID (parent),
			   GNOME_DRUID_PAGE (page),
			   GNOME_DRUID_PAGE (new_page));

  gb_gnome_druid_show_page (parent, new_page);

  gnome_druid_set_page (GNOME_DRUID (parent), GNOME_DRUID_PAGE (new_page));
  tree_add_widget (GTK_WIDGET (new_page));
}