forked from AuroraMiddleware/gtk
00fbbe68b0
Thu Nov 5 16:00:32 1998 Lars Hamann <lars@gtk.org> * gtk/gtkclist.h (struct _GtkCList): removed vscrollbar, hscrollbar, vscrollbar_policy, hscrollbar_policy. added h/vadjustment. * gtk/gtkclist.c (gtk_clist_class_init): added new args types "hadjustment" & "vadjustment" (gtk_clist_set_arg) (gtk_clist_get_arg): new object class set/get_arg functions (gtk_clist_construct): don't create/adjust scrollbars. (gtk_clist_set_hadjustment) (gtk_clist_set_vadjustment): new functions to set h/vadjustments (gtk_clist_get_vadjustment) (gtk_clist_get_hadjustment): new functions to query h/vadjustments (create_scrollbars): removed. (create_adjustments): replacement for create_scrollbars (gtk_clist_new): call gtk_clist_new_with_titles (gtk_clist_new_with_titles): don't warn on titles == NULL (move_horizontal): use CLAMP instead (gtk_clist_set_policy): deprecated method. use gtk_scrolled_window_set_policy instead. (vadjustment_value_changed): use clist->vadj. (adjust_scrollbars): renamed to adjust_adjustments (adjust_adjustments): former adjust_scrollbars (gtk_clist_destroy): unref adjustments (gtk_clist_size_allocate) (gtk_clist_map) (title_focus) (gtk_clist_unmap) (gtk_clist_size_request) (gtk_clist_focus) (gtk_clist_size_allocate) (gtk_clist_forall): don't use scrollbars (gtk_clist_thaw) (real_insert_row) (real_remove_row) (gtk_clist_set_row_height) (real_resize_column): call adjust_adjustments (gtk_clist_moveto): return if clist has no adjustments yet. (gtk_clist_parent_set): new GtkWidget::parent_set function. Autogenerate h/vadjustments if needed. (move_horizontal) (move_vertical): some cleanups * gtk/gtkviewport.c (gtk_viewport_set_arg) (gtk_viewport_new): call only gtk_viewport_set_h/vadjustment and let these functions do the work. (gtk_viewport_set_hadjustment) (gtk_viewport_set_vadjustment): generate a new adjustment if needed * gtk/gtkscrolledwindow.h ((struct _GtkScrolledWindow): use a guint bitfield for h/vscrollbar_policy and h/vscrollbar_visible * gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed): queue_resize if visibility of scrollbars changes (gtk_scrolled_window_remove): only call container_remove with scrolled_window->viewport automatically if viewport was autogenerated (gtk_scrolled_window_add): add widget as scrolled_window->viewport. auto create a viewport only if widget does not take h/vadjustments. (gtk_scrolled_window_construct): don't generate a viewport automatically. (gtk_scrolled_window_forall): call callback with viewport in any case (gtk_scrolled_window_set_arg): call gtk_container_add in case of ARG_VIEWPORT (gtk_scrolled_window_size_allocate) (gtk_scrolled_window_size_request) (gtk_scrolled_window_map) (gtk_scrolled_window_unmap): check viewport != NULL * gtk/testgtk.c (create_ctree) (export_ctree) (create_clist): use a scrolled_window in conjunction with clists/ctrees * gtk/gtkfilesel.c (gtk_file_selection_init): use a scrolled_window in conjunction with clists * gtk/gtkfontsel.c (gtk_font_selection_init): use a scrolled_window in conjunction with clists
86 lines
2.9 KiB
C
86 lines
2.9 KiB
C
/* GTK - The GIMP Toolkit
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
#ifndef __GTK_SCROLLED_WINDOW_H__
|
|
#define __GTK_SCROLLED_WINDOW_H__
|
|
|
|
|
|
#include <gdk/gdk.h>
|
|
#include <gtk/gtkhscrollbar.h>
|
|
#include <gtk/gtkvscrollbar.h>
|
|
#include <gtk/gtkviewport.h>
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
#define GTK_TYPE_SCROLLED_WINDOW (gtk_scrolled_window_get_type ())
|
|
#define GTK_SCROLLED_WINDOW(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindow))
|
|
#define GTK_SCROLLED_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindowClass))
|
|
#define GTK_IS_SCROLLED_WINDOW(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_SCROLLED_WINDOW))
|
|
#define GTK_IS_SCROLLED_WINDOW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SCROLLED_WINDOW))
|
|
|
|
|
|
typedef struct _GtkScrolledWindow GtkScrolledWindow;
|
|
typedef struct _GtkScrolledWindowClass GtkScrolledWindowClass;
|
|
|
|
struct _GtkScrolledWindow
|
|
{
|
|
GtkContainer container;
|
|
|
|
GtkWidget *viewport;
|
|
GtkWidget *hscrollbar;
|
|
GtkWidget *vscrollbar;
|
|
|
|
guint hscrollbar_policy : 2;
|
|
guint vscrollbar_policy : 2;
|
|
guint hscrollbar_visible : 1;
|
|
guint vscrollbar_visible : 1;
|
|
guint autogenerated_viewport : 1;
|
|
};
|
|
|
|
struct _GtkScrolledWindowClass
|
|
{
|
|
GtkContainerClass parent_class;
|
|
|
|
gint scrollbar_spacing;
|
|
};
|
|
|
|
|
|
GtkType gtk_scrolled_window_get_type (void);
|
|
GtkWidget* gtk_scrolled_window_new (GtkAdjustment *hadjustment,
|
|
GtkAdjustment *vadjustment);
|
|
void gtk_scrolled_window_construct (GtkScrolledWindow *scrolled_window,
|
|
GtkAdjustment *hadjustment,
|
|
GtkAdjustment *vadjustment);
|
|
GtkAdjustment* gtk_scrolled_window_get_hadjustment (GtkScrolledWindow *scrolled_window);
|
|
GtkAdjustment* gtk_scrolled_window_get_vadjustment (GtkScrolledWindow *scrolled_window);
|
|
void gtk_scrolled_window_set_policy (GtkScrolledWindow *scrolled_window,
|
|
GtkPolicyType hscrollbar_policy,
|
|
GtkPolicyType vscrollbar_policy);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
#endif /* __GTK_SCROLLED_WINDOW_H__ */
|