GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Jul 29, 2014 2:46 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: gtk_window_fullscreen with a child window
PostPosted: Fri Mar 30, 2012 12:58 pm 
Offline

Joined: Fri Mar 30, 2012 12:32 pm
Posts: 3
Hi,

I'm unable to make a child window to go full screen using gtk_window_fullscreen (). Making a top-level window full screen is working but not with a child window.
Is there any constraint in GTK which doesn't allow this or am I seeing a bug? Any ideas would be appreciated.
I'm using GTK version 2.24.4 on Ubuntu 11.04 with the Unity desktop.

Thanks in advance,
Arun


Top
 Profile  
 
 Post subject: Re: gtk_window_fullscreen with a child window
PostPosted: Sat Mar 31, 2012 6:13 am 
Offline
Familiar Face

Joined: Thu Dec 15, 2011 6:23 pm
Posts: 36
Location: Hrvatska
Hi and welcome to this awsome forum.
yes it can be done. use this:
Code:
GtkWidget *child = gtk_window_new (GTK_WINDOW_TOPLEVEL);
         gtk_window_set_decorated ( GTK_WINDOW (child), FALSE);

         gtk_window_set_resizable(GTK_WINDOW(child), TRUE);    // nevermind
         gtk_window_set_position(GTK_WINDOW(child), GTK_WIN_POS_CENTER);
               /*
                *   you must put some widget in that child :-)
                */

         gtk_widget_show_all (child);
           gtk_window_move(GTK_WINDOW(child),0,0);
         gtk_widget_set_size_request(child, SIRINA,VISINA);


SIRINA means width, it should be fullscreen.
VISINA means height, it does not have to be fullscreen. if you have MAIN MENU button on bottom , say it is 80 pixel height, then set your child's height to be VISINA-80 !


Top
 Profile  
 
 Post subject: Re: gtk_window_fullscreen with a child window
PostPosted: Mon Apr 02, 2012 6:17 pm 
Offline

Joined: Fri Mar 30, 2012 12:32 pm
Posts: 3
Hi, many thanks for the response!

I understand what you're saying but I'm still wondering whether it is not possible to make the window to go fullscreen by just using gtk_window_fullscreen ().
I feel it is cumbersome to use gtk_widget_set_size_request () to specify the actual screen's width and height.

Thanks!


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

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] and 5 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