- I have created a gtk scrolled window.
- I had attached a gtk tree view to it
- I have created gtk adjustment for vertical scrolling purpose
- I have created gtk vertical scrollbar and with the adjustment created above.
- I filled the treeview with some data.
- I tried to catch the signal when the scrollbar is moved up or dowm using :
gtk_signal_connect(GTK_OBJECT(vscrollbar), "value_changed",G_CALLBACK(my_function),NULL);
My signal handler looks like below:
void my_function(GtkWidget *widget)
{
printf("Hi\n");
}
As seen above it prints a Hi
whenever the scrollbar is moved one step up or one step down.
But i want to print up
when its moved up or down
when its moved down.
void my_function(GtkWidget *widget)
{
if(/* movement is up, How to identify? */)
printf("UP\n");
if(/* movement is down, How to identify */)
printf("DOWN\n");
}
I am complete new person when it comes to gtk programming. Can anybody please suggest what do i need to do for this?