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 

Displaying packed widgets

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


Joined: 22 Sep 2005
Posts: 20

PostPosted: Thu Nov 10, 2005 8:17 pm    Post subject: Displaying packed widgets Reply with quote

I have a class that derives from Gtk::VBox, called jme::Contacts; jme::Contacts is in turn used by the jme::MainWin class as one of its attributes, named 'contact'. However, when the object 'contact' is passed to a Gtk::Notebook as one of its tabs:

notebook->append_page(*contacts, "Contacts");

none of the characteristics of the object 'contacts'(Frame and title of the frame) are displayed.

Below is a quick snip of the class in question.
=============
#include <gtkmm/box.h>
#include <gtkmm/frame.h>

namespace jme{

class Contacts : virtual public Gtk::VBox{
private:
void HBox1();
void NameFrame();
protected:

Gtk::HBox* hbox1;
Gtk::Frame* frmName;


public:
Contacts();
virtual ~Contacts();
}; //class
} // namespace
#endif

jme::Contacts::Contacts(){
try{
hbox1 = new Gtk::HBox();
frmName = new Gtk::Frame("Name");
}
catch ( std::bad_alloc & x ) {std::cout << x.what() << std::endl; }

this->NameFrame(); //Add more attributes to the frame

this->HBox1(); // Add objects to this->hbox1
}
void jme::Contacts::NameFrame(){

frmName->add(dynamic_cast<Gtk::Widget&>(*lblFirstName));
}
void jme::Contacts::HBox1(){
hbox1->set_border_width(50);

hbox1->pack_start(*frmName, Gtk::PACK_EXPAND_WIDGET);

hbox1->show_all_children(true);
}
============
Having stated that, after compiling and linking the application using the MinGW-GCC-c++, I get the following message which reads:

Info: resolving Gtk::Stock::APPLY by linking to __imp___ZN3Gtk5Stock5APPLYE (auto-import)
Info: resolving Gtk::Stock::CLOSE by linking to __imp___ZN3Gtk5Stock5CLOSEE (auto-import)
Info: resolving Gtk::Stock::HELP by linking to __imp___ZN3Gtk5Stock4HELPE (auto-import)
===========

Now, I know that ther only part of the program that can cause any of these messages is:
---- snip ---
this->btnApply = new Gtk::Button(Gtk::Stock::APPLY);
this->btnQuit = new Gtk::Button(Gtk::Stock::CLOSE);
this->btnHelp = new Gtk::Button(Gtk::Stock::HELP);
this->notebook = new Gtk::Notebook();
==========

but why would this be causing this err-message?


Please note that I am using WinXP as the developing platform
Thanks for your help folks! you have been very helpful in my GTKmm learning process.
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