Re: MyEntryBox
- From: Bob Caryl <bob fis-cal com>
- To: jalqadir netscape net
- Cc: gtkmm-list gnome org
- Subject: Re: MyEntryBox
- Date: Mon, 30 Jan 2006 06:31:47 -0600
jalqadir netscape net wrote:
Having a Gtk::Entry is not enough, since this object is always
accompanied by a title.
Thus I am racking my brains trying to figure out how to create a class
that will display a Gtk::Entry with a correspondig title.
To do this I first thought of writing a class that derives from
Gtk::VBox, and add a Gtk::Label for the title, and a Gtk::Entry to it.
Howevery, this approach will live me reimplementing most of the
Gtk::Entry's member funcions in my class, since I will need to have
access to the Gtk::Entry's member function.
My question is, how can I have a class that will display the a title
and an Entry box?
TIA
* You cannot exercise your power to a point of humiliation.
- Jean Chretien
* It's amazing how the small seeds of distrust and misunderstanding
can yield a crop of hate and death...
* If that document has fine printing anywhere, just chuck it in the
garbage
- Jorge Escalante
Ma'assalama! Adiós! bye!
------------------------------------------------------------------------
*Try the New Netscape Mail Today!*
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
------------------------------------------------------------------------
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
Why not do this:
class SuperEntry : public Gtk::VBox
{
public:
MySuperEntry(Glib::ustring labeltext) { label.set_text(labeltext);
pack_start(label); pack_start(entry); }
Gtk::Entry *get_entry(void) const { return &entry; }
Gtk::Label *get_label(void) const ( return &label; }
protected:
Gtk::Label label;
Gtk::Entry entry;
};
Now you can access all the methods of both the label and the entry and
do whatever you need with them. You will probably want to get a bit
more detailed with the constructor (include packing options and such).
Bob
begin:vcard
fn:Robert Caryl
n:Caryl;Robert
org:Fiscal Systems, Inc.
adr:;;102 Commerce Circle;Madison;AL;35758;USA
email;internet:bob fis-cal com
title:Senior Software Design Engineer
tel;work:356-772-8920 X108
x-mozilla-html:TRUE
url:http://www.fis-cal.com
version:2.1
end:vcard
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]