1 / 5

Kwangwoo Choi Department of Physics Kangwon National University

Event Handling in Glade. Kwangwoo Choi Department of Physics Kangwon National University. • Signals are a way to get notification when something happens and to customize object behavior according to the user's needs. • Every signal is uniquely identified by a name,

selmaf
Download Presentation

Kwangwoo Choi Department of Physics Kangwon National University

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Event Handling in Glade Kwangwoo Choi Department of Physics Kangwon National University • Signals are a way to get notification when something happens and to customize object behavior according to the user's needs. • Every signal is uniquely identified by a name, “Class_name::Signal_name”, where Signal_name might be something like “clicked”.

  2. Basic Terminology • signal • A class method, e.g. GtkButton::clicked. More precisely it is a unique class-branch/signal-name pair. This means you may not define a signal handler for a class which derives from GtkButton that is called clicked, but it is okay to share signals names if they are separate in the class tree. • default handler • The object's internal method which is invoked when the signal is emitted. • user-defined handler • A function pointer and data connected to a signal (for a particular object). • There are really two types: those which are connected normally, and those which are connected by one of the connect_after functions. • emission • the whole process of emitting a signal, including the invocation of all the different handler types mentioned above. • signal id • The unique positive (nonzero) integer used to identify a signal. It can be used instead of a name to many functions for a slight performance improvement.

  3. Use the “delete_event” Delete_event: close Windows

  4. Click “Add” • Gboolean • on_window1_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data) • { • gtk_exit( 0 ); • return FALSE; • }

  5. Summary • Signals are a way to get notification when something user's happens and to customize object behavior according to the needs.

More Related