Re: multiple GTKentry inside a GTKnotebook
Mariano, Thanks for your help. But this is not what I am looking for. What I want is I will choose the combobox entry and fill up the entry box data manually. Then if I click ok button, it will append an external file with those data. Please see the quoted reply I made in this thread to your previous reply. Hope, I have cleared my intention. By this code, what I want to achieve is that: After choosing book/loco/lardon etc as done by you, this will print the active_data in combobox and Entries in a file. So, if the combo entry is Book and entryAuth is MyAuthor entryEditor is MyEditor entryTitle is MyTitle and bibkey is Mybib then according to file selected(new/old) it will write there @book{MyBib Author=MyAuthor Title=MyTitle } ofcourse the formatting can be done later. My current problem in hand is to get those text like Book, MyAuthor, Mybib etc as a variable to use. I googled and found some example but not working. Last but not the least, thanks Mariano for exporting it to GTK3. its really looks nice. On Sun, 2012-06-24 at 01:15 -0300, Mariano Gaudix wrote: Rudra can see the example . I uploaded a new code .downloads in .. MEDIAFIRE .. http://www.mediafire.com/?4l8qo1wtk35dcqb Rudra , let me know if you will download , the example. 2012/6/24 Rudra Banerjee bnrj.ru...@yahoo.com Friends, Plz show me how to do that. On Mon, 2012-06-18 at 23:28 +0530, Rudra Banerjee wrote: 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);
Re: multiple GTKentry inside a GTKnotebook
Friends, Plz show me how to do that. On Mon, 2012-06-18 at 23:28 +0530, Rudra Banerjee wrote: 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 ___ 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
Rudra can see the example . I uploaded a new code .downloads in .. MEDIAFIRE .. http://www.mediafire.com/?4l8qo1wtk35dcqb Rudra , let me know if you will download , the example. 2012/6/24 Rudra Banerjee bnrj.ru...@yahoo.com Friends, Plz show me how to do that. On Mon, 2012-06-18 at 23:28 +0530, Rudra Banerjee wrote: 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 ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ 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
How is the program you want to do? Can you explain? 2012/6/21 Rudra Banerjee bnrj.ru...@yahoo.com Thanks, but its not solving the main problem. / 2012/6/20 Rudra Banerjee bnrj.ru...@yahoo.com Olivier, Thanks for your interest. Pasted just below is the complete code. What I want to do with that is, as a raw commented snip by line number 106-116 that according to my selection of Book/Article in combobox, some entry will be hidden. But, for that, I need to get the data from the combo box, which I have tried in line number 53-54. Please help. NB. Olivier, I got your reply in CC as well as a group post. So, I am replying you also(reply to all). Please don't get offended if it was not your intention. /***THE CODE/ #include gtk/gtk.h #include stdio.h #include string.h #include gdk/gdk.h GtkWidget *window; GtkWidget *vbox, *hbox, *combo; GtkWidget *vbox1, *hbox1, *combo1; GtkWidget *entry1; GtkWidget *entryAuth; GtkWidget *entryEditor; GtkWidget *entryTitle; GtkWidget *window; int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *table; GtkWidget *frame; GtkWidget *notebook; GtkWidget *label; GtkWidget *checkbutton; GtkWidget *widget; int i; char bufferf[32]; char bufferl[32]; //char bibtype; 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); //gtk_window_set_default_size(GTK_WINDOW(window), 200, 150); 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_text_new(); 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); gchar *bibtype = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo)); printf(%s, gtk_combo_box_get_active_text(GTK_COMBO_BOX(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_widget_set_usize(frame, 400, 175); vbox1 = gtk_vbox_new(FALSE, 0); hbox1 = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox1); entryAuth = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryAuth), Author); gtk_container_add (GTK_CONTAINER (vbox1), entryAuth); gtk_widget_show(entryAuth); entryEditor = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryEditor), Editor); gtk_container_add (GTK_CONTAINER (vbox1), entryEditor); gtk_widget_show(entryEditor); entryTitle = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryTitle), Title); gtk_container_add (GTK_CONTAINER (vbox1), entryTitle); gtk_widget_show(entryTitle); label = gtk_label_new(Authors/Title); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label); /*switch (bibtype) { case book:
Re: multiple GTKentry inside a GTKnotebook
By this code, what I want to achieve is that: After choosing book/loco/lardon etc as done by you, this will print the active_data in combobox and Entries in a file. So, if the combo entry is Book and entryAuth is MyAuthor entryEditor is MyEditor entryTitle is MyTitle and bibkey is Mybib then according to file selected(new/old) it will write there @book{MyBib Author=MyAuthor Title=MyTitle } ofcourse the formatting can be done later. My current problem in hand is to get those text like Book, MyAuthor, Mybib etc as a variable to use. I googled and found some example but not working. Last but not the least, thanks Mariano for exporting it to GTK3. its really looks nice. On Thu, 2012-06-21 at 11:03 -0300, Mariano Gaudix wrote: How is the program you want to do? Can you explain? 2012/6/21 Rudra Banerjee bnrj.ru...@yahoo.com Thanks, but its not solving the main problem. / 2012/6/20 Rudra Banerjee bnrj.ru...@yahoo.com Olivier, Thanks for your interest. Pasted just below is the complete code. What I want to do with that is, as a raw commented snip by line number 106-116 that according to my selection of Book/Article in combobox, some entry will be hidden. But, for that, I need to get the data from the combo box, which I have tried in line number 53-54. Please help. NB. Olivier, I got your reply in CC as well as a group post. So, I am replying you also(reply to all). Please don't get offended if it was not your intention. /***THE CODE/ #include gtk/gtk.h #include stdio.h #include string.h #include gdk/gdk.h GtkWidget *window; GtkWidget *vbox, *hbox, *combo; GtkWidget *vbox1, *hbox1, *combo1; GtkWidget *entry1; GtkWidget *entryAuth; GtkWidget *entryEditor; GtkWidget *entryTitle; GtkWidget *window; int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *table; GtkWidget *frame; GtkWidget *notebook; GtkWidget *label; GtkWidget *checkbutton; GtkWidget *widget; int i; char bufferf[32]; char bufferl[32]; //char bibtype; 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); // gtk_window_set_default_size(GTK_WINDOW(window), 200, 150); 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_text_new(); 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); gchar *bibtype = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo)); printf(%s, gtk_combo_box_get_active_text(GTK_COMBO_BOX(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 =
Re: multiple GTKentry inside a GTKnotebook
can you post a larger bit of the code? it is difficult to see what's going on. b.t.w. gtk_combo_box_new_text() is deprecated, use gtk_combo_box_text_new() Olivier 2012/6/20 Rudra Banerjee bnrj.ru...@yahoo.com: Thanks for your reply jjacky. This is a mistake; but does not changeing the result. On Tue, 2012-06-19 at 22:13 +0200, jjacky wrote: On 06/19/12 21:43, Rudra Banerjee wrote: Yeti, Thanks for your help. That is working now. it should probably be GTK_COMBO_BOX(combo), not GTK_COMBO_BOX(widget) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ 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
Olivier, Thanks for your interest. Pasted just below is the complete code. What I want to do with that is, as a raw commented snip by line number 106-116 that according to my selection of Book/Article in combobox, some entry will be hidden. But, for that, I need to get the data from the combo box, which I have tried in line number 53-54. Please help. NB. Olivier, I got your reply in CC as well as a group post. So, I am replying you also(reply to all). Please don't get offended if it was not your intention. /***THE CODE/ #include gtk/gtk.h #include stdio.h #include string.h #include gdk/gdk.h GtkWidget *window; GtkWidget *vbox, *hbox, *combo; GtkWidget *vbox1, *hbox1, *combo1; GtkWidget *entry1; GtkWidget *entryAuth; GtkWidget *entryEditor; GtkWidget *entryTitle; GtkWidget *window; int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *table; GtkWidget *frame; GtkWidget *notebook; GtkWidget *label; GtkWidget *checkbutton; GtkWidget *widget; int i; char bufferf[32]; char bufferl[32]; //char bibtype; 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); //gtk_window_set_default_size(GTK_WINDOW(window), 200, 150); 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_text_new(); 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); gchar *bibtype = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo)); printf(%s, gtk_combo_box_get_active_text(GTK_COMBO_BOX(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_widget_set_usize(frame, 400, 175); vbox1 = gtk_vbox_new(FALSE, 0); hbox1 = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox1); entryAuth = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryAuth), Author); gtk_container_add (GTK_CONTAINER (vbox1), entryAuth); gtk_widget_show(entryAuth); entryEditor = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryEditor), Editor); gtk_container_add (GTK_CONTAINER (vbox1), entryEditor); gtk_widget_show(entryEditor); entryTitle = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryTitle), Title); gtk_container_add (GTK_CONTAINER (vbox1), entryTitle); gtk_widget_show(entryTitle); label = gtk_label_new(Authors/Title); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label); /*switch (bibtype) { case book: gtk_container_add(GTK_CONTAINER(vbox1), entryAuth); gtk_container_add(GTK_CONTAINER(vbox1), entryEditor); gtk_entry_set_text(GTK_ENTRY(entryTitle), Title); break; case article: gtk_container_add(GTK_CONTAINER(vbox1), entryAuth); gtk_entry_set_text(GTK_ENTRY(entryTitle), Title); } */ gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0); gtk_widget_show(table); gtk_widget_show_all(window); gtk_main(); return 0; } /***CODE END**/ On Wed, 2012-06-20 at 13:20 +0200, Olivier Sessink wrote: can you post a larger bit of the code? it is difficult to see what's going on. b.t.w. gtk_combo_box_new_text() is deprecated, use gtk_combo_box_text_new() Olivier 2012/6/20 Rudra Banerjee bnrj.ru...@yahoo.com: Thanks for your reply jjacky. This is a mistake; but does not changeing the result. On Tue, 2012-06-19 at 22:13 +0200, jjacky wrote: On 06/19/12 21:43, Rudra Banerjee wrote: Yeti, Thanks for your help. That is working now. it should probably be GTK_COMBO_BOX(combo), not GTK_COMBO_BOX(widget) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list
Re: multiple GTKentry inside a GTKnotebook
I cleaned the code a bit watching the GTK API 3 http://developer.gnome.org/gtk3/3.0/GtkComboBoxText.html /***THE CODE/ #include gtk/gtk.h #include stdio.h #include string.h #include gdk/gdk.h GtkWidget *window; GtkWidget *vbox, *hbox, *combo; GtkWidget *vbox1, *hbox1, *combo1; GtkWidget *entry1; GtkWidget *entryAuth; GtkWidget *entryEditor; GtkWidget *entryTitle; GtkWidget *window; int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *table; GtkWidget *frame; GtkWidget *notebook; GtkWidget *label; GtkWidget *checkbutton; GtkWidget *widget; int i; char bufferf[32]; char bufferl[32]; //char bibtype; 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_text_new (); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT(combo), NULL, Loco ); gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT(combo), Book ); gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT(combo), Ladron ); gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT(combo), Anibal Bigoton ); gtk_widget_show(combo); gchar *text= gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(combo)); printf(%s, gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(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_widget_set_size_request(frame, 400, 175); vbox1 = gtk_vbox_new(FALSE, 0); hbox1 = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox1); entryAuth = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryAuth), Author); gtk_container_add (GTK_CONTAINER (vbox1), entryAuth); gtk_widget_show(entryAuth); entryEditor = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryEditor), Editor); gtk_container_add (GTK_CONTAINER (vbox1), entryEditor); gtk_widget_show(entryEditor); entryTitle = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryTitle), Title); gtk_container_add (GTK_CONTAINER (vbox1), entryTitle); gtk_widget_show(entryTitle); 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; } /***CODE END**/ /// 2012/6/20 Rudra Banerjee bnrj.ru...@yahoo.com Olivier, Thanks for your interest. Pasted just below is the complete code. What I want to do with that is, as a raw commented snip by line number 106-116 that according to my selection of Book/Article in combobox, some entry will be hidden. But, for that, I need to get the data from the combo box, which I have tried in line number 53-54. Please help. NB. Olivier, I got your reply in CC as well as a group post. So, I am replying you also(reply to all). Please don't get offended if it was not your intention. /***THE CODE/ #include gtk/gtk.h #include stdio.h #include string.h #include gdk/gdk.h GtkWidget *window; GtkWidget *vbox, *hbox, *combo; GtkWidget *vbox1, *hbox1, *combo1; GtkWidget *entry1; GtkWidget *entryAuth; GtkWidget *entryEditor; GtkWidget *entryTitle; GtkWidget *window; int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *table; GtkWidget *frame; GtkWidget *notebook; GtkWidget *label; GtkWidget *checkbutton; GtkWidget *widget; int i; char bufferf[32]; char bufferl[32]; //char bibtype; gtk_init(argc, argv); window =
Re: multiple GTKentry inside a GTKnotebook
Thanks, but its not solving the main problem. / 2012/6/20 Rudra Banerjee bnrj.ru...@yahoo.com Olivier, Thanks for your interest. Pasted just below is the complete code. What I want to do with that is, as a raw commented snip by line number 106-116 that according to my selection of Book/Article in combobox, some entry will be hidden. But, for that, I need to get the data from the combo box, which I have tried in line number 53-54. Please help. NB. Olivier, I got your reply in CC as well as a group post. So, I am replying you also(reply to all). Please don't get offended if it was not your intention. /***THE CODE/ #include gtk/gtk.h #include stdio.h #include string.h #include gdk/gdk.h GtkWidget *window; GtkWidget *vbox, *hbox, *combo; GtkWidget *vbox1, *hbox1, *combo1; GtkWidget *entry1; GtkWidget *entryAuth; GtkWidget *entryEditor; GtkWidget *entryTitle; GtkWidget *window; int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *button; GtkWidget *table; GtkWidget *frame; GtkWidget *notebook; GtkWidget *label; GtkWidget *checkbutton; GtkWidget *widget; int i; char bufferf[32]; char bufferl[32]; //char bibtype; 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); //gtk_window_set_default_size(GTK_WINDOW(window), 200, 150); 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_text_new(); 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); gchar *bibtype = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo)); printf(%s, gtk_combo_box_get_active_text(GTK_COMBO_BOX(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_widget_set_usize(frame, 400, 175); vbox1 = gtk_vbox_new(FALSE, 0); hbox1 = gtk_hbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(frame), vbox1); entryAuth = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryAuth), Author); gtk_container_add (GTK_CONTAINER (vbox1), entryAuth); gtk_widget_show(entryAuth); entryEditor = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryEditor), Editor); gtk_container_add (GTK_CONTAINER (vbox1), entryEditor); gtk_widget_show(entryEditor); entryTitle = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entryTitle), Title); gtk_container_add (GTK_CONTAINER (vbox1), entryTitle); gtk_widget_show(entryTitle); label = gtk_label_new(Authors/Title); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), frame, label); /*switch (bibtype) {
Re: multiple GTKentry inside a GTKnotebook
Yeti, Thanks for your help. That is working now. I have one more problem. I need to take the data from the combo box. So after the combo box, I added the line: gchar *bibtype = gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)); fprintf(stdout, %s, bibtype); So, that part looks like 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); gchar *bibtype = gtk_combo_box_get_active_text (GTK_COMBO_BOX(widget)); fprintf(stdout, %s, bibtype); which is giving error. I am trying hard via tutorials in web from yesterday. Please help. On Mon, 2012-06-18 at 20:35 +0200, David Nečas wrote: 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
Re: multiple GTKentry inside a GTKnotebook
On 06/19/12 21:43, Rudra Banerjee wrote: Yeti, Thanks for your help. That is working now. I have one more problem. I need to take the data from the combo box. So after the combo box, I added the line: gchar *bibtype = gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)); fprintf(stdout, %s, bibtype); So, that part looks like 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); gchar *bibtype = gtk_combo_box_get_active_text (GTK_COMBO_BOX(widget)); it should probably be GTK_COMBO_BOX(combo), not GTK_COMBO_BOX(widget) fprintf(stdout, %s, bibtype); which is giving error. I am trying hard via tutorials in web from yesterday. Please help. On Mon, 2012-06-18 at 20:35 +0200, David Nečas wrote: 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 ___ 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
Thanks for your reply jjacky. This is a mistake; but does not changeing the result. On Tue, 2012-06-19 at 22:13 +0200, jjacky wrote: On 06/19/12 21:43, Rudra Banerjee wrote: Yeti, Thanks for your help. That is working now. it should probably be GTK_COMBO_BOX(combo), not GTK_COMBO_BOX(widget) ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ 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
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