You are not logged in.

#1 2008-01-29 00:47:14

solanoalves
Member
From: Curitiba Brazil
Registered: 2007-12-02
Posts: 54

C++ and GTKMM > Problem using function set_resizable()

When I set the function set_resizable to false, the window open too small and only shows the label sad.
What am I making wrong ?

The code:

#include <gtkmm/window.h>
#include <gtkmm/main.h>
#include <gtkmm/layout.h>
#include <gtkmm/button.h>
#include <gtkmm/box.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/label.h>

class Janela : public Gtk::Window{

public:

 Janela() : 
 layout(), 
 adicionar("Adicionar"), 
 remover("Remover"), 
 pesquisar("Pesquisar"),
 sobre("Sobre"),
 cvbotao(Gtk::BUTTONBOX_START, 10),
 label("bla bla bla bla"),
 caixa(){

  Gtk::Window::set_size(500,300);
  Gtk::Window::set_resizable(false);
  Gtk::Window::set_title("Receitas Vegetarianas");
  add(caixa);
  caixa.pack_start(layout);
  caixa.pack_end(label);
  cvbotao.add(pesquisar);
  cvbotao.add(adicionar);
  cvbotao.add(remover);
  cvbotao.add(sobre);
  layout.put(cvbotao,30,140);
  layout.show();
  label.show();
  cvbotao.show();
  adicionar.show();
  remover.show();
  pesquisar.show();
  sobre.show();
  caixa.show();

 }

 ~Janela(){
 }

protected:

 Gtk::Button adicionar;
 Gtk::Button remover;
 Gtk::Button pesquisar;
 Gtk::Button sobre;
 Gtk::Layout layout;
 Gtk::VButtonBox cvbotao;
 Gtk::Label label;
 Gtk::HBox caixa;

};

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

 Gtk::Main kit(argc, argv);

 Janela janela;
 Gtk::Main::run(janela);

}

big_smile How did you know? I love this song! big_smile

Offline

#2 2008-01-29 01:36:45

solanoalves
Member
From: Curitiba Brazil
Registered: 2007-12-02
Posts: 54

Re: C++ and GTKMM > Problem using function set_resizable()

please somebody delete this topic I got fix the problem change set_size by set_size_request.
Thanks


big_smile How did you know? I love this song! big_smile

Offline

Board footer

Powered by FluxBB