Todor Todorov wrote:
Well, since resizing the widget by itself does not do any scrolling,
whichever value you get from the adjustment _is_ the current scroll
value. In the same way you have the function *_get_upper(), you have
*_get_lower() and *_get_value()... Just change the computation
I don't believe there is a way to get the size before the change. I do
not believe that there is much requirement for that. If you are looking
for a more elegant solution, you would have to reimplement GtkViewport
or GtkScrolledWindow to keep track of the visible view now and before.
Regards,
Todor Todorov wrote:
Bind a callback to the size-allocate signal of the scrolled window:
#include gtk/gtk.h
void cb_autoscroll_to_end( GtkWidget* widget, GtkAllocation* allocation,
gpointer user_data)
{
snip
}
After you create the scroll window in main(), connect like:
Well, since resizing the widget by itself does not do any scrolling,
whichever value you get from the adjustment _is_ the current scroll
value. In the same way you have the function *_get_upper(), you have
*_get_lower() and *_get_value()... Just change the computation however
you need it to
Bind a callback to the size-allocate signal of the scrolled window:
#include gtk/gtk.h
void cb_autoscroll_to_end( GtkWidget* widget, GtkAllocation* allocation,
gpointer user_data)
{
GtkAdjustment*vericalAdjust;
GtkAllocation hscrollAlloc;
GtkWidget *hscrollBar;
Eduardo M KALINOWSKI wrote:
I have a question concerning how to set which part of a GtkTextBuffer is
displayed when a GtkTextView is resized.
To explain the situation, consider this sample code:
8
/* gcc -o tvtest tvtest.c `pkg-config --libs --cflags gtk+-2.0` */
#include gtk/gtk.h
I have a question concerning how to set which part of a GtkTextBuffer is
displayed when a GtkTextView is resized.
To explain the situation, consider this sample code:
8
/* gcc -o tvtest tvtest.c `pkg-config --libs --cflags gtk+-2.0` */
#include gtk/gtk.h
int main(int argc, char *argv[])