[gtkmm] Gtk::Table help



Hi there,

I decided it would be better to post the code and maybe someone could
tell me whats up, if you read my last email, you will see the error I am
getting, this is the code I have written to use a table layout:

LoginForm::LoginForm()
{
	// Create Table Layout
	l_table = Gtk::manage(new Table(3,2));
	add(*l_table);

	// Create Login Button
	l_button = Gtk::manage(new Gtk::Button("Login"));

	// Create Login Labels
	Label *lusername = Gtk::manage(new Gtk::Label("Username:"));
	Label *lpassword = Gtk::manage(new Gtk::Label("Password:"));

	// Create Entry Fields
	l_i_username = Gtk::manage(new Gtk::Entry());
	l_i_password = Gtk::manage(new Gtk::Entry());

	// Configure Entry Fields
	l_i_username->set_max_length(20);
	l_i_password->set_max_length(20);
	l_i_password->set_visibility(false);
	l_i_password->set_invisible_char('*');

	// Add Item to table
	l_table->attach(*lusername, 2, 1, 2, 1);
	l_table->attach(*lpassword, 2, 1, 1, 2);

}

Ian




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