Re: grub focus
- From: Arren <jianling xiang sw-linux com>
- To: dnk front ru
- Cc: gtk-app-devel-list gnome org
- Subject: Re: grub focus
- Date: Tue, 15 Mar 2005 10:18:04 +0800
dnk wrote:
how i can grub focus to my program.
i what to write a small xlocker.
How about gtk_widget_grab()
or grub XEvent directly.
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
gboolean delete_event(GtkWidget* widget, GdkEvent* event, gpointer data)
{
fprintf(stderr,"delete event\n");
return TRUE;
}
gboolean focus_in_event (GtkWidget *widget, GdkEventFocus *event,
gpointer data)
{
fprintf(stderr,"focus in event\n");
return FALSE;
};
gboolean focus_out_event (GtkWidget *widget, GdkEventFocus *event,
gpointer data)
{
fprintf(stderr,"focus out event\n");
// here i what to grub back focus, but it not working :(
return FALSE;
};
int main(int argc,char**argv)
{
gtk_init(&argc,&argv);
GtkWidget* window;
GtkWidget* entry;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
{
g_signal_connect (window, "delete-event", G_CALLBACK
(delete_event), NULL);
g_signal_connect (window, "focus-in-event", G_CALLBACK
(focus_in_event), NULL);
g_signal_connect (window, "focus-out-event", G_CALLBACK
(focus_out_event), &window);
gtk_window_set_position( GTK_WINDOW(window),
GTK_WIN_POS_CENTER_ALWAYS);
gtk_window_set_decorated( GTK_WINDOW(window), FALSE);
gtk_window_set_skip_taskbar_hint( GTK_WINDOW(window), TRUE);
gtk_window_set_skip_pager_hint( GTK_WINDOW(window), TRUE);
gtk_window_set_modal( GTK_WINDOW(window), TRUE);
gtk_window_stick( GTK_WINDOW(window));
gtk_window_set_keep_above( GTK_WINDOW(window), TRUE);
}
gtk_widget_show(window);
gtk_main();
return EXIT_SUCCESS;
}
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]