A Combo box



Hello folks!

Specs
~~~~~~
OS: MS-Win
g++: 3.4.2
Gtkmm 2.10.11
pkg-config --cflags
-mms-bitfields -IC:/XWin/include/gtkmm-2.4 -IC:/XWin/lib/gtkmm-2.4/include -IC:/XWin/include/glibmm-2.4 -IC:/XWin/lib/glibmm- 2.4/include -IC:/XWin/include/gdkmm-2.4 -IC:/XWin/lib/gdkmm-2.4/include -IC:/XWin/include/pangomm-1.4 -IC:/XWin/include/atkmm-1.6 -IC:/XWin/include/gtk-2.0 -IC:/XWin/include/sigc++-2.0 -IC:/XWin/lib/sigc++-2.0/include -IC:/XWin/include/glib- 2.0 -IC:/XWin/lib/glib-2.0/include -IC:/XWin/lib/gtk-2.0/include -IC:/XWin/include/cairomm-1.0 -IC:/XWin/include/pango-1.0 -IC:/XWin/include/cairo -IC:/XWin/include/freetype2 -IC:/XWin/include -IC:/XWin/include/atk-1.0 

pkg-config --libs
-user32 -Wl,-luuid -LC:/XWin/lib -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-win32-2.0 -lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4 -lsigc-2.0 -lgdk-win32-2.0 -lgdi32 -limm32 -lshell32 -lole32 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lfontconfig -lfreetype -lz -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv 


I have a class [Combo] that derives from Gtk::VBox, this class contains a Gtk::Label and a Gtk::ComboBoxEntryText; both of them as pointers. When I just instantiate the object 'Gtk::ComboBoxEntryText [CBETtextBox = Gtk::manage(new Gtk::ComboBoxEntryText());] and compile the program, the result is a Combo Box (CB) with the expected dimensions (see Combo01.png). Hoever, when I 'add()' it to the class [Combo], I get a taller box and not as appealing as the first one (see Combo02).
Since I am not a expert Gtkmm programmer, in fact this is my first program on my own, I cannot make any educated deduction as to why this is happening, thus I am attaching two HTML files that clearly show my predicament  It is my hope that some-one here will be able to explain to me the cause of this variation.
Thanks in advance.


--
When in doubt remember that,
"By the Guidance of God, an amateur built The Ark... and that guided by science 'they' built The Titanic!"

Attachment: Combo01.png
Description: PNG image

Attachment: Combo02.png
Description: PNG image

Title: D:\Samiira\combo.cpp
#ifndef JAIME_COMBO_HPP
#include "combo.hpp"
#endif
void jme::Combo::Init(){
    if(ustr.empty()){ustr = "unknown";}
    // If the string is empty is because the overloaded constructor was not
    // use. So, the below is a safe statement
    //this->set_homogeneous(false);
    this->set_spacing(0);

    this->lblTitle = Gtk::manage(new Gtk::Label(ustr.data(), Gtk::ALIGN_LEFT ));
    this->add(*lblTitle);

    CBETtextBox = Gtk::manage(new Gtk::ComboBoxEntryText());
    this->add(*CBETtextBox);  // <<-- When I add this line the combox shows
                                // still, only it shows vertically bigger
}

void jme::Combo::Pack(){
    this->pack_start(*lblTitle,     Gtk::PACK_SHRINK);
    this->pack_start(*CBETtextBox,  Gtk::PACK_SHRINK);
}
jme::Combo::Combo(){
    this->Init();        // Set up the parameters for the this class widget
    this->Pack();        // Packs up all the widgets
}
jme::Combo::Combo(const Glib::ustring& title) throw (jme::ComboEx){
    // First step is to deal with the title of the combo box
    if(title.empty()){ this->ustr = "Unknown";}
    this->ustr.assign(title);
    this->Init();        // Set up the parameters for the this class widget
    this->Pack();        // Packs up all the widgets
}
jme::Combo::~Combo()
{ }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]