Re: lock focus
- From: Muthiah Annamalai <dearestchum yahoo co in>
- To: y g <odysseus lost gmail com>, gtk-app-devel-list gnome org
- Cc:
- Subject: Re: lock focus
- Date: Fri, 20 May 2005 08:37:32 -0700 (PDT)
I think youre talking about a modal dialog
box. You must set the GTK_DIALOG_MODAL
flag on. Thats it, while creating a dialog box,
with the dialog_new_with_buttons() pass this flag
also.
Must work.
<CODE>
#include<gtk/gtk.h>
void my_exit_cb(GtkWidget *w)
{
GtkWidget *m;
gtk_window_set_title(GTK_WINDOW(g_object_get_data(w,"window")),"Good
Bye World");
m=gtk_message_dialog_new(NULL,GTK_DIALOG_MODAL |
GTK_DIALOG_NO_SEPARATOR,0,1,"Lets Say Good
Bye...",NULL);
g_printf("Hello World!");
//gtk_dialog_run(m);
gtk_widget_show_all(m);
//gtk_widget_destroy()
//gtk_main_quit();
}
int main(int argc,char *argv[])
{
GtkWidget *w,*btn,*img;
gtk_init(&argc,&argv);
img=gtk_image_new_from_file("monodoc.png");
btn=gtk_button_new_with_label("Exit");
gtk_widget_destroy(gtk_bin_get_child(btn));
gtk_container_add(GTK_CONTAINER(btn),img);
w=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_add(GTK_CONTAINER(w),btn);
gtk_window_set_title(GTK_WINDOW(w),"Hello
World!");
gtk_widget_show_all(w);
g_signal_connect(G_OBJECT(w),"destroy",G_CALLBACK(gtk_main_quit),NULL);
g_object_set_data(btn,"window",w);
g_signal_connect(G_OBJECT(btn),"clicked",G_CALLBACK(my_exit_cb),NULL);
gtk_main();
return 0;
}
</CODE>
-Muthu.
P.S: Code from gtkbook project. gtkbook.sf.net
--- y g <odysseus lost gmail com> wrote:
hi,
i have a confirmation dialog that needs to stay on
focus and on top
with all the other windows "deactivated". Browsed
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]