Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

howto scroll a gtk.scrolledwindow object from python code

I'm writing a python application that has a glade gui. Using subprocess to execute some shell commands in the background.

Using a glade GUI which has a scrolledwindow widget and a textview widget inside the scrolledwindow widget. The textview gets populated as the subprocess.Popen object run and display their stdout and stderr to this textview.

My problem is that the textview is constantly populated, but stays still @ scroll position 0, 0 (top-most, left-most)

I want this scrolledwindow widget to stays at bottom-most, left-most at all times...

Does anyone have any idea which method I need to call scroll this thing downwards?

like image 225
M0E-lnx Avatar asked Dec 10 '25 22:12

M0E-lnx


1 Answers

You need to get the horizontal and/or vertical gtk.Adjustment from the scrolledwindow, and change its values. See

  • get_vadjustment
  • gtk.Adjustment

The set_all method of gtk.Adjustment is probably what you want.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!