How to detect the presence of scrollbar on scrolled window.



Does anyone know how to find out whether a vertical scrollbar is present
on scolled window or not.
I need to detect its presence at runtime.
below is the code which i tried to find out.but it is not working as
expected.
line 3 is always returning false.irrespective of vscrollbar presence.

1.  scrolled_window = (GtkScrolledWindow *) gtk_scrolled_window_new
(NULL, NULL);
2.  gtk_scrolled_window_set_policy (scrolled_window, GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);

3.  if (scrolled_window->vscrollbar_visible) {
4.      GtkWidget *widget = gtk_scrolled_window_get_vscrollbar
(scrolled_window);
5.      width = widget->requisition.width;
6.  }

Thanks and Regards,
Amol.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]