The OpenNET Project
 
Поиск (ключи):    ПРОГРАММЫ СТАТЬИ СОВЕТЫ ФОРУМ
  WIKI НОВОСТИ (+) MAN'ы ДОКУМЕНТАЦИЯ

Каталог документации / Раздел "Программирование, языки" / Оглавление документа

Migrating from GtkFileSelection to GtkFileChooser

Federico Mena-Quintero

Creating a GtkFileChooserDialog
Selection Modes
Installing a Preview widget
Installing Extra Widgets
New features

GtkFileChooser, starting with GTK+ 2.4, is the new set of APIs for file selection widgets and dialogs. Previous versions of GTK+ used GtkFileSelection, which has numerous problems.

GtkFileChooser is an abstract interface that can be implemented by widgets that perform file selection tasks. Two widgets in GTK+ implement this interface: GtkFileChooserDialog and GtkFileChooserWidget. Most applications simply need to use GtkFileChooserDialog, which is a dialog box that allows the user to select existing files for opening them, or to pick new filenames for saving documents. GtkFileChooserWidget is for special applications that need to embed a file selection widget inside a larger window. In the context of GTK+, GtkFileChooserDialog is simply a GtkDialog box with a GtkFileChooserWidget. inside.

Creating a GtkFileChooserDialog

To create a GtkFileChooserDialog, you simply call gtk_file_chooser_dialog_new(). This function is similar to gtk_dialog_new() in that it takes parameters for the title of the dialog box and its transient parent, as well as its buttons. In addition, it takes in an argument that determines whether the file chooser dialog will be used for opening existing files or for saving to a possibly new file.

Please see Example 7, “Typical usage” for how to create a simple file chooser dialog and extract the selected filename from it.


ПОДПИШИСЬ НА ЖУРНАЛ Linux Format 2012!

Журнал "Linux Format" (Линукс Формат)- Единственный в России и странах СНГ журнал на русском языке, посвящённый Linux и свободному ПО. Журнал для IT-директоров, IT-менеджеров, программистов, системных администраторов, учителей школ и преподавателей ВУЗов и всех пользователей ПК. В каждом выпуске: Новости индустрии OpenSource, обзоры новинок свободного ПО, обучающие и методические статьи.

Каждый, кто оформит подписку, получает бонусы и подарки- объёмные наклейки на системный блок, диск с архивом номеров за 2005-2011 г.г. и ежемесячно электронную версию журнала в pdf-формате.

Оформить подписку на год


  Закладки на сайте
  Проследить за страницей
Created 1996-2012 by Maxim Chirkov  
ДобавитьРекламаВебмастеруГИД  
RUNNet TopList