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 

[gtkmm]set_resizable doesn't work as expected

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


Joined: 09 Mar 2008
Posts: 7

PostPosted: Sun Mar 09, 2008 2:32 am    Post subject: [gtkmm]set_resizable doesn't work as expected Reply with quote

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: (Plaintext)
1
2
3
4
5
6
7
8
9
10
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: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11
12
#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;
}
Back to top
sledgehammer_999
Familiar Face


Joined: 09 Mar 2008
Posts: 7

PostPosted: Sun Mar 09, 2008 5:12 pm    Post subject: Reply with quote

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().
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