grab_focus...




I am trying to understand the functions
gtk_widget_grab_default, gtk_widget_grab_focus and the flags
CAN_FOCUS CAN_DEFAULT..

I can't find any doc on them; could somebody tell me
what they are exactly expected to do;
In particular the following program produces a segmentation fault:

#include <gtk/gtk.h>

int main( int argc, char *argv[])
{
  GtkWidget *window;
  gtk_init(&argc, &argv);
         
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_show(window);
  GTK_WIDGET_SET_FLAGS (window, GTK_CAN_FOCUS);
  gtk_widget_grab_focus(window);
  gtk_main ();
}

Thanks in advance

Hubert



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