| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
GTK Signals, GDK Events. Signals are not events, and events are not signals. A signal is a message emitted by an instance of a GtkObject in response to some predetermined element in its environment, e.g. an action by the end user, or an instruction from a function or method. Signals are always programmed into the code, either internally within GTK or externally by the PHP-GTK programmer. Events, on the other hand, are a continual stream of impulses communicating messages concerning environmental changes in the underlying windowing system. The GTK main loop is made up of this stream of events, among other things. It is not possible to connect a callback function to a GdkEvent directly. Any widget having its own GdkWindow may capture events that are relevant to it. Widgets lacking a GdkWindow - those created with the GTK_NO_WINDOW flag - cannot do so, unless they are housed within a GtkEventBox - a widget created for this specific purpose. There are occasions when it is useful to be able to capture events; one obvious example would be the creation of an instance of GtkToolTips which is triggered when its subject widget captures the GDK_ENTER_NOTIFY event and destroyed when the same widget captures the GDK_LEAVE_NOTIFY event. Although it is not possible to use an event to trigger a callback in the same way as a signal, there are a series of signals derived from GtkWidget collectively known as 'event' signals. These are effectively ways of describing an event in terms of a signal, allowing callbacks to be indirectly triggered through a captured occurrence of most of the GdkEventTypes. The GtkTooltips object itself uses the connect_object method and the generic "event" signal in order to monitor its subject widget. The concept of events is not an easy one to grasp. Please copy, paste and run the following script in order to see the flow of events over a widget in action. 例 2.8. Demonstration of the flow of events across a GtkButton
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「Signals and Events」をGoogle検索
|