custom widget->realize fct for GtkFileSelection



Hi gtk experts,

I'm having difficulty implementing a custom realize function
for the GtkFileSelection. 

<context>I'm doing this to remove the screen dependent resources
 from the gtk_file_selection_init.</context>

When I start my test application (which only creates a file 
selection dialog box)
all the widgets part of the file selector widget are realized
on separate top level window.

Here is my realize function :

static void 
gtk_file_selection_realize (GtkWidget *widget)
{
  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
  widget->window = gtk_widget_get_parent_window (widget);
  gdk_window_ref (widget->window);
  g_print ("In gtk_file_selection_realize\n");
}

I get an error from gtk_widget_get_parent_window which tells
me the widget doesn't have a parent window.

I guess this is because GtkFileSelection is a dialog therefore is
a toplevel window and as no parent, right ?

So where do I get the dialog toplevel window ?
Do I have to create it ? (If so, please, explain).



Thanks in advance.

Erwann


[ I speak for myself, not for my employer. ]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Erwann Chénedé, Sun Microsystems Ireland
  Desktop Applications & Middleware Group
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=






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