multiple GTKentry inside a GTKnotebook

2012-06-18 Thread Rudra Banerjee
Friends,
pasted is a minimal layout of my trial to create a bibliography maker.
The problem is, in Authors tab inside notebook, I want to edit 3 more
entry, as Editor an example. But its taking only the first entry.
Please show me where I am making the error.
(NB. I am neither a C programmer nor GTK. I am creating this via reading
various tutorials. So please don't get too irritated)

#include gtk/gtk.h
#include stdio.h
#include string.h
#include gdk/gdk.h
GtkWidget *window;
GtkWidget *vbox, *hbox, *combo;
GtkWidget *entry1;
GtkWidget *entryAuth;
GtkWidget *entryEdit;

GtkWidget *window;

#include menubar.c

int main(int argc,
char *argv[]) {
GtkWidget *window;
GtkWidget *button;
GtkWidget *table;
GtkWidget *frame;
GtkWidget *notebook;
GtkWidget *label;
GtkWidget *checkbutton;
int i;
char bufferf[32];
char bufferl[32];

gtk_init(argc, argv);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), BibMk);
gtk_container_set_border_width(GTK_CONTAINER(window), 20);
g_signal_connect(window, delete-event,
G_CALLBACK(gtk_main_quit), NULL);



vbox = gtk_vbox_new(FALSE, 0);
hbox = gtk_hbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(window), hbox);
gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
frame = gtk_frame_new(Properties);


combo = gtk_combo_box_new_text();
gtk_combo_box_append_text(GTK_COMBO_BOX(combo), Book);
gtk_combo_box_append_text(GTK_COMBO_BOX(combo), Article);
gtk_box_pack_start(GTK_BOX(vbox), combo, TRUE, TRUE, 0);
gtk_widget_show(combo);


entry1 = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry1), bibKey);
gtk_box_pack_start(GTK_BOX(hbox), entry1, TRUE, TRUE, 0);
gtk_widget_show(entry1);


/*
* CREATE THE NOTEBOOK PAN
*/

table = gtk_table_new(3,6,FALSE);

/* Create a new notebook, place the position of the tabs */
notebook = gtk_notebook_new ();
gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP);
gtk_table_attach_defaults(GTK_TABLE(table), notebook, 0,6,0,1);
gtk_widget_show(notebook);


/*
* CREATE BASIC NOTEBOOK
*/
/*
 * Authors Tab
 */
frame = gtk_frame_new (Authors);
gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
gtk_widget_set_usize (frame, 400, 175);

entryAuth = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entryAuth), Author);
gtk_container_add (GTK_CONTAINER (frame), entryAuth);
gtk_widget_show (entryAuth);


entryAuth = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entryEdit), Editor);
gtk_container_add (GTK_CONTAINER (frame), entryEdit);
gtk_widget_show (entryEdit);

label = gtk_label_new (Authors/Title);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame,
label);


gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);

gtk_widget_show(table);
gtk_widget_show_all(window);
gtk_main();
return 0;
}


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: multiple GTKentry inside a GTKnotebook

2012-06-18 Thread David Nečas
On Mon, Jun 18, 2012 at 11:28:48PM +0530, Rudra Banerjee wrote:
 pasted is a minimal layout of my trial to create a bibliography maker.
 The problem is, in Authors tab inside notebook, I want to edit 3 more
 entry, as Editor an example. But its taking only the first entry.
 Please show me where I am making the error.

GtkFrame is a GtkBin which means it can contain a single widget.  If you
want more you need to use packing container (GtkTable, GtkVBox, GtkGrid,
...), put it to the frame and then pack widgets to this contaner.

Yeti


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list