Re: How to reactivate (focus?) the main window,



Hi

you might want to look at:

* gtk_widget_set_can_focus ()¨
* gtk_widget_set_events()


g_object_set(window,
                   "can-focus\0", TRUE,
                   NULL);
gtk_widget_set_events((GtkWidget *) window,
                                  GDK_CONTROL_MASK
                                  | GDK_KEY_PRESS_MASK
                                  | GDK_KEY_RELEASE_MASK)

...

g_signal_connect_after(G_OBJECT(window), "focus_in_event\0",

G_CALLBACK(your_window_box_focus_in_callback), (gpointer) window);

g_signal_connect_after(G_OBJECT(window), "focus_out_event\0",

G_CALLBACK(your_window_box_focus_out_callback), (gpointer) window);

...

gtk_widget_set_state((GtkWidget *) window,
                                 GTK_STATE_ACTIVE);

That's it.

bests,
Joël

On Mon, Sep 5, 2016 at 2:57 PM, Paulo Silva <paulo sistemasolar com br> wrote:
I don't now if I understood correctly your problem.
Maybe this:

gtk_window_present( GTK_WINDOW(ptr_to_your_window) );

José Paulo


2016-09-04 13:58 GMT-03:00 dmg <dmg uvic ca>:

On Sun, Sep 4, 2016 at 9:57 AM, dmg <dmg uvic ca> wrote:


I have tried using   gtk_window_set_focus(winMain); but this does not
work.


My mistake. I have used:

gtk_widget_grab_focus(winMain);

and it does not work.




--
--dmg

---
Daniel M. German
http://turingmachine.org
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


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