GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Sep 19, 2014 9:53 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [gtkmm]set_resizable doesn't work as expected
PostPosted: Sun Mar 09, 2008 2:32 am 
Offline
Familiar Face

Joined: Sun Mar 09, 2008 2:23 am
Posts: 7
Hi I am trying to figure out how gtkmm works. So I am just "extending" the functionality of the hello program found in the gtkmm tutorial:
Code:
int main(int argc, char *argv[])
{
    Gtk::Main kit(argc, argv);

    Gtk::Window window;

    Gtk::Main::run(window);
   
    return 0;
}



I was trying to find a way to make my window unresizable from the user. So according to the documentation the "set_resizable()" does the job. But when I try it the resulting window is really really small maybe 1x1 pixel. I tried using "resize()" but nothing changes.So here's the code:
Code:
#include <gtkmm.h>

int main(int argc, char *argv[])
{
    Gtk::Main kit(argc, argv);
    Gtk::Window window;
    window.set_resizable(false);
    window.resize(256,256);
    Gtk::Main::run(window);
   
    return 0;
}


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 09, 2008 5:12 pm 
Offline
Familiar Face

Joined: Sun Mar 09, 2008 2:23 am
Posts: 7
Solved. All I needed to do is add() to the window a container widget.

EDIT: I am sorry, I solved it some other way. I used window.set_size_request() instead of window.resize().


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group