I have just started learning Gtkmm basics, and I the box widget is doing my headache, and here is the problem:

#ifndef NEWFILE_HPP
#define	NEWFILE_HPP
#include "gtkmm/window.h"
#include "gtkmm/scrollbar.h"
#include "gtkmm/adjustment.h"
#include "gtkmm/box.h"
#include "gtkmm/label.h"
#include "gtkmm/scale.h"
#include "gtkmm/togglebutton.h"

class window:public Gtk::Window{
public:
    window();
    ~window();
private:
    
    Gtk::VScrollbar bar;
    Gtk::Adjustment adjust_bar;
    Gtk::HBox hbox;
    Gtk::VBox vbox;
    Gtk::Label label,togg_label;
    Gtk::HScale hscale;
    Gtk::ToggleButton togglb,togglb1;
};

#endif	/* NEWFILE_HPP */
#include <gtkmm-2.4/gtkmm/container.h>
#include <sigc++-2.0/sigc++/functors/ptr_fun.h>
#include <sigc++-2.0/sigc++/functors/mem_fun.h>

#include "newfile.hpp"
#include "gtkmm.h"
#include <iostream>
#include "gtkmm/togglebutton.h"

window::window():
        adjust_bar(3.0,0.0,30.0),
        hbox(false,15),
        vbox(false,15),
        label("Pastumdykmane!!! "),
        togg_label("ksdjnsd"),
        togglb("Paspausk mane!!! "),
        togglb1("nespausk manes!! ")
        
        
{
    
    set_border_width(5);
    set_title("slankiklis");
    bar.set_adjustment(adjust_bar);
    hscale.set_adjustment(adjust_bar);
    
    hbox.pack_start(bar);
    hbox.pack_start(vbox);
    
    vbox.pack_start(label);
    vbox.pack_start(hscale);
    vbox.pack_start(togglb);
    vbox.add(togg_label);
    vbox.pack_start(togglb1); // I assume that here is a problem, but vbox is container 
                              // so it means I can put any widgets as many as I want?
    
    add(hbox);
    
    show_all_children();
}
window::~window(){}
#include <cstdlib>
#include "newfile.hpp"
#include "gtkmm/main.h"

using namespace std;


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

    Gtk::Main k(argc,argv);
    window wi;
    Gtk::Main::run(wi);
    return 0;
}

When I compile I get return value 1

hello i am creating an application with gtkmm and i have a problem when i want to genrate 2 window in the main of my program.have you got a simple exemple ?
thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.