[Java-gnome-developer] auto-scroll in ScrolledWindow
Brought to you by:
afcowie
From: Manuel C. <ll...@us...> - 2006-04-28 14:54:54
|
Hi all, Here is how I got auto-scroll working. By auto-scroll, I mean the (vertical) scrollbar automatically move when a hidden widget gets focus, so you can *automatically* view that widget instead of manually doing the scroll. How it should work: vbox.setFocusVAdjustment(scrolledWindow.getVAdjustment()); setFocusVAdjustment() is missing in java-gnome (Container class). This is clumsy, but it works _now_: // since the method is protected, extend the class to reveal it public class Container2 extends Container { // constructor ignored public static void gtk_container_set_focus_vadjustment2(Handle a, Handle b) { gtk_container_set_focus_vadjustment(a, b); } } // code in the program Container2.gtk_container_set_focus_vadjustment2(vbox1.getHandle(), scrolledWindow.getVAdjustment().getHandle()); ... and it works! really ;) Hope it helps! |