From: Yasushi Shoji <yashi / yashi.com>
Subject: [ruby-ext:00574] Gtk: nil label for Notebook#append_page
Date: Sat, 27 Nov 1999 11:22:31 -0500

> とりあえず、append_pageだけ流します。label == nilで defaultにする方を採
> 用するなら、他の functionの patchも作ります。

とか、書きながら、書いてしまったので流すだけ流します。
--
         yashi

Index: rbgtknotebook.c =================================================================== RCS file: /home/cvsroot/ruby/ext/gtk/src/rbgtknotebook.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 rbgtknotebook.c --- rbgtknotebook.c 1999/11/17 15:14:23 1.1.1.1 +++ rbgtknotebook.c 1999/11/27 16:51:25 @@ -15,9 +15,14 @@ note_append_page(self, child, label) VALUE self, child, label; { + GtkWidget *glabel = NULL; + + if (!NIL_P(label)) + glabel = get_widget(label); + gtk_notebook_append_page(GTK_NOTEBOOK(get_widget(self)), get_widget(child), - get_widget(label)); + glabel); return self; } @@ -25,10 +30,17 @@ note_append_page_menu(self, child, tab_label, menu_label) VALUE self, child, tab_label, menu_label; { + GtkWidget *gtab_label, *gmenu_label = NULL; + + if (!NIL_P(tab_label)) + gtab_label = get_widget(tab_label); + if (!NIL_P(menu_label)) + gmenu_label = get_widget(menu_label); + gtk_notebook_append_page_menu(GTK_NOTEBOOK(get_widget(self)), get_widget(child), - get_widget(tab_label), - get_widget(menu_label)); + gtab_label, + gmenu_label); return self; } @@ -36,9 +48,14 @@ note_prepend_page(self, child, label) VALUE self, child, label; { + GtkWidget *glabel = NULL; + + if (!NIL_P(label)) + glabel = get_widget(label); + gtk_notebook_prepend_page(GTK_NOTEBOOK(get_widget(self)), get_widget(child), - get_widget(label)); + glabel); return self; } @@ -46,10 +63,17 @@ note_prepend_page_menu(self, child, tab_label, menu_label) VALUE self, child, tab_label, menu_label; { + GtkWidget *gtab_label, *gmenu_label = NULL; + + if (!NIL_P(tab_label)) + gtab_label = get_widget(tab_label); + if (!NIL_P(menu_label)) + gmenu_label = get_widget(menu_label); + gtk_notebook_prepend_page_menu(GTK_NOTEBOOK(get_widget(self)), get_widget(child), - get_widget(tab_label), - get_widget(menu_label)); + gtab_label, + gmenu_label); return self; } @@ -57,9 +81,14 @@ note_insert_page(self, child, label, pos) VALUE self, child, label, pos; { + GtkWidget *glabel = NULL; + + if (!NIL_P(label)) + glabel = get_widget(label); + gtk_notebook_insert_page(GTK_NOTEBOOK(get_widget(self)), get_widget(child), - get_widget(label), + glabel, NUM2INT(pos)); return self; } @@ -68,10 +97,17 @@ note_insert_page_menu(self, child, tab_label, menu_label, pos) VALUE self, child, tab_label, menu_label, pos; { + GtkWidget *gtab_label, *gmenu_label = NULL; + + if (!NIL_P(tab_label)) + gtab_label = get_widget(tab_label); + if (!NIL_P(menu_label)) + gmenu_label = get_widget(menu_label); + gtk_notebook_insert_page_menu(GTK_NOTEBOOK(get_widget(self)), get_widget(child), - get_widget(tab_label), - get_widget(menu_label), + gtab_label, + gmenu_label, NUM2INT(pos)); return self; } @@ -308,9 +344,14 @@ note_set_menu_label(self, child, label) VALUE self, child, label; { + GtkWidget *glabel = NULL; + + if (!NIL_P(label)) + glabel = get_widget(label); + gtk_notebook_set_menu_label(GTK_NOTEBOOK(get_widget(self)), get_widget(child), - get_widget(label)); + glabel); return self; } @@ -337,9 +378,14 @@ note_set_tab_label(self, child, label) VALUE self, child, label; { + GtkWidget *glabel; + + if (NIL_P(label)) + glabel = get_widget(label); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(get_widget(self)), get_widget(child), - get_widget(label)); + glabel); return self; }