1. Trang chủ
  2. » Công Nghệ Thông Tin

apress foundations_of gtk plus development 2007 phần 10 pptx

76 463 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 76
Dung lượng 1,91 MB

Nội dung

544 APPENDIX B ■ GTK+ SIGNALS Table B-34. GtkMenuItem Signals Table B-35. GtkMenuShell Signals Signal Name Additional Parameters Description activate None The menu item was activated. If you need to catch activation of a submenu, you should use the activate-item signal. activate-item None The menu item was activated, or the menu item has a sub- menu that was activated. toggle-size-allocate gint new_size The menu item was allo- cated with a new size. toggle-size-request gpointer size The menu item requested a new size. Signal Name Additional Parameters Description activate-current gboolean force_hide Activate the current menu item contained by GtkMenuShell. cancel None Cancel the selection of the selected menu item. This will cause the selection- done signal to be emitted. cycle-focus GtkDirectionType type The focus moved to another menu bar in the given direction. deactivate None The GtkMenuShell was deacti- vated, which usually means that it was erased from the screen. move-current GtkMenuDirectionType type The current menu item moved within the menu shell in the given direction. selection-done None The selection within the menu shell was completed. 7931.book Page 544 Wednesday, March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS 545 Table B-36. GtkMenuToolButton Signals Table B-37. GtkNotebook Signals Table B-38. GtkObject Signals Signal Name Description show-menu This signal is emitted right before the menu is shown, giving you a chance to update it before the user sees it. Signal Name Additional Parameters Description change-current-page gint pages_moved The page currently shown by GtkNotebook was changed. focus-tab GtkNotebookTab type The focus was moved by changing the current tab. The callback function returns TRUE if the signal was handled. move-focus-out GtkDirectionType type The focus was moved out of the GtkNotebook widget in the given direction. page-added GtkWidget *child guint page_num A page was added to the GtkNotebook widget. This sig- nal was added in GTK+ 2.10. page-removed GtkWidget *child guint page_num A page was removed from the GtkNotebook widget. This sig- nal was added in GTK+ 2.10. page-reordered GtkWidget *child guint page_num The GtkNotebook widget pages were reordered. This signal was added in GTK+ 2.10. select-page gboolean focus_moved A new page was selected for the child widget. The call- back function returns TRUE if the signal was handled. switch-page GtkNotebookPage *page guint page_num The notebook page was changed to the given page. Signal Name Description destroy When the GtkObject widget has released all of its references, it will be destroyed. This will result in finalization of the object when you release all of the references. 7931.book Page 545 Wednesday, March 14, 2007 8:28 PM 546 APPENDIX B ■ GTK+ SIGNALS Table B-39. GtkPaned Signals Signal Name Additional Parameters Description accept-position None Resizing of the pane was com- pleted, and the user pressed the Return key, Enter key, or space bar. This signal will give focus and activate the child widget. The callback function should return TRUE if the sig- nal was handled. cancel-position None Resizing the pane was stopped, because the user pressed the Escape key to cancel the change. The call- back function should return TRUE if the signal was handled. cycle-child-focus gboolean reversed The user changed the child focus by pressing F6 or Shift+F6 while the GtkPaned widget had focus. The call- back function returns TRUE if the signal was handled. cycle-handle-focus gboolean reversed If the GtkPaned widget had focus and the user presses Tab, Ctrl+Tab, Shift+Tab, or Ctrl+Shift+Tab, the signal is emitted. The callback func- tion should return TRUE if the signal was handled. move-handle GtkScrollType type The handle was moved, and one of the following keys was pressed while it was in focus: Left, Right, Up, Down, Page Up, Page Down, Home, or End. The callback function should return TRUE if the sig- nal was handled. toggle-handle-focus None The GtkPaned widget was within focus, and F8 was pressed to give or take away focus from the handle. The callback function should return TRUE if the signal was handled. 7931.book Page 546 Wednesday, March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS 547 Table B-40. GtkPlug Signals Table B-41. GtkPrinter Signals Table B-42. GtkPrintJob Signals Table B-43. GtkPrintOperation Signals Signal Name Description embedded The GtkPlug window was assigned to the socket window as its parent. GtkPlug allows top-level widgets to be embedded into other processes. Signal Name Additional Parameters Description details-acquired gboolean success Detailed information about the printer was requested from the print backend. Signal Name Description status-changed The current status of the print job changed. You should use gtk_print_ job_get_status() to check the new status of the print job. Signal Name Additional Parameters Description begin-print GtkPrintContext *context The user just finished chang- ing printer settings but rendering has not yet begun. create-custom-widget None The dialog was just dis- played. You can return a widget or a container widget containing multiple widgets from the callback function so that it will be added as a custom page to the dialog’s GtkNotebook. custom-widget-apply GtkWidget *widget Right before begin-print is emitted, this signal is emit- ted if a custom widget was added in the create-custom- widget signal handler. Continued 7931.book Page 547 Wednesday, March 14, 2007 8:28 PM 548 APPENDIX B ■ GTK+ SIGNALS Table B-43. Continued Signal Name Additional Parameters Description done GtkPrintOperationResult result Printing completed, and you can now view the result. You should use gtk_print_ operation_get_error() to check the error message if the result was GTK_PRINT_ OPERATION_RESULT_ERROR. draw-page GtkPrintContext *context gint page_num Each page must be con- verted into a Cairo context. You can use this callback to render a page manually. end-print GtkPrintContext *context All of the pages were rendered. paginate GtkPrintContext *context This signal is emitted after begin-print but before page rendering begins. It will con- tinue to be emitted until FALSE is returned or until it is not handled. This allows you to split the document into pages in steps so that the user interface is not notice- ably blocked. preview GtkPrintOperationPreview *preview GtkPrintContext *context GtkWindow *parent The user requested a pre- view of the document from the main printing dialog. This signal allows you to create your own preview dialog. If this signal is not handled, the default handler will be used. The callback function returns TRUE if you are handling the print preview. request-page-setup GtkPrintContext *context gint page_num GtkPageSetup *setup This signal is emitted for every page, which gives you one last chance to edit the setup of a page before it is printed. Any changes will be applied to only the current page! status-changed None The status of the print operation changed. Possible values are defined by the GtkPrintStatus enumer- ation, and the current value can be retrieved with gtk_print_operation_get_ status(). 7931.book Page 548 Wednesday, March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS 549 Table B-44. GtkRadioAction Signals Table B-45. GtkRadioButton and GtkRadioMenuItem Signals Table B-46. GtkRange Signals Table B-47. GtkScale Signals Signal Name Additional Parameters Description changed GtkRadioAction *current The states of two radio but- tons in a group were changed. This signal is emitted on every member of a radio group when the selection is changed. Signal Name Description group-changed The radio button switched to a new group, or it was removed from a radio group altogether. Signal Name Additional Parameters Description adjust-bounds gdouble value The bounds of a GtkRange were altered by some type of user action. change-value GtkScrollType type gdouble value The current value of the range was changed. You can pre- vent the range from being updated by returning TRUE, but you will have to manually round the displayed value to the desired number of deci- mal places. move-slider GtkScrollType type The user pressed a keyboard key such as Page Up, Page Down, Home, End, or an arrow key that caused the slider to move. value-changed None The range value was changed. This can be caused by user action or a call within your code. Signal Name Additional Parameters Description format-value gdouble value A scale is about to be dis- played, but GTK+ first gives you an opportunity to cus- tomize how it is displayed. The callback function returns a customized string display- ing the value created by you. 7931.book Page 549 Wednesday, March 14, 2007 8:28 PM 550 APPENDIX B ■ GTK+ SIGNALS Table B-48. GtkScrolledWindow Signals Table B-49. GtkSocket Signals Table B-50. GtkSpinButton Signals Signal Name Additional Parameters Description move-focus-out GtkDirectionType type The user moved focus from the scrolled window by press- ing Ctrl+Tab or Ctrl+Shift+Tab. The given direction is always either GTK_DIR_TAB_FORWARD or GTK_DIR_TAB_BACKWARD. scroll-child GtkScrollType type gboolean horizontal The child widget was scrolled in one direction. This could be caused by the mouse or one of the following default key bindings: Ctrl+Left, Ctrl+Right, Ctrl+Up, Ctrl+Down, Ctrl+Page Up, Ctrl+Page Down, Page Up, Page Down, Ctrl +Home, Ctrl+End, Home, or End. Signal Name Description plug-added A client was successfully added to the socket. plug-removed A client was removed from the socket. Usually, you will want to destroy the GtkSocket widget, which is the default. To prevent this, you can return TRUE from the callback function. Signal Name Additional Parameters Description change-value GtkScrollType type The displayed value of the spin button was changed. This was done by pressing one of the following keyboard bindings: Up, Down, Page Up, Page Down, Ctrl+Page Up, or Ctrl+Page Down. input gpointer value The displayed value was changed. output None The displayed value of the spin button was changed by either setting a new value or changing the digits property of a realized widget. You should return TRUE if you suc- cessfully handle the signal so that no further action is taken. 7931.book Page 550 Wednesday, March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS 551 Table B-51. GtkStatusbar Signals Table B-52. GtkStatusIcon Signals value-changed None Any one of the properties that require the spin button value to be changed (e.g., value or digits) of the spin button was changed. wrapped None The spin button wrapped from the maximum to the minimum value or vice versa. This signal was introduced in GTK+ 2.10. Signal Name Additional Parameters Description text-popped guint context_id gchar *message The top message was removed from the status bar’s stack. The next mes- sage will be displayed. text-pushed guint context_id gchar *message A message was added to the top of the status bar’s stack. Signal Name Additional Parameters Description activate None The status icon was acti- vated. How the status icon was activated is dependent on the user’s platform. In any case, you should take appro- priate action. popup-menu guint button guint activate_time The pop-up menu of the status icon was shown. The function parameters can be passed to gtk_menu_ popup(). The pop-up menu feature is not available on every platform, so you should always provide alter- native functionality! size-changed gint size The area available to the sta- tus icon was changed. The callback function returns TRUE if you scaled the icon. Otherwise, GTK+ will take care of scaling for you. Signal Name Additional Parameters Description 7931.book Page 551 Wednesday, March 14, 2007 8:28 PM 552 APPENDIX B ■ GTK+ SIGNALS Table B-53. GtkTextBuffer Signals Table B-54. GtkTextTag Signals Signal Name Additional Parameters Description apply-tag GtkTextTag *tag GtkTextIter *start GtkTextIter *end A GtkTextTag widget was applied to a section of the text buffer. begin-user-action None The user began some type of action on the text buffer. changed None The text buffer was changed in some way, which resulted in a change of visible or invis- ible text, images, or widgets. delete-range GtkTextIter *start GtkTextIter *end Text was deleted from the text buffer. end-user-action None Some type of user action on the text buffer ended. insert-child-anchor GtkTextIter *location GtkTextChildAnchor *anchor An anchor was inserted, which allows the text buffer to contain other widgets. insert-pixbuf GtkTextIter *location GdkPixbuf *pixbuf A GdkPixbuf object was inserted into the text buffer. insert-text GtkTextIter *location gchar *new_text gint text_length Text was inserted into the text buffer. mark-deleted GtkTextMark *mark A GtkTextMark object was deleted from the text buffer. mark-set GtkTextIter *location GtkTextMark *mark A GtkTextMark object was added to the text buffer. modified-changed None The text buffer was set as modified or unmodified. remove-tag GtkTextTag *tag GtkTextIter *start GtkTextIter *end A tag was removed from the text buffer between the given iterators. Signal Name Additional Parameters Description event GObject *object GdkEvent *event GtkTextIter *location An event occurred that was within the range of the text encompassed by GtkTextTag. 7931.book Page 552 Wednesday, March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS 553 Table B-55. GtkTextTagTable Signals Table B-56. GtkTextView Signals Signal Name Additional Parameters Description tag-added GtkTextTag *tag A GtkTextTag object was added to the tag table. tag-changed GtkTextTag *tag gboolean size_changed A property of a tag contained by the tag table was changed. The size of the displayed text can be changed by other prop- erties besides the size, such as weight and font family. tag-removed GtkTextTag *tag A GtkTextTag object was removed from the tag table. Signal Name Additional Parameters Description backspace None One character was deleted from the document from behind the cursor. copy-clipboard None Selected text was copied to the clipboard. cut-clipboard None Selected text was copied to the clipboard and removed from the document. delete-from-cursor GtkDeleteType type gint length Text was deleted from around the cursor. insert-at-cursor gchar *text Text was inserted at the cur- rent cursor position. move-cursor GtkMovementStep step gint num_steps gboolean extended The cursor was moved to a new position, possibly extend- ing the current selection. move-focus GtkDirectionType type Focus has been moved in the given direction. move-viewport GtkScrollStep step gint num_steps Some type of scrolling occurred, which is described by the given step. paste-clipboard None Text from the clipboard was inserted into the document. Continued 7931.book Page 553 Wednesday, March 14, 2007 8:28 PM [...]... 556 Wednesday, March 14, 2007 8:28 PM 556 APPENDIX B ■ GTK+ SIGNALS Table B-61 GtkTreeModel Signals Signal Name Additional Parameters Description row-changed GtkTreePath *path GtkTreeIter *iter A row in the tree model at the given location was changed row-deleted GtkTreePath *path A row was removed from the tree model at the given location row-has-child-toggled GtkTreePath *path GtkTreeIter *iter A row... Ctrl+F1 Help types are defined by GtkWidgetHelpType, which is composed of GTK_ WIDGET_ HELP_TOOLTIP and GTK_ WIDGET_ HELP_WHATS_THIS size-allocate GtkAllocation *alloc The widget was given a new size allocation size-request GtkRequisition *req The widget requested a new size by using gtk_ widget_ set_size_request() 7931.book Page 563 Wednesday, March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS Signal Name Additional... include gtk- menu, gtk- small-toolbar, gtk- large-toolbar, gtk- button, and gtk- dialog The asterisk (*) character can be used as a wildcard for any of the last three parameters Example: stock["myitem"] = { "myitem.png", LTR, NORMAL, "gtkmenu" } text[state] Set the text color for widgets such as GtkEntry Example: fg[PRELIGHT] = { 0, 65535, 0 } xthickness Set horizontal padding for various values in GTK+ This... Wednesday, March 14, 2007 8:28 PM 572 APPENDIX C ■ GTK+ STYLES Table C-3 Continued Property Type Description weight gint Font weight, set as PANGO_WEIGHT_ULTRALIGHT, PANGO_WEIGHT_LIGHT, PANGO_WEIGHT_NORMAL, PANGO_WEIGHT_SEMIBOLD, PANGO_WEIGHT_BOLD, PANGO_WEIGHT_ULTRABOLD, or PANGO_WEIGHT_HEAVY wrap-mode GtkWrapMode The wrap mode, set as GTK_ WRAP_NONE, GTK_ WRAP_CHAR, GTK_ WRAP_WORD, or GTK_ WRAP_WORD_CHAR... background color Continued 569 7931.book Page 570 Wednesday, March 14, 2007 8:28 PM 570 APPENDIX C ■ GTK+ STYLES Table C-3 Continued Property Type Description background-stipple GdkPixmap A bitmap to draw as the background of the widget direction GtkTextDirection The default text direction, set as GTK_ TEXT_DIR_NONE, GTK_ TEXT_DIR_LTR, or GTK_ TEXT_DIR_RTL editable gboolean Indicates whether the text can... add-widget GtkWidget *widget A menu bar or toolbar was generated This signal is not emitted for pop-up menus, so you will have to use gtk_ ui_manager_get_widget() to retrieve those connect-proxy GtkAction *action GtkWidget *proxy A proxy was connected to an action within the group You can use this signal for customizations that are used by many actions disconnect-proxy GtkAction *action GtkWidget *proxy... inner-border GtkBorder The number of pixels of padding to place between the GtkEntry widget’s text and its edges Table C-13 GtkExpander Style Properties Property Type Description expander-size gint The size of the expander’s arrow in pixels expander-spacing gint Padding to place around the expander’s arrow in pixels 7931.book Page 575 Wednesday, March 14, 2007 8:28 PM APPENDIX C ■ GTK+ STYLES Table C-14 GtkIconView... shadow-type GtkShadowType The type of shadow to draw around the status bar’s content By default, the shadow type is GTK_ SHADOW_IN 7931.book Page 579 Wednesday, March 14, 2007 8:28 PM APPENDIX C ■ GTK+ STYLES Table C-28 GtkTextView Style Properties Property Type Description error-underline-color GdkColor The color that will be used to draw underlines below text marked with errors Table C-29 GtkToolbar... returns TRUE if the signal was handled move-focus GtkDirectionType type This signal is used internally by GTK+ to move the focused item and cannot be used in application code orientation-changed GtkOrientation dir The orientation of the toolbar was changed to horizontal or vertical 7931.book Page 555 Wednesday, March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS Signal Name Additional Parameters Description... default RC file styles that are supported as of GTK+ 2 .10 Some of the style descriptions also include examples of how they are implemented 565 7931.book Page 566 Wednesday, March 14, 2007 8:28 PM 566 APPENDIX C ■ GTK+ STYLES Table C-1 RC File Styles Style Description base[state] Set the background color of widgets that allow text to be edited (e.g., GtkEntry) in one of the five states Example: base[ACTIVE] . March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS 549 Table B-44. GtkRadioAction Signals Table B-45. GtkRadioButton and GtkRadioMenuItem Signals Table B-46. GtkRange Signals Table B-47. GtkScale. 2 .10. page-removed GtkWidget *child guint page_num A page was removed from the GtkNotebook widget. This sig- nal was added in GTK+ 2 .10. page-reordered GtkWidget *child guint page_num The GtkNotebook. 546 Wednesday, March 14, 2007 8:28 PM APPENDIX B ■ GTK+ SIGNALS 547 Table B-40. GtkPlug Signals Table B-41. GtkPrinter Signals Table B-42. GtkPrintJob Signals Table B-43. GtkPrintOperation Signals Signal

Ngày đăng: 05/08/2014, 10:20

TỪ KHÓA LIÊN QUAN