Re: [gtk-list] Question - event propogation in non-TOPLEVEL windows



Just create a GTK_WINDOW_TOPLEVEL, then
gtk_widget_realize(wnd) it,
and call
gdk_window_set_decorations(wnd->window,0);

and call
gtk_widget_show(wnd);

and then gtk_main();

No other event stuffs are needed.

Michael
----- Original Message -----
From: "Simon Gornall" <simon@unique-id.com>
To: "GTK mailing list" <gtk-list@redhat.com>
Sent: Thursday, February 03, 2000 7:49 AM
Subject: [gtk-list] Question - event propogation in non-TOPLEVEL windows


> I have an application that looks much prettier (:-) without
> window borders etc. The problem is that in the following code...
>
>
> file://================================================================
> // Create the window to draw in
> file://================================================================
> _window = gtk_widget_new (gtk_window_get_type(),
> "GtkObject::user_data", NULL,
> "GtkWindow::type", UID_WIN_TYPE,
> "GtkWindow::title", "Unique ID Video Stream",
> "GtkWindow::allow_shrink",
>   FALSE, NULL);
>
>
> ... simply changing the definition of UID_WIN_TYPE from the usual
> GTK_WINDOW_TOPLEVEL to GTK_WINDOW_POPUP causes my key events to not
> be called - they're not even being sent to the application, I can
> see the keypresses appearing in the parent xterm :-(
>
> I'm setting all the obvious things I can think of...
>
>
> file://================================================================
> // Set up events etc. for the main window
> file://================================================================
> GTK_WIDGET_SET_FLAGS(_window, GTK_CAN_FOCUS);
> gtk_signal_connect( GTK_OBJECT(_window), "key_press_event",
> GTK_SIGNAL_FUNC(keyDown), this );
> gtk_widget_set_events(_window, gtk_widget_get_events(_window ) |
> GDK_BUTTON_PRESS_MASK |
> GDK_POINTER_MOTION_MASK |
> GDK_BUTTON_RELEASE_MASK |
> GDK_KEY_PRESS_MASK
> );
> gtk_widget_show (_window);
> gtk_window_activate_focus((GtkWindow*)_window);
>
>
> Anyone have any ideas what else I have to do ?
>
> Cheers,
> Simon.
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
/dev/null
>



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