Re: Gtk::Bin::set_justify(Left)??
- From: José Alburquerque <jaalburquerque cox net>
- To: ArbolOne <arbolone gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Gtk::Bin::set_justify(Left)??
- Date: Tue, 09 Nov 2010 13:47:16 -0500
On Tue, 2010-11-09 at 11:52 -0500, ArbolOne wrote:
> This is a extended snip.
>
> class MyClass{
> public:
> MyClass();
> ...
>
> protected:
> Gtk::VBox* vbBase; //Houses vbFrame
> //Gtk::VBox* vbFrame; //Since Gtk::Frame is a single-item
> container, vbFrame will hold all the widgets that will be inside the frmOne
> Gtk::Table* tblTable; //This table displays the variable name
> and the size of the variable
> Gtk::Frame* frmOne; //Frame holds the Table Widget
>
> //Integers
> Gtk::Label* lblInt; //Variable name
> Gtk::Label* lblIntTxt; //sizeof string value
> strtools str_tool; //string manipulation
> Glib::ustring txt; // temp string
> ...
> };
> void MyClass::MyClass(){
> //Window Properties
> this->set_title("Testing 64bit Variables");
> this->set_size_request(250,300);
> this->set_border_width(10);
>
> vbBase = Gtk::manage(new Gtk::VBox());
> frmOne = Gtk::manage(new Gtk::Frame("Variable Types"));
> //Add style and widget to the window Frame
> frmOne->set_shadow_type(Gtk::SHADOW_ETCHED_IN );
> frmOne->add(*tblTable);
> //Table and properties
> tblTable = Gtk::manage(new Gtk::Table(4,2,true));
> lblInt = Gtk::manage(new Gtk::Label());
> lblInt->set_justify (Gtk::JUSTIFY_RIGHT);
>
> //Left Label and properties
> lblIntTxt = Gtk::manage(new Gtk::Label());
> lblIntTxt->set_text("int");
> lblIntTxt->set_justify(Gtk::JUSTIFY_LEFT);
> lblIntTxt->set_alignment(Gtk::ALIGN_LEFT,Gtk::ALIGN_LEFT);
> lblIntTxt->property_xalign() = 0.0f;
>
> //Attach Left Label to the Table and pack it
> tblTable->attach(*lblIntTxt, 0,1,0,1,Gtk::EXPAND,Gtk::EXPAND,0,0);
> vbBase->pack_start(*tblTable);
>
> //Right Label
> int i = sizeof(int);
> txt = str_tool.toStr(i); // Convertes numerical values to a literal
> and returns a std::string value
> lblInt->set_text(txt);
>
> //Attach Right Label to the Table and pack it
> tblTable->attach(*lblInt, 1,2,0,1,Gtk::EXPAND,Gtk::EXPAND,0,0);
> vbBase->pack_start(*tblTable);
>
> // let the show begin
> vbBase->pack_start(*frmOne);
> this->add(*vbBase);
> this->show_all_children();
> }
> Thanks every one for your patience, I hope that the above data would be
> enough for you to pinpoint what I am doing wrong.
> Thanks in advance.
If you could provide a small compilable test case, we could compile it
and see the problem. What you should do is create a very small and
complete program that shows the problem. We should be able to compile
it and test it so the problem is obvious. A lot of times (as it already
has been said) it is just something being overlooked in the way the
widgets are packed, etc. A small test case helps pinpoint the problem
if there's one.
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
--
José
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]