Hello,
I'm developping a plugin for Geany and the objective is to create a window to display something (some texts...). However, the difficulty is that I don't know how to insert a new window into Geany (ex: a text view just below the Message Window of Geany). I have tried to add something like:
GtkWidget *view; view = gtk_text_view_new(); gtk_box_pack_start(GTK_BOX(ui_ lookup_widget(geany->main_widgets->window, "vbox1")), view, TRUE, TRUE, 0); gtk_widget_show(view);
in the function plugin_init but it doesn't work as I expected.
I'm very happy if anyone can help me!
Thank you very much
On 18 February 2010 05:58, Lai Hoang Nam laihoangnam@gmail.com wrote:
Hello,
I'm developping a plugin for Geany and the objective is to create a window to display something (some texts...). However, the difficulty is that I don't know how to insert a new window into Geany (ex: a text view just below the Message Window of Geany). I have tried to add something like:
GtkWidget *view; view = gtk_text_view_new(); gtk_box_pack_start(GTK_BOX(ui_ lookup_widget(geany->main_widgets->window, "vbox1")), view, TRUE, TRUE, 0); gtk_widget_show(view);
in the function plugin_init but it doesn't work as I expected.
Assuming that you mean nothing shows, a couple of suggestions:
1. run Geany with the -v option and see if ui_lookup_widget is giving an error
2. put some text in the text view, maybe vbox gives it zero size if its empty
Cheers Lex
I'm very happy if anyone can help me!
Thank you very much
Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On Wed, 17 Feb 2010 19:58:38 +0100 Lai Hoang Nam laihoangnam@gmail.com wrote:
I'm developping a plugin for Geany and the objective is to create a window to display something (some texts...). However, the difficulty is that I don't know how to insert a new window into Geany (ex: a text view just below the Message Window of Geany). I have tried to add something like:
GtkWidget *view; view = gtk_text_view_new(); gtk_box_pack_start(GTK_BOX(ui_ lookup_widget(geany->main_widgets->window, "vbox1")), view, TRUE, TRUE, 0); gtk_widget_show(view);
in the function plugin_init but it doesn't work as I expected.
I'm still not sure why it doesn't work, but you could add a page to the message window notebook instead:
GtkWidget *view, *notebook; view = gtk_text_view_new(); notebook = ui_lookup_widget(geany->main_widgets->window, "notebook_info"); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), view, gtk_label_new("Text View")); gtk_widget_show(view);
Regards, Nick
On Thu, 18 Feb 2010 17:25:05 +0000, Nick wrote:
On Wed, 17 Feb 2010 19:58:38 +0100 Lai Hoang Nam laihoangnam@gmail.com wrote:
I'm developping a plugin for Geany and the objective is to create a window to display something (some texts...). However, the difficulty is that I don't know how to insert a new window into Geany (ex: a text view just below the Message Window of Geany). I have tried to add something like:
GtkWidget *view; view = gtk_text_view_new(); gtk_box_pack_start(GTK_BOX(ui_ lookup_widget(geany->main_widgets->window, "vbox1")), view, TRUE, TRUE, 0); gtk_widget_show(view);
in the function plugin_init but it doesn't work as I expected.
I'm still not sure why it doesn't work, but you could add a page to the message window notebook instead:
That was what I'd suggested as well (but didn't get to it in time). Appending tabs to the messages window notebook is what other plugins do as well (addons, geanygdb, maybe others) and it should less clutter Geany's UI (and it is easier :D).
Regards, Enrico