Add midori_browser_get_nth_tab to obtain a particular tab by index

This commit is contained in:
Christian Dywan 2009-07-28 22:55:34 +02:00
parent 60d3def11c
commit 37b715e571
2 changed files with 26 additions and 0 deletions

View file

@ -6067,6 +6067,28 @@ midori_browser_get_current_page (MidoriBrowser* browser)
return gtk_notebook_get_current_page (GTK_NOTEBOOK (browser->notebook)); return gtk_notebook_get_current_page (GTK_NOTEBOOK (browser->notebook));
} }
/**
* midori_browser_get_nth_tab:
* @browser: a #MidoriBrowser
* @page: the index of a tab
*
* Retrieves the tab at the position @page.
*
* If there is no page present at all, %NULL is returned.
*
* Return value: the selected page, or -1
*
* Since: 0.1.9
**/
GtkWidget*
midori_browser_get_nth_tab (MidoriBrowser* browser,
gint page)
{
g_return_val_if_fail (MIDORI_IS_BROWSER (browser), NULL);
return gtk_notebook_get_nth_page (GTK_NOTEBOOK (browser->notebook), page);
}
/** /**
* midori_browser_set_current_tab: * midori_browser_set_current_tab:
* @browser: a #MidoriBrowser * @browser: a #MidoriBrowser

View file

@ -122,6 +122,10 @@ midori_browser_set_current_page (MidoriBrowser* browser,
gint gint
midori_browser_get_current_page (MidoriBrowser* browser); midori_browser_get_current_page (MidoriBrowser* browser);
GtkWidget*
midori_browser_get_nth_tab (MidoriBrowser* browser,
gint n);
void void
midori_browser_set_current_tab (MidoriBrowser* browser, midori_browser_set_current_tab (MidoriBrowser* browser,
GtkWidget* widget); GtkWidget* widget);