GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Aug 21, 2014 4:21 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How can i remove title bar from Gtkdialog?
PostPosted: Wed Mar 03, 2010 8:03 am 
Offline
Familiar Face

Joined: Thu Dec 24, 2009 4:27 am
Posts: 23
Hi,
I want to remove the title bar from the Gtkdialog window. I already use
Code:
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 03, 2010 3:54 pm 
Offline
GTK+ Guru

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 286
Location: Fortress of solitude
Using the gtk_window_set_decorated removes the window's decorator that your desktop environment is using....
Try using gdk_window_set_decorations

_________________
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2010 3:50 am 
Offline
Familiar Face

Joined: Thu Dec 24, 2009 4:27 am
Posts: 23
Thnx Joel.
After get your reply i use :

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

but it shows:
[code=]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[/code]

Where i did wrong?

Thanks in advance.

Saniat


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2010 4:53 am 
Offline
GTK+ Guru

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 286
Location: Fortress of solitude
Using this:
Code:
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 :)

_________________
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.


Top
 Profile  
 
 Post subject: removing title bar
PostPosted: Sat Mar 13, 2010 5:56 am 
Offline
Familiar Face

Joined: Mon Mar 01, 2010 3:21 pm
Posts: 37
Location: India
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);
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group