GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can i remove title bar from Gtkdialog?

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
Saniat
Familiar Face


Joined: 24 Dec 2009
Posts: 23

PostPosted: Wed Mar 03, 2010 8:03 am    Post subject: How can i remove title bar from Gtkdialog? Reply with quote

Hi,
I want to remove the title bar from the Gtkdialog window. I already use
Code: (C)
1
gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
It remove the title bar but its also remove transparent shape.So how can i remove title bar from the GtkDialog?
Thanks in advance.

Saniat
Back to top
Joel
GTK+ Guru


Joined: 06 Apr 2008
Posts: 225
Location: Fortress of solitude

PostPosted: Wed Mar 03, 2010 3:54 pm    Post subject: Reply with quote

Using the gtk_window_set_decorated removes the window's decorator that your desktop environment is using....
Try using gdk_window_set_decorations
Back to top
Saniat
Familiar Face


Joined: 24 Dec 2009
Posts: 23

PostPosted: Thu Mar 04, 2010 3:50 am    Post subject: Reply with quote

Thnx Joel.
After get your reply i use :

Code: (C)
1
2
3
GtkWidget *dialog = gtk_dialog_new();
GdkWindow *wnd = gtk_widget_get_toplevel(dialog)->window;
gdk_window_set_decorations(wnd,FALSE);

but it shows:
Code: (Plaintext)
1
2
root: (bar:com.example.apps.basicapp:1304) Gdk-CRITICAL: gdk_window_set_decorations: assertion `GDK_IS_WINDOW (window)' failed
root: (bar:com.example.apps.basicapp:1304) Gdk-CRITICAL: gdk_window_set_title: assertion `GDK_IS_WINDOW (window)' failed


Where i did wrong?

Thanks in advance.

Saniat
Back to top
Joel
GTK+ Guru


Joined: 06 Apr 2008
Posts: 225
Location: Fortress of solitude

PostPosted: Thu Mar 04, 2010 4:53 am    Post subject: Reply with quote

Using this:
Code: (C)
1
2
3

gtk_widget_get_toplevel(dialog)->window;

You are using the toplevel window, not your dialog, try this steps:
1.- Create your dialog with gtk_dialog_new
2.- Initialize it with gtk_widget_show
3.- Get the dialog's GdkWindow with gtk_widget_get_window
4.- Use gdk_window_set_decorations.

Hope it helps :)
Back to top
Turtel
Familiar Face


Joined: 01 Mar 2010
Posts: 34
Location: India

PostPosted: Sat Mar 13, 2010 5:56 am    Post subject: removing title bar Reply with quote

Try this code it will give you window without title bar- will it help you?


#include <gtk/gtk.h>

int main( int argc,
char *argv[] )
{
GtkWidget *window;

gtk_init (&argc, &argv);

window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_type_hint(GTK_WINDOW(window),
GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
/* or use- gtk_window_set_decorated(GTK_WINDOW(window), FALSE);*/

gtk_widget_show (window);

gtk_main ();

return(0);
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP