Re: Setting the default page to a Notebook at application start time.



Hello,

Here you have, attached to the e-mail.

Joaquim Duran


En/na Robert Caryl ha escrit:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You may want to share your demo program source with us.

Joaquim Duran wrote:
 Dear all,

 I'm interested to show several widgets (one at a time) at the same place
 on the screen. To do that, I've decided to use a Notebook container
 (each widget is set in a page) and setting 'set_show_tabs' to false.
 Also, I'm interested in show the same widget that the user was working
 when he closed the application.

 I've create a demo program: inside a VBox container I've created a
 Notebook object, including others widgets. From the constructor of the
 VBox derived class, 3 pages are added to the notebook. After that, the
 function member 'set_active_page(1)' is called.

When the application starts, always, the page number 0 is shown to the
user.

 Is there any way to implement the described behavior? Doesn't Notebook
 till it has been drawn to the screen?


 Thanks and Best Regards

 Joaquim Duran

 _______________________________________________
 gtkmm-list mailing list
 gtkmm-list gnome org
 http://mail.gnome.org/mailman/listinfo/gtkmm-list



- --
<!-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom:
0.08in } -->

*Robert L. Caryl Jr.*
Fiscal Systems, Inc.
102 Commerce Circle
Madison, AL 35758-2706 USA
256-772-8922 ext. 108

/This e-mail message may contain privileged or confidential
information. If you are not the intended recipient,
you may not disclose, use, disseminate, distribute, copy or relay this
message or attachment in any way.
If you received this e-mail message in error, please return by
forwarding the message and it's attachment
to the sender and then delete the message and it's attachment from
your computer./

/Neither Fiscal Systems, Inc., nor its affiliates, accept any
liability for any errors, omissions, corruption
or viruses in the contents of this message or any attachments that
arise as a result of e-mail transmission./


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGlil9uCj6XIbb5UIRAs3yAJ4jC4FB3SiGnmqW1EXZcpf8PHeRjACgqdMv
lQAnQRR9+JMLggxoNtpAVR4=
=dZXi
-----END PGP SIGNATURE-----


#include <gtkmm.h>

class TestWindow: public Gtk::Window
{
 public:
	TestWindow();
	virtual ~TestWindow();

 protected:
	virtual void onQuitBttnClicked();

 private:
	Gtk::VBox boxVert;

	Gtk::Button quit;
	Gtk::Notebook labels;

	Gtk::Label l1;
	Gtk::Label l2;
	Gtk::Label l3;
};


TestWindow::TestWindow():
  boxVert(), quit("Quit"),
  l1("Label 1"), l2("Label 2"), l3("Label 3")
{
	add(boxVert);
	boxVert.add(labels);
	boxVert.add(quit);

	labels.append_page(l1, "1");
	labels.append_page(l2, "2");
	labels.append_page(l3, "3");

	labels.set_current_page(1);

	quit.signal_clicked().connect( sigc::mem_fun(*this,
    		     &TestWindow::onQuitBttnClicked) );

	show_all_children();
}

TestWindow::~TestWindow()
{

}

void TestWindow::onQuitBttnClicked()
{
	hide();
}


int main(int argc, char *argv[])
{
    Gtk::Main kit(argc, argv);

    TestWindow window;
    Gtk::Main::run(window);
    
    return 0;
}


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