tailieunhanh - Beginning Linux Programming Third Edition phần 9

Khi chúng ta muốn thêm một đĩa CD cơ sở dữ liệu, chức năng tiếp theo được gọi khi một nút được nhấp vào hộp thoại CD thêm. Nếu chúng ta nhấp OK, chúng ta sao chép các chuỗi thành một mảng không const char và truyền dữ liệu ở trong đó để add_cd MySQL chức năng giao diện. | Chapter 16 GTK_BUTTONS_YES_NO Are you sure you want to quit result gtk_dialog_run GTK_DIALOG dialog gtk_widget_destroy dialog return result GTK_RESPONSE_YES 4. delete_event_handler is a callback function that we connect to the Gdk delete event of the main window. The event is emitted when we attempt to close a window but critically before the GTK destroy signal is sent. gboolean delete_event_handler GtkWidget window GdkEvent event gpointer data return confirm_exit 5. When we want to add a CD to the database the next function is called when a button is clicked on the add CD dialog. If we clicked on Ok we copy the strings into a non-const char array and pass the data in it to the MySQL interface function add_cd. void addcd_dialog_button_clicked GtkDialog dialog gint response gpointer userdata const gchar artist_const const gchar title_const const gchar catalogue_const gchar artist 200 gchar title 200 gchar catalogue 200 gint cd_id if response GTK_RESPONSE_ACCEPT artist_const gtk_entry_get_text GTK_ENTRY artist_entry title_const gtk_entry_get_text GTK_ENTRY title_entry catalogue_const gtk_entry_get_text GTK_ENTRY catalogue_entry strcpy artist artist_const strcpy title title_const strcpy catalogue catalogue_const add_cd artist title catalogue cd_id addcd_dialog NULL gtk_widget_destroy GTK_WIDGET dialog 670 Programming GNOME Using GTK 6. This is the heart of the application retrieving the search results and populating the GtkTreeView. void on_search_button_clicked GtkButton button gpointer userdata struct cd_search_st cd_res struct current_cd_st cd struct current_tracks_st ct gint res1 res2 res3 gchar track_title 110 const gchar search_string_const gchar search_string 200 gchar search_text 200 gint i 0 j 0 GtkTreeStore tree_store GtkTreeIter parent_iter child_iter memset track_title 0 sizeof track_title 7. Here we get the search string from the entry widget copy into a non-const variable and fetch the matching CD IDs. search_string_const gtk_entry_get_text GTK_ENTRY .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.