custom control and showing



The show() function is not virtual so can't be overridden to do what I want. I thought maybe on_show() would but it isn't. I subclassed HBox and when that item is shown I want to show all the children associated with the new control. Here is the code for that control, show() is called and the debugger steps into my function...it just doesn't show the controls. How do I do what I am trying to do?


#include "InputField.h"

struct InputField::impl
{
 Gtk::Label pre_label;
 Gtk::Label post_label;
 Gtk::Entry input_entry;
 InputField * field;

 impl(std::string const& pre, std::string const& post, InputField * f)
   : pre_label(pre), post_label(post), field(f)
 {
   field->pack_start(pre_label);
   field->pack_start(input_entry);
   field->pack_start(post_label);
 }
};

InputField::InputField(std::string const& pre_label, std::string const& post_label)
: pimpl(new impl(pre_label, post_label, this))
{
}

InputField::~InputField() {}

void InputField::on_show()
{
 show_all_children();
}



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