setting focus on visible window



Hi

A have opened window in background of my main window. When I click
button, I would like set focus on this window in background.

on_click callback function:

if (window != NULL && GTK_WIDGET_VISIBLE (window))
{
        gdk_window_show (window->window);
        
        gtk_widget_grab_focus (window);
}
else
{
        window = create_window();

        gtk_widget_show (window);
}

What is wrong?

Thanks.
Michal.





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