[Glade-users] How to use lookup_widget()?



新海 雄一 wrote:

Hello everyone. My name is Yuichi.

I'm sorry if these have been asked before, I couldn't find answers in
the archives.

How to use lookup_widget() to get GtkNotebook pointer? I tried "notebook"
as follows

    GtkWidget *widget;
    widget = lookup_widget(GTK_WIDGET(notebook),"notebook_name");

but compiler said as follows

    callbacks.c:74: `notebook' undeclared (first use in this function)

So I want know how to get GtkNotebook pointer? I use glade code
generater and use support.c(.h) too. (I could get button pointer by
using lookup_widget().)

You need to have a pointer to one widget in the window before you can
use lookup_widget().

Usually you can use the widget passed to your signal callbacks.

Alternatively, after creating the window, you can use the widget
returned, e.g.

  window = create_window1 ();
  notebook = lookup_widget (window, "notebook_name");


The FAQ on http://glade.gnome.org may help.

Damon





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]