Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Notebook element and TextView elements inside them. Because the pages on the notebook will be constantly switched between. I need to be able to have in a variable the currently selected TextView's buffer. How would I do this?

share|improve this question
Although Sam has answered your question correctly, your question is more suitable at – Rrjrjtlokrthjji Jun 22 '12 at 18:34
@Nick, Why is it not appropriate here? AskUbuntu is suggested at (and informally elsewhere) as a source of help for Ubuntu app developers. – monotasker Aug 9 '12 at 13:29
You are correct. – Rrjrjtlokrthjji Aug 9 '12 at 13:54
up vote 4 down vote accepted

You can use

pageNum = notebook.get_current_page()

which will give you the current page number. and use

textview = notebook.get_nth_page(pageNum)

to get the widget on that page.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.