static void smart_tab_switching_on_closure (CeditNotebook *nb, CeditTab *tab) { gboolean jump_to; jump_to = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tab), "jump_to")); if (!jump_to || !nb->priv->focused_pages) { gtk_notebook_next_page (GTK_NOTEBOOK (nb)); } else { GList *l; GtkWidget *child; int page_num; /* activate the last focused tab */ l = g_list_last (nb->priv->focused_pages); child = GTK_WIDGET (l->data); page_num = gtk_notebook_page_num (GTK_NOTEBOOK (nb), child); gtk_notebook_set_current_page (GTK_NOTEBOOK (nb), page_num); } }
gint main_window_key_press_event(GtkWidget *widget, GdkEventKey *event,gpointer user_data) { if (main_window.notebook_editor != NULL) { check_externally_modified(document_manager_get_current_document(main_window.docmg)); if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK))==(GDK_CONTROL_MASK | GDK_SHIFT_MASK)) && (event->keyval == GDK_ISO_Left_Tab)) { // Hack, for some reason when shift is held down keyval comes through as GDK_ISO_Left_Tab not GDK_Tab if (gtk_notebook_get_current_page(GTK_NOTEBOOK(main_window.notebook_editor)) == 0) { gtk_notebook_set_current_page(GTK_NOTEBOOK(main_window.notebook_editor), gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_window.notebook_editor))-1); } else { gtk_notebook_prev_page(GTK_NOTEBOOK(main_window.notebook_editor)); } return TRUE; } else if ((event->state & GDK_CONTROL_MASK)==GDK_CONTROL_MASK && (event->keyval == GDK_Tab)) { if (gtk_notebook_get_current_page(GTK_NOTEBOOK(main_window.notebook_editor)) == gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_window.notebook_editor))-1) { gtk_notebook_set_current_page(GTK_NOTEBOOK(main_window.notebook_editor),0); } else { gtk_notebook_next_page(GTK_NOTEBOOK(main_window.notebook_editor)); } return TRUE; } else if ((event->state & GDK_MOD1_MASK)==GDK_MOD1_MASK && ((event->keyval >= GDK_0) && (event->keyval <= GDK_9))) { gtk_notebook_set_current_page(GTK_NOTEBOOK(main_window.notebook_editor),event->keyval - ((event->keyval == GDK_0) ? (GDK_0 - 9) : (GDK_0 + 1))); return TRUE; } } return FALSE; }
static void mainwindow_next_tab(GtkWidget *widget, gpointer user_data) { if(gtk_notebook_get_current_page(tabbar) == (tabcount - 1)) gtk_notebook_set_current_page(tabbar, 0); else gtk_notebook_next_page(tabbar); activetab = gtk_notebook_get_current_page(tabbar); mainwindow_focus_terminal(); }
/* Move to the next tab in the GtkNotebook. */ static void next_tab (GtkButton *button, GtkNotebook *notebook) { if (gtk_notebook_get_current_page (notebook) == 3) gtk_notebook_set_current_page (notebook, 0); else gtk_notebook_next_page (notebook); }
/* Switches to the next page. * Nothing happens if the current page is the last page. */ int clip_GTK_NOTEBOOKNEXTPAGE(ClipMachine * cm) { C_widget *cntb = _fetch_cw_arg(cm); CHECKCWID(cntb,GTK_IS_NOTEBOOK); gtk_notebook_next_page(GTK_NOTEBOOK(cntb->widget)); return 0; err: return 1; }
/* Response signal handler. This function is needed because GtkDialog's * handler for this signal closes the dialog and we don't want that, we * want to change pages and, dimm certain response buttons. Overriding the * virtual function would not work because that would be called after the * signal handler implemented by GtkDialog. * FIXME: There is a much saner way to do that [MDK] */ static void response (HildonWizardDialog *wizard_dialog, gint response_id, gpointer unused) { HildonWizardDialogPrivate *priv = HILDON_WIZARD_DIALOG_GET_PRIVATE (wizard_dialog); GtkNotebook *notebook = priv->notebook; gint current = 0; gint last = gtk_notebook_get_n_pages (notebook) - 1; gboolean is_first, is_last; g_assert (priv); current = gtk_notebook_current_page (notebook); switch (response_id) { case HILDON_WIZARD_DIALOG_PREVIOUS: --current; is_last = (current == last); is_first = (current == 0); make_buttons_sensitive (wizard_dialog, !is_first, !is_first, !is_last); gtk_notebook_prev_page (notebook); /* go to previous page */ break; case HILDON_WIZARD_DIALOG_NEXT: if (!priv->forward_function || (*priv->forward_function) (priv->notebook, current, priv->forward_function_data)) { ++current; is_last = (current == last); is_first = (current == 0); make_buttons_sensitive (wizard_dialog, !is_first, !is_first, !is_last); gtk_notebook_next_page (notebook); /* go to next page */ } break; case HILDON_WIZARD_DIALOG_FINISH: return; } current = gtk_notebook_get_current_page (notebook); is_last = current == last; is_first = current == 0; /* Don't let the dialog close */ g_signal_stop_emission_by_name (wizard_dialog, "response"); /* New page number may appear in the title, update it */ if (priv->autotitle) create_title (wizard_dialog); }
void _xedit_cmd_documents_next_document (GtkAction *action, XeditWindow *window) { GtkNotebook *notebook; xedit_debug (DEBUG_COMMANDS); notebook = GTK_NOTEBOOK (_xedit_window_get_notebook (window)); gtk_notebook_next_page (notebook); }
void _pluma_cmd_documents_next_document (GtkAction *action, PlumaWindow *window) { GtkNotebook *notebook; pluma_debug (DEBUG_COMMANDS); notebook = GTK_NOTEBOOK (_pluma_window_get_notebook (window)); gtk_notebook_next_page (notebook); }
static void fdriverchooser_next_clicked (GtkWidget * widget, TFDRIVERCHOOSER * choose_t) { if (choose_t) { gint page = gtk_notebook_get_current_page(GTK_NOTEBOOK (choose_t->tab_panel)); if (page == 2) /* Last Page */ fdriverchooser_finish_clicked (widget, choose_t); else gtk_notebook_next_page (GTK_NOTEBOOK (choose_t->tab_panel)); } }
void _gedit_cmd_documents_next_document (GSimpleAction *action, GVariant *parameter, gpointer user_data) { GeditWindow *window = GEDIT_WINDOW (user_data); GtkNotebook *notebook; gedit_debug (DEBUG_COMMANDS); notebook = GTK_NOTEBOOK (_gedit_window_get_notebook (window)); gtk_notebook_next_page (notebook); }
static void save_merged(GtkWidget *widget, gpointer data) { save_script(); gtk_notebook_next_page(GTK_NOTEBOOK(notebook)); while(gtk_events_pending()) gtk_main_iteration(); sleep(5); gtk_notebook_prev_page(GTK_NOTEBOOK(notebook)); gtk_notebook_prev_page(GTK_NOTEBOOK(notebook)); gtk_notebook_prev_page(GTK_NOTEBOOK(notebook)); gtk_notebook_prev_page(GTK_NOTEBOOK(notebook)); }
void tabwin_navigate (windata_t *vwin, guint key) { tabwin_t *tabwin = vwin_get_tabwin(vwin); GtkNotebook *notebook = GTK_NOTEBOOK(tabwin->tabs); if (key == GDK_less || key == GDK_Page_Up) { gtk_notebook_prev_page(notebook); } else if (key == GDK_greater || key == GDK_Page_Down) { gtk_notebook_next_page(notebook); } else { /* numeric value, 1 to 9 */ gtk_notebook_set_current_page(notebook, key - 1); } }
gboolean programming_progress_timeout(gpointer data) { /* Set the progress bar */ gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(gtk_builder_get_object(g_builder, "progressbar1")), g_stkComms->getProgress()); /* See if programming is completed */ if(g_stkComms->isProgramComplete()) { g_stkComms->disconnect(); /* Switch to next page */ gtk_notebook_next_page( GTK_NOTEBOOK(gtk_builder_get_object(g_builder, "notebook1"))); } else { return TRUE; } }
//This function adds a new tab to the browser notebook each time its called void addNewTab( GtkWidget* Notebook, gpointer data){ Widget Window, TableHeading, HboxHeader, HboxLabel, NoteBook, Cancel, Add, Table,Image2,Image3; gint currentPageNum; gint nextPageNum; Image2=gtk_image_new_from_stock(GTK_STOCK_ADD,1); Image3=gtk_image_new_from_stock(GTK_STOCK_CANCEL,1); //seting the count of the notebook count =gtk_notebook_get_current_page(GTK_NOTEBOOK(Notebook)); web[count]=webkit_web_view_new(); //Number of tabs increase by one each time a tab is added NUMBER_OF_TABS++; HboxHeader = gtk_hbox_new( TRUE, 0); gtk_widget_set_size_request( HboxHeader, 200, 20); HboxLabel = gtk_label_new("The Bolf"); gtk_widget_set_size_request(HboxLabel, 95, 20); gtk_box_pack_start_defaults( GTK_BOX(HboxHeader), HboxLabel); Cancel = gtk_button_new(); gtk_container_add(GTK_CONTAINER(Cancel),Image3); gtk_button_set_relief( GTK_BUTTON( Cancel), GTK_RELIEF_NONE); //Connects signal related to close button g_signal_connect_swapped( G_OBJECT(Cancel), "clicked", G_CALLBACK(delete_tab), (gpointer) Notebook); gtk_box_pack_start_defaults( GTK_BOX(HboxHeader), Cancel); Add = gtk_button_new(); gtk_container_add(GTK_CONTAINER(Add),Image2); gtk_widget_set_size_request( Add, 20, 20); //Connects the Add to its callback function when clicked g_signal_connect_swapped( G_OBJECT(Add), "clicked", G_CALLBACK(addNewTab), (gpointer) Notebook); gtk_box_pack_start_defaults( GTK_BOX(HboxHeader), Add); gtk_widget_show_all(HboxHeader); //Table = gtk_table_new( 50, 50, FALSE); Table = BolfView(); currentPageNum = gtk_notebook_get_current_page(GTK_NOTEBOOK(Notebook)); //g_signal_connect(SearchButton, "clicked", G_CALLBACK(InputConnect), InputText); nextPageNum = currentPageNum + 1; gtk_notebook_insert_page( GTK_NOTEBOOK(Notebook), Table, HboxHeader, nextPageNum); gtk_notebook_next_page( GTK_NOTEBOOK(Notebook)); gtk_widget_show_all(Notebook); }
gboolean switch_to_p3_timeout(gpointer data) { /* Renable the button */ gtk_widget_set_sensitive( GTK_WIDGET(gtk_builder_get_object(g_builder, "button_p2_yes")), true); /* Switch to next page */ gtk_notebook_next_page( GTK_NOTEBOOK(gtk_builder_get_object(g_builder, "notebook1"))); g_stkComms = new CStkComms(); g_stkComms->connectWithTTY(g_comport); g_stkComms->programAllAsync(g_hexfilename); #ifndef _WIN32 sleep(2); #else Sleep(2000); #endif /* Start the programming progress timeout */ g_timeout_add(500, programming_progress_timeout, NULL); return FALSE; }
//This function adds a new tab to the browser notebook each time its called void addNewTab( GtkWidget* browserForm, gpointer data){ GtkWidget *tableInitialing , *cancelButton, *addButton, *hboxHeader, *hboxLabel; gint currentPageNum; gint nextPageNum; //Number of tabs increase by one each time a tab is added NUMBER_OF_TABS++; hboxHeader = gtk_hbox_new( TRUE, 0); gtk_widget_set_size_request( hboxHeader, 200, 20); hboxLabel = gtk_label_new("New tab"); gtk_widget_set_size_request(hboxLabel, 95, 20); gtk_box_pack_start_defaults( GTK_BOX(hboxHeader), hboxLabel); cancelButton = gtk_button_new_with_mnemonic("_x"); gtk_button_set_relief( GTK_BUTTON( cancelButton), GTK_RELIEF_NONE); //Connects signal related to close button g_signal_connect_swapped( G_OBJECT(cancelButton), "clicked", G_CALLBACK(delete_tab), (gpointer) browserForm); gtk_box_pack_start_defaults( GTK_BOX(hboxHeader), cancelButton); addButton = gtk_button_new_with_mnemonic("_+"); gtk_button_set_relief( GTK_BUTTON( addButton), GTK_RELIEF_NONE); gtk_widget_set_size_request( addButton, 20, 20); //Connects the addButton to its callback function when clicked g_signal_connect_swapped( G_OBJECT(addButton), "clicked", G_CALLBACK(addNewTab), (gpointer) browserForm); gtk_box_pack_start_defaults( GTK_BOX(hboxHeader), addButton); gtk_widget_show_all(hboxHeader); //Creates a table of 30 rows and 17 columns tableInitialing = setPageLayout(browserForm->parent, browserForm); currentPageNum = gtk_notebook_get_current_page( GTK_NOTEBOOK(browserForm)); nextPageNum = currentPageNum + 1; gtk_notebook_insert_page( GTK_NOTEBOOK(browserForm), tableInitialing, hboxHeader, nextPageNum + 1); gtk_notebook_next_page( GTK_NOTEBOOK(browserForm)); gtk_widget_show_all(browserForm); }
GLADE_CB gboolean on_dbgmem_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { GtkNotebook *nb = GTK_NOTEBOOK(notebook); switch(event->keyval) { case GDK_F1: dbgmem_button1_clicked(NULL, NULL); return TRUE; case GDK_F2: dbgmem_button2_clicked(NULL, NULL); return TRUE; case GDK_F3: dbgmem_button3_clicked(NULL, NULL); return TRUE; case GDK_F4: dbgmem_button4_clicked(NULL, NULL); return TRUE; case GDK_F5: dbgmem_button5_clicked(NULL, NULL); return TRUE; case GDK_F6: dbgmem_button6_clicked(NULL, NULL); return TRUE; case GDK_F7: gtk_notebook_next_page(nb); return TRUE; case GDK_F8: gtk_notebook_prev_page(nb); return TRUE; default: return FALSE; } return FALSE; }
void nautilus_notebook_next_page (NautilusNotebook *notebook) { gint current_page, n_pages; g_return_if_fail (NAUTILUS_IS_NOTEBOOK (notebook)); current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)); if (current_page < n_pages - 1) gtk_notebook_next_page (GTK_NOTEBOOK (notebook)); else { gboolean wrap_around; g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)), "gtk-keynav-wrap-around", &wrap_around, NULL); if (wrap_around) gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); } }
/** * ephy_notebook_next_page: * @notebook: an #EphyNotebook * * Advances to the next page in the @notebook. Note that unlike * gtk_notebook_next_page() this method will wrap around if * #GtkSettings:gtk-keynav-wrap-around is set. **/ void ephy_notebook_next_page (EphyNotebook *notebook) { gint current_page, n_pages; g_assert (EPHY_IS_NOTEBOOK (notebook)); current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)); if (current_page < n_pages - 1) gtk_notebook_next_page (GTK_NOTEBOOK (notebook)); else { gboolean wrap_around; g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)), "gtk-keynav-wrap-around", &wrap_around, NULL); if (wrap_around) gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); } }
void gnm_notebook_next_page (GnmNotebook *nb) { gtk_notebook_next_page (GTK_NOTEBOOK (nb)); }
/* change view and focus to the next notebook page */ void gtkui_page_right(void) { gtk_notebook_next_page(GTK_NOTEBOOK (notebook)); }
void wxMDIParentFrame::ActivateNext() { if (m_clientWindow) gtk_notebook_next_page( GTK_NOTEBOOK(m_clientWindow->m_widget) ); }
void ui_tab_next(void) { gtk_notebook_next_page(GTK_NOTEBOOK(nbook)); }
static VALUE rg_next_page(VALUE self) { gtk_notebook_next_page(_SELF(self)); return self; }
/** * Callback function of the conversation window's key-press event. */ static gboolean key_press_func(GtkWidget *widget, GdkEventKey *event, HybridConversation *conv) { gint current_page; gint pages; GSList *pos; HybridChatWindow *chat; if (event->state & GDK_CONTROL_MASK) { /* CTRL+W close the chat tab. */ if (event->keyval == GDK_w) { /* find the current chat panel. */ current_page = gtk_notebook_current_page( GTK_NOTEBOOK(conv->notebook)); for (pos = conv->chat_buddies; pos; pos = pos->next) { chat = (HybridChatWindow*)pos->data; if (current_page == gtk_notebook_page_num( GTK_NOTEBOOK(conv->notebook), chat->vbox)) { close_tab(chat); return TRUE; } } hybrid_debug_error("conv", "FATAL, can't find chat panel"); return FALSE; } /* CTRL+Q close the window. */ if (event->keyval == GDK_q) { gtk_widget_destroy(conv->window); return TRUE; } /* CTRL+TAB move to next page. */ if (event->keyval == GDK_Tab) { pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(conv->notebook)); if (pages == 1) { return TRUE; } else { current_page = gtk_notebook_current_page( GTK_NOTEBOOK(conv->notebook)); if (pages - 1 == current_page) { gtk_notebook_set_current_page(GTK_NOTEBOOK(conv->notebook), 0); } else { gtk_notebook_next_page(GTK_NOTEBOOK(conv->notebook)); } } return TRUE; } } return FALSE; }
/* Tab scrolling was removed from GtkNotebook in gtk 3, so reimplement it here */ static gboolean scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, gpointer user_data) { GtkNotebook *notebook = GTK_NOTEBOOK (widget); GtkWidget *child, *event_widget, *action_widget; if ((event->state & gtk_accelerator_get_default_mod_mask ()) != 0) return FALSE; child = gtk_notebook_get_nth_page (notebook, gtk_notebook_get_current_page (notebook)); if (child == NULL) return FALSE; event_widget = gtk_get_event_widget ((GdkEvent *) event); /* Ignore scroll events from the content of the page */ if (event_widget == NULL || event_widget == child || gtk_widget_is_ancestor (event_widget, child)) return FALSE; /* And also from the action widgets */ action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_START); if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget))) return FALSE; action_widget = gtk_notebook_get_action_widget (notebook, GTK_PACK_END); if (event_widget == action_widget || (action_widget != NULL && gtk_widget_is_ancestor (event_widget, action_widget))) return FALSE; switch (event->direction) { case GDK_SCROLL_RIGHT: case GDK_SCROLL_DOWN: gtk_notebook_next_page (notebook); return TRUE; case GDK_SCROLL_LEFT: case GDK_SCROLL_UP: gtk_notebook_prev_page (notebook); return TRUE; case GDK_SCROLL_SMOOTH: switch (gtk_notebook_get_tab_pos (notebook)) { case GTK_POS_LEFT: case GTK_POS_RIGHT: if (event->delta_y > 0) gtk_notebook_next_page (notebook); else if (event->delta_y < 0) gtk_notebook_prev_page (notebook); break; case GTK_POS_TOP: case GTK_POS_BOTTOM: if (event->delta_x > 0) gtk_notebook_next_page (notebook); else if (event->delta_x < 0) gtk_notebook_prev_page (notebook); break; } return TRUE; } return FALSE; }
gboolean findDongleTimeout(gpointer data) { char buf[80]; /* Check to see if the dongle is found. If it is, proceed to the next page. * If not, reset state vars and stay on the first page, pop up a warning * dialog. */ gboolean rc = FALSE; MUTEX_LOCK(&g_giant_lock); if(g_dongleSearchStatus == DONGLE_SEARCHING) { rc = TRUE; } else if (g_dongleSearchStatus == DONGLE_FOUND) { /* Set up the labels and stuff */ switch(g_mobot->formFactor) { case MOBOTFORM_I: sprintf(buf, "Linkbot-I"); break; case MOBOTFORM_L: sprintf(buf, "Linkbot-L"); break; default: sprintf(buf, "Unkown"); break; } gtk_label_set_text( GTK_LABEL(gtk_builder_get_object(g_builder, "label_formFactor")), buf); sprintf(buf, "%d", Mobot_getVersion(g_mobot)); gtk_label_set_text( GTK_LABEL(gtk_builder_get_object(g_builder, "label_firmwareVersion")), buf); sprintf(buf, "%d", Mobot_protocolVersion()); gtk_label_set_text( GTK_LABEL(gtk_builder_get_object(g_builder, "label_upgradeVersion")), buf); gtk_entry_set_text( GTK_ENTRY(gtk_builder_get_object(g_builder, "entry_serialID")), g_mobot->serialID); /* Go to next notebook page */ gtk_notebook_next_page( GTK_NOTEBOOK(gtk_builder_get_object(g_builder, "notebook1"))); rc = FALSE; } else if (g_dongleSearchStatus == DONGLE_NOTFOUND) { /* Renable the button */ gtk_widget_set_sensitive( GTK_WIDGET(gtk_builder_get_object(g_builder, "button_p1_next")), TRUE); /* Pop up a dialog box */ GtkWidget* d = gtk_message_dialog_new( GTK_WINDOW(gtk_builder_get_object(g_builder, "window1")), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK, "No attached Linkbot was detected. Please make sure there is a Linkbot connected to the computer with a Micro-USB cable and that the Linkbot is powered on."); gtk_dialog_run(GTK_DIALOG(d)); gtk_widget_hide(GTK_WIDGET(d)); rc = FALSE; } else { /* Something very weird happened */ fprintf(stderr, "Fatal error: %s:%d\n", __FILE__, __LINE__); exit(-1); } MUTEX_UNLOCK(&g_giant_lock); return rc; }