Re: Closing windows in GTK



On Sat, 04 Jun 2005 20:22:02 +0200
Francisco Fernandez <franfernandezb coit es> wrote:

When GTK shows windows, is assigned any kind of id to them? I mean,
that way I could obtain a reference instead of passing them as
parameters to the callbacks...

Hi Francisco.

You don't get windows for free. You have to create the window with a
sentence like:

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

This gives you 'window' as a pointer to the window, which can then be
close with

  gtk_widget_destroy(window);  (or hide and show)

and you can pass 'window' as 'data' to the button if you like, or you can
hang it on the button with the g_object_set_data function.

Check the "GTK+ 2.0 Tutorial" there's tons of information there.

John



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