Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.sao.ru/cats/~satr/GTK2/sec-viewports.html
Дата изменения: Fri Jul 19 21:49:17 2002
Дата индексирования: Tue Oct 2 02:18:05 2012
Кодировка:

Поисковые слова: http www.sai.msu.su mirrors isn snimages
Viewports

10.8. Viewports

It is unlikely that you will ever need to use the Viewport widget directly. You are much more likely to use the Scrolled Window widget which itself uses the Viewport.

A viewport widget allows you to place a larger widget within it such that you can view a part of it at a time. It uses Adjustments to define the area that is currently in view.

A Viewport is created with the function

GtkWidget *gtk_viewport_new( GtkAdjustment *hadjustment,
                             GtkAdjustment *vadjustment );

As you can see you can specify the horizontal and vertical Adjustments that the widget is to use when you create the widget. It will create its own if you pass NULL as the value of the arguments.

You can get and set the adjustments after the widget has been created using the following four functions:

GtkAdjustment *gtk_viewport_get_hadjustment (GtkViewport *viewport );

GtkAdjustment *gtk_viewport_get_vadjustment (GtkViewport *viewport );

void gtk_viewport_set_hadjustment( GtkViewport   *viewport,
                                   GtkAdjustment *adjustment );

void gtk_viewport_set_vadjustment( GtkViewport   *viewport,
                                   GtkAdjustment *adjustment );

The only other viewport function is used to alter its appearance:

void gtk_viewport_set_shadow_type( GtkViewport   *viewport,
                                   GtkShadowType  type );

Possible values for the type parameter are:

  GTK_SHADOW_NONE,
  GTK_SHADOW_IN,
  GTK_SHADOW_OUT,
  GTK_SHADOW_ETCHED_IN,
  GTK_SHADOW_ETCHED_OUT