Example #1
0
static gboolean
on_focus_in_event (G_GNUC_UNUSED GtkWidget* widget,
		   G_GNUC_UNUSED GdkEventFocus* event,
		   gpointer data)
{
  ChatWindow* self = (ChatWindow*)data;
  gint num;
  GtkWidget* page = NULL;
  GtkWidget* hbox = NULL;
  GtkWidget* label = NULL;

  num = gtk_notebook_get_current_page (GTK_NOTEBOOK (self->priv->notebook));
  if (num != -1) { /* the notebook may be empty */

    page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (self->priv->notebook), num);
    hbox = gtk_notebook_get_tab_label (GTK_NOTEBOOK (self->priv->notebook),
				       page);
    label = (GtkWidget*)g_object_get_data (G_OBJECT (hbox), "label-widget");
    gtk_label_set_text (GTK_LABEL (label),
			(const gchar*)g_object_get_data (G_OBJECT (label),
						       "base-title"));
    g_object_set_data (G_OBJECT (label), "unread-count",
		       GUINT_TO_POINTER (0));

    update_unread (self);
  }

  return FALSE;
}
Example #2
0
static void
update_unread (ChatWindow* self)
{
  guint unread_count = 0;
  GtkWidget* page = NULL;
  GtkWidget* hbox = NULL;
  GtkWidget* label = NULL;
  gchar *info = NULL;

  for (gint ii = 0;
       ii < gtk_notebook_get_n_pages (GTK_NOTEBOOK (self->priv->notebook)) ;
       ii++) {

    page
      = gtk_notebook_get_nth_page (GTK_NOTEBOOK (self->priv->notebook), ii);
    hbox = gtk_notebook_get_tab_label (GTK_NOTEBOOK (self->priv->notebook),
				       page);
    label = (GtkWidget*)g_object_get_data (G_OBJECT (hbox), "label-widget");
    unread_count
      = unread_count
      + GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (label), "unread-count"));

  }

  g_signal_emit (self, signals[UNREAD_COUNT], 0, unread_count);

  if (unread_count > 0) {
    info = g_strdup_printf (ngettext ("You have %d unread text message",
                                      "You have %d unread text messages",
                                      unread_count), unread_count);
    boost::shared_ptr<Ekiga::Notification> notif (new Ekiga::Notification (Ekiga::Notification::Warning, info, "", _("Read"), boost::bind (show_chat_window_cb, self)));
    self->priv->notification_core->push_notification (notif);
    g_free (info);
  }
}
Example #3
0
static void
on_switch_page (G_GNUC_UNUSED GtkNotebook* notebook,
		G_GNUC_UNUSED gpointer page_,
		guint num,
		gpointer data)
{
  ChatWindow* self = (ChatWindow*)data;
  GtkWidget* page = NULL;
  GtkWidget* hbox = NULL;
  GtkWidget* label = NULL;

  page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (self->priv->notebook), num);
  hbox = gtk_notebook_get_tab_label (GTK_NOTEBOOK (self->priv->notebook),
				     page);
  label = (GtkWidget*)g_object_get_data (G_OBJECT (hbox), "label-widget");
  gtk_label_set_text (GTK_LABEL (label),
		      (const gchar*)g_object_get_data (G_OBJECT (label),
						       "base-title"));
  g_object_set_data (G_OBJECT (label), "unread-count",
		     GUINT_TO_POINTER (0));

  update_unread (self);

  gtk_widget_grab_focus (page);
}
static void
pluma_notebook_switch_page_cb (GtkNotebook     *notebook,
                               GtkNotebookPage *page,
                               guint            page_num,
                               gpointer         data)
{
	PlumaNotebook *nb = PLUMA_NOTEBOOK (notebook);
	GtkWidget *child;
	PlumaView *view;

	child = gtk_notebook_get_nth_page (notebook, page_num);

	/* Remove the old page, we dont want to grow unnecessarily
	 * the list */
	if (nb->priv->focused_pages)
	{
		nb->priv->focused_pages =
			g_list_remove (nb->priv->focused_pages, child);
	}

	nb->priv->focused_pages = g_list_append (nb->priv->focused_pages,
						 child);

	/* give focus to the view */
	view = pluma_tab_get_view (PLUMA_TAB (child));
	gtk_widget_grab_focus (GTK_WIDGET (view));
}
Example #5
0
LinphoneCall *linphone_gtk_get_currently_displayed_call(gboolean *is_conf){
	LinphoneCore *lc=linphone_gtk_get_core();
	GtkWidget *main_window=linphone_gtk_get_main_window ();
	GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
	const MSList *calls=linphone_core_get_calls(lc);
	if (is_conf) *is_conf=FALSE;
	if (!linphone_gtk_use_in_call_view() || ms_list_size(calls)==1){
		if (calls) return (LinphoneCall*)calls->data;
	}else{
		int idx=gtk_notebook_get_current_page (notebook);
		GtkWidget *page=gtk_notebook_get_nth_page(notebook,idx);
		if (page!=NULL){
			LinphoneCall *call=(LinphoneCall*)g_object_get_data(G_OBJECT(page),"call");
			if (call==NULL){
				GtkWidget *conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(main_window),"conf_frame");
				if (conf_frame==page){
					if (is_conf)
						*is_conf=TRUE;
					return NULL;
				}
			}
			return call;
		}
	}
	return NULL;
}
Example #6
0
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
{
    if (!m_clientWindow) return NULL;

    GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget);
    if (!notebook) return NULL;

    gint i = gtk_notebook_get_current_page( notebook );
    if (i < 0) return NULL;

    GtkWidget* page = gtk_notebook_get_nth_page(notebook, i);
    if (!page) return NULL;

    wxWindowList::compatibility_iterator node = m_clientWindow->GetChildren().GetFirst();
    while (node)
    {
        if ( wxPendingDelete.Member(node->GetData()) )
            return NULL;

        wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame );

        if (!child_frame)
            return NULL;

        if (child_frame->m_widget == page)
            return child_frame;

        node = node->GetNext();
    }

    return NULL;
}
Example #7
0
/**
 * browser_perspective_uncustomize:
 * @perspective: an object implementing the #BrowserPerspective interface
 *
 * Remove any optional custom UI elements  which have been added
 * when browser_perspective_customize() was called.
 */
void
browser_perspective_uncustomize (BrowserPerspective *perspective)
{
	g_return_if_fail (IS_BROWSER_PERSPECTIVE (perspective));

	/* Current BrowserPage */
	GtkNotebook *nb;
	nb = (GtkNotebook*) browser_perspective_get_notebook (perspective);
	if (nb) {
		gint current_index;
		current_index = gtk_notebook_get_current_page (nb);
		if (current_index >= 0) {
			GtkWidget *current_page;
			current_page = gtk_notebook_get_nth_page (nb, current_index);
			if (current_page && IS_BROWSER_PAGE (current_page))
				browser_page_uncustomize (BROWSER_PAGE (current_page));
		}
	}

	if (BROWSER_PERSPECTIVE_GET_CLASS (perspective)->i_uncustomize)
		(BROWSER_PERSPECTIVE_GET_CLASS (perspective)->i_uncustomize) (perspective);
	else {
		g_print ("Default browser_perspective_uncustomize for %s\n",
			 G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (perspective)));
		if (customization_data_exists (G_OBJECT (perspective)))
			customization_data_release (G_OBJECT (perspective));
	}
}
Example #8
0
static void
notebook_remove_page_cb (GtkNotebook *nb, GtkWidget *page, gint pagenb, BrowserPerspective *bpers)
{
	if (customization_data_exists (G_OBJECT (bpers))) {
		gint current_index;
		GtkWidget *current_page = NULL;
		current_index = gtk_notebook_get_current_page (nb);
		if (current_index >= 0)
			current_page = gtk_notebook_get_nth_page (nb, current_index);

		g_print ("\tNotebook, removing page %d, current page is now %d\n", pagenb, current_index);

		/* REM: we need to uncustomize _both_ the removed page and the new page, and customize
		 * again the new page to avoid discrepancies */
		if (current_page && IS_BROWSER_PAGE (current_page))
			browser_page_uncustomize (BROWSER_PAGE (current_page));
		if (page && IS_BROWSER_PAGE (page))
			browser_page_uncustomize (BROWSER_PAGE (page));

		if (current_page && IS_BROWSER_PAGE (current_page))
			browser_page_customize (BROWSER_PAGE (current_page),
						customization_data_get_toolbar (G_OBJECT (bpers)),
						customization_data_get_header_bar (G_OBJECT (bpers)));
	}
}
Example #9
0
static void
notebook_switch_page (GtkNotebook        *book,
		      GtkWidget          *pg,
		      gint                page_num,
		      GeditMultiNotebook *mnb)
{
	GeditTab *tab;

	/* When we switch a tab from a notebook that it is not the active one
	   the switch page is emitted before the set focus, so we do this check
	   and we avoid to call switch page twice */
	if (GTK_WIDGET (book) != mnb->priv->active_notebook)
		return;

	/* CHECK: I don't know why but it seems notebook_switch_page is called
	two times every time the user change the active tab */
	tab = GEDIT_TAB (gtk_notebook_get_nth_page (book, page_num));
	if (tab != mnb->priv->active_tab)
	{
		GeditTab *old_tab;

		old_tab = mnb->priv->active_tab;

		/* set the active tab */
		mnb->priv->active_tab = tab;

		g_object_notify (G_OBJECT (mnb), "active-tab");

		g_signal_emit (G_OBJECT (mnb), signals[SWITCH_TAB], 0,
			       mnb->priv->active_notebook, old_tab,
			       book, tab);
	}
}
static gboolean
button_press_event_cb (GtkWidget *widget,
                       GdkEventButton *event,
                       EphyWindow *window)
{
    gint tab_number;
    EphyEmbed *embed;

    if (event->button != 2 || event->type != GDK_BUTTON_PRESS)
        return FALSE;

    /* I wish this wasn't so gash and copy-pasty... Connecting
     * to button-press-event on the tab doesn't ever get called.*/
    tab_number = find_tab_num_at_pos (EPHY_NOTEBOOK (widget),
                                      event->x_root, event->y_root);

    if (tab_number < 0)
        return FALSE;

    embed = EPHY_EMBED (gtk_notebook_get_nth_page (GTK_NOTEBOOK (widget),
                        tab_number));

    if (embed == NULL)
        return FALSE;

    ephy_embed_container_remove_child (EPHY_EMBED_CONTAINER (window), embed);

    return TRUE;
}
Example #11
0
void
close_tab(void) {
	Document *doc;
	GtkWidget *scroll;
	int index;

	/* Since a keypress only works on the currently active
	 * tab anyway, we might as well ask the index of the current
	 * page here and use that, instead of passing the index as
	 * a parameter.
	 * Also, since we need both the GtkScrolledWindow and the Document
	 * it is of no use to call get_active_document().
	 */
	index = gtk_notebook_get_current_page(GTK_NOTEBOOK(lightpad->tabs));
	scroll = gtk_notebook_get_nth_page(GTK_NOTEBOOK(lightpad->tabs), index);
	doc = g_object_get_data(G_OBJECT(scroll), "doc");
	if(doc->modified) {
		int save = check_for_save(doc);
		switch(save) {
			case GTK_RESPONSE_YES:
				if(save_to_file(doc, TRUE) < 0)
					return;
			case GTK_RESPONSE_NO: break;
			default: return;
		}
	}
	gtk_widget_destroy(scroll); /* this destroys both scroll's child and its container */
}
Example #12
0
/**
 * Format notebook finish page.
 * \param pageNum Page (tab) number.
 * \param pageLbl Page (tab) label.
 */
static void imp_ldif_page_finish( gint pageNum, gchar *pageLbl ) {
	GtkWidget *vbox;
	GtkWidget *table;
	GtkWidget *label;
	GtkWidget *labelBook;
	GtkWidget *labelFile;
	GtkWidget *labelRecs;
	gint top;

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_container_add( GTK_CONTAINER( impldif_dlg.notebook ), vbox );
	gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );

	label = gtk_label_new( pageLbl );
	gtk_widget_show( label );
	gtk_notebook_set_tab_label(
		GTK_NOTEBOOK( impldif_dlg.notebook ),
		gtk_notebook_get_nth_page( GTK_NOTEBOOK( impldif_dlg.notebook ), pageNum ),
		label );

	table = gtk_table_new(3, 2, FALSE);
	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
	gtk_table_set_col_spacings(GTK_TABLE(table), 8);

	/* First row */
	top = 0;
	label = gtk_label_new( _( "Address Book:" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelBook = gtk_label_new("");
	gtk_table_attach(GTK_TABLE(table), labelBook, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelBook), 0, 0.5);

	/* Second row */
	top++;
	label = gtk_label_new( _( "File Name:" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelFile = gtk_label_new("");
	gtk_table_attach(GTK_TABLE(table), labelFile, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelFile), 0, 0.5);

	/* Third row */
	top++;
	label = gtk_label_new( _("Records Imported:") );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelRecs = gtk_label_new("");
	gtk_table_attach(GTK_TABLE(table), labelRecs, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelRecs), 0, 0.5);

	impldif_dlg.labelBook    = labelBook;
	impldif_dlg.labelFile    = labelFile;
	impldif_dlg.labelRecords = labelRecs;
}
Example #13
0
/* fix stuff when plots are removed from a graph
 * plots are removed because a source is removed. */
static inline
void fix_or_remove_changed_graph(struct qp_win *qp, struct qp_graph *gr)
{
  gint pnum;
  ASSERT(qp);
  ASSERT(qp->window);

  if(qp_sllist_length(gr->plots) == 0)
  {
    qp_graph_destroy(gr); /* remove */
    if(qp_sllist_length(qp->graphs) == 0)
    {
      struct qp_sllist_entry *current;
      /* we save and restore the list iterator
       * because qp_graph_create() uses the app qp list. */
      /* TODO: fix this Kludgey List Hack */
      current = app->qps->current;
      qp_graph_create(qp, NULL);
      app->qps->current = current;
    }
    return;
  }

  /* TODO: add rescale fixes due to max and min changes */

  /* fix it by queuing redraw if it's showing */
  pnum = gtk_notebook_get_current_page(GTK_NOTEBOOK(qp->notebook));
  gr->pixbuf_needs_draw = 1;
  if(gtk_notebook_get_nth_page(GTK_NOTEBOOK(qp->notebook), pnum)
      == gr->drawing_area)
    gtk_widget_queue_draw(qp->notebook);
}
Example #14
0
static void
gnm_notebook_size_allocate (GtkWidget     *widget,
			    GtkAllocation *allocation)
{
	int i, h = 0;
	GnmNotebook *gnb = (GnmNotebook *)widget;
	GtkAllocation alc = *allocation;

	for (i = 0; TRUE; i++) {
		GtkWidget *page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (widget), i);
		GtkAllocation a;
		if (!page)
			break;
		if (!gtk_widget_get_visible (page))
			continue;
		gtk_widget_get_allocation (page, &a);
		h = MAX (h, a.height);
	}

	gnb->dummy_height = h;

	alc.y -= h;
	((GtkWidgetClass *)gnm_notebook_parent_class)->size_allocate
		(widget, &alc);
}
Example #15
0
static void
gedit_notebook_switch_page (GtkNotebook *notebook,
                            GtkWidget   *page,
                            guint        page_num)
{
	GeditNotebook *nb = GEDIT_NOTEBOOK (notebook);

	if (!nb->priv->ignore_focused_page_update)
	{
		gint prev_page;
		GtkWidget *previous_page;

		prev_page = gtk_notebook_get_current_page (notebook);
		previous_page = gtk_notebook_get_nth_page (notebook, prev_page);

		/* Remove the old page, we dont want to grow unnecessarily
		 * the list */
		if (nb->priv->focused_pages)
		{
			nb->priv->focused_pages =
				g_list_remove (nb->priv->focused_pages, previous_page);
		}

		nb->priv->focused_pages = g_list_append (nb->priv->focused_pages,
		                                         previous_page);
	}

	GTK_NOTEBOOK_CLASS (gedit_notebook_parent_class)->switch_page (notebook, page, page_num);

	/* give focus to the tab */
	gtk_widget_grab_focus (page);
}
Example #16
0
static gboolean
gedit_notebook_button_press (GtkWidget      *widget,
                             GdkEventButton *event)
{
	GtkNotebook *nb = GTK_NOTEBOOK (widget);

	if (event->type == GDK_BUTTON_PRESS &&
	    event->button == GDK_BUTTON_SECONDARY &&
	    (event->state & gtk_accelerator_get_default_mod_mask ()) == 0)
	{
		gint tab_clicked;

		tab_clicked = find_tab_num_at_pos (nb, event->x_root, event->y_root);
		if (tab_clicked >= 0)
		{
			GtkWidget *tab;

			tab = gtk_notebook_get_nth_page (nb, tab_clicked);

			g_signal_emit (G_OBJECT (widget), signals[SHOW_POPUP_MENU], 0, event, tab);

			return TRUE;
		}
	}

	return GTK_WIDGET_CLASS (gedit_notebook_parent_class)->button_press_event (widget, event);
}
GtkWidget *
org_gnome_exchange_show_folder_size_factory (EPlugin *epl, EConfigHookItemFactoryData *data)
{
    EMConfigTargetFolder *target=  (EMConfigTargetFolder *)data->config->target;
    CamelFolder *cml_folder = target->folder;
    CamelService *service;
    CamelProvider *provider;
    ExchangeAccount *account;
    GtkWidget *lbl_size, *lbl_size_val;
    GtkListStore *model;
    GtkVBox *vbx;
    GtkHBox *hbx_size;
    char *folder_name, *folder_size;
    int mode;

    service = CAMEL_SERVICE (camel_folder_get_parent_store (cml_folder));
    if (!service)
        return NULL;

    provider = camel_service_get_provider (service);
    if (!provider)
        return NULL;

    if (g_ascii_strcasecmp (provider->protocol, "exchange"))
        return NULL;

    account = exchange_operations_get_exchange_account ();
    exchange_account_is_offline (account, &mode);
    if (mode == OFFLINE_MODE)
        return NULL;

    folder_name = (char*) camel_folder_get_name (cml_folder);
    if (!folder_name)
        folder_name = g_strdup ("name");

    model = exchange_account_folder_size_get_model (account);
    if (model)
        folder_size = g_strdup_printf (_("%s KB"), exchange_folder_size_get_val (model, folder_name));
    else
        folder_size = g_strdup (_("0 KB"));

    hbx_size = (GtkHBox*) gtk_hbox_new (FALSE, 0);
    vbx = (GtkVBox *)gtk_notebook_get_nth_page (GTK_NOTEBOOK (data->parent), 0);

    lbl_size = gtk_label_new_with_mnemonic (_("Size:"));
    lbl_size_val = gtk_label_new_with_mnemonic (_(folder_size));
    gtk_widget_show (lbl_size);
    gtk_widget_show (lbl_size_val);
    gtk_misc_set_alignment (GTK_MISC (lbl_size), 0.0, 0.5);
    gtk_misc_set_alignment (GTK_MISC (lbl_size_val), 0.0, 0.5);
    gtk_box_pack_start (GTK_BOX (hbx_size), lbl_size, FALSE, TRUE, 12);
    gtk_box_pack_start (GTK_BOX (hbx_size), lbl_size_val, FALSE, TRUE, 10);
    gtk_widget_show_all (GTK_WIDGET (hbx_size));

    gtk_box_pack_start (GTK_BOX (vbx), GTK_WIDGET (hbx_size), FALSE, FALSE, 0);
    g_free (folder_size);

    return GTK_WIDGET (hbx_size);
}
static void
fav_selection_changed_cb (G_GNUC_UNUSED GtkWidget *widget, gint fav_id, TFavoritesType fav_type,
			  const gchar *selection, SchemaBrowserPerspective *bpers)
{
	if (fav_type == T_FAVORITES_TABLES) {
		GdaQuarkList *ql;
		const gchar *type;
		const gchar *schema = NULL, *table = NULL, *short_name = NULL;

		ql = gda_quark_list_new_from_string (selection);
		if (ql) {
			type = gda_quark_list_find (ql, "OBJ_TYPE");
			schema = gda_quark_list_find (ql, "OBJ_SCHEMA");
			table = gda_quark_list_find (ql, "OBJ_NAME");
			short_name = gda_quark_list_find (ql, "OBJ_SHORT_NAME");
		}
		
		if (!type || !schema || !table) {
			if (ql)
				gda_quark_list_free (ql);
			return;
		}

		if (!strcmp (type, "table")) {
			schema_browser_perspective_display_table_info (bpers, schema, table, short_name);
		}
		else {
			gint ntabs, i;
			ntabs = gtk_notebook_get_n_pages (GTK_NOTEBOOK (bpers->priv->notebook));
			for (i = 0; i < ntabs; i++) {
				GtkWidget *child;
				child = gtk_notebook_get_nth_page (GTK_NOTEBOOK (bpers->priv->notebook), i);
				if (IS_TABLE_INFO (child)) {
					if (!strcmp (schema, table_info_get_table_schema (TABLE_INFO (child))) &&
					    !strcmp (table, table_info_get_table_name (TABLE_INFO (child)))) {
						gtk_notebook_set_current_page (GTK_NOTEBOOK (bpers->priv->notebook), i);
						return;
					}
				}
			}

			g_warning ("Non handled favorite type: %s", type);
			TO_IMPLEMENT;
		}
	
		if (ql)
			gda_quark_list_free (ql);
	}
	else if (fav_type == T_FAVORITES_DIAGRAMS) {
#ifdef HAVE_GOOCANVAS
		schema_browser_perspective_display_diagram (bpers, fav_id);
#else
		g_warning ("Can't display diagram because canvas not compiled.");
#endif
	}
#ifdef GDA_DEBUG_NO
	g_print ("Reacted to selection fav_id=>%d type=>%u, contents=>%s\n", fav_id, fav_type, selection);	
#endif
}
Example #19
0
/**
 * Format notebook finish page.
 * \param pageNum Page (tab) number.
 * \param pageLbl Page (tab) label.
 */
static void export_html_page_finish( gint pageNum, gchar *pageLbl ) {
	GtkWidget *vbox;
	GtkWidget *table;
	GtkWidget *label;
	GtkWidget *labelBook;
	GtkWidget *labelFile;
	GtkWidget *btnBrowse;
	gint top;

	vbox = gtk_vbox_new(FALSE, 8);
	gtk_container_add( GTK_CONTAINER( exphtml_dlg.notebook ), vbox );
	gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );

	label = gtk_label_new( pageLbl );
	gtk_widget_show( label );
	gtk_notebook_set_tab_label(
		GTK_NOTEBOOK( exphtml_dlg.notebook ),
		gtk_notebook_get_nth_page( GTK_NOTEBOOK( exphtml_dlg.notebook ), pageNum ), label );

	table = gtk_table_new( 3, 3, FALSE );
	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
	gtk_table_set_col_spacings(GTK_TABLE(table), 8 );

	/* First row */
	top = 0;
	label = gtk_label_new( _( "Address Book :" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelBook = gtk_label_new("Full name of address book goes here");
	gtk_table_attach(GTK_TABLE(table), labelBook, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelBook), 0, 0.5);

	/* Second row */
	top++;
	label = gtk_label_new( _( "File Name :" ) );
	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);

	labelFile = gtk_label_new("File name goes here");
	gtk_table_attach(GTK_TABLE(table), labelFile, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
	gtk_misc_set_alignment(GTK_MISC(labelFile), 0, 0.5);

	/* Third row */
	top++;
	btnBrowse = gtk_button_new_with_label( _( "Open with Web Browser" ) );
	gtk_table_attach(GTK_TABLE(table), btnBrowse, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);

	gtk_widget_show_all(vbox);

	/* Button handlers */
	gtk_signal_connect( GTK_OBJECT(btnBrowse), "clicked",
		GTK_SIGNAL_FUNC(export_html_browse), NULL );

	exphtml_dlg.labelOutBook = labelBook;
	exphtml_dlg.labelOutFile = labelFile;
}
Example #20
0
GtkWidget *
caja_side_pane_get_current_panel (CajaSidePane *side_pane)
{
    int index;

    index = gtk_notebook_get_current_page (GTK_NOTEBOOK (side_pane->details->notebook));
    return gtk_notebook_get_nth_page (GTK_NOTEBOOK (side_pane->details->notebook), index);
}
Example #21
0
/* close the currently focused notebook page */
void gtkui_page_close_current(void) {
   GtkWidget *child;
   gint num = 0;

   num = gtk_notebook_get_current_page(GTK_NOTEBOOK (notebook));
   child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), num);

   gtkui_page_close(NULL, child);
}
Example #22
0
MessageView *
anjuta_msgman_get_current_view (AnjutaMsgman * msgman)
{
	gint page = gtk_notebook_get_current_page (GTK_NOTEBOOK(msgman));
	if (page != -1)
		return MESSAGE_VIEW (gtk_notebook_get_nth_page (GTK_NOTEBOOK(msgman), page));
	else
		return NULL;
}
Example #23
0
/**
 * gtr_notebook_get_page:
 * @notebook: a #GtrNotebook
 * 
 * Gets the selected page in the #GtrNotebook.
 * 
 * Returns: (transfer none): the selected page in the @notebook
 */
GtrTab *
gtr_notebook_get_page (GtrNotebook * notebook)
{
  gint num;

  num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));

  return GTR_TAB (gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), num));
}
Example #24
0
GtkWidget * playlist_get_treeview (gint playlist)
{
    GtkWidget *page = gtk_notebook_get_nth_page(UI_PLAYLIST_NOTEBOOK, playlist);

    if (!page)
        return NULL;

    return g_object_get_data ((GObject *) page, "treeview");
}
Example #25
0
static void views_sidebar_update(gint page_num, DebugState state)
{
	GtkWidget *page = gtk_notebook_get_nth_page(geany_sidebar, page_num);

	if (page == inspect_page)
		view_update(VIEW_INSPECT, state);
	else if (page == register_page)
		view_update(VIEW_REGISTERS, state);
}
CInstallScreen *CInstaller::GetScreen(gint index)
{
    GtkWidget *widgetscreen = gtk_notebook_get_nth_page(GTK_NOTEBOOK(m_pWizard), index);
    
    if (!widgetscreen)
        return NULL;
    
    return static_cast<CInstallScreen *>(gtk_object_get_user_data(GTK_OBJECT(widgetscreen)));
}
Example #27
0
GtkWidget* GroupDialog_addPage(const char* tabLabel, GtkWidget* widget, const StringExportCallback& title)
{
  GtkWidget* w = gtk_label_new(tabLabel);
  gtk_widget_show(w);
  GtkWidget* page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(g_GroupDlg.m_pNotebook), gtk_notebook_insert_page(GTK_NOTEBOOK(g_GroupDlg.m_pNotebook), widget, w, -1));
  g_pages.push_back(title);

  return page;
}
Example #28
0
static bool current_tab_is(area_context_t *context, const char *str) {
  GtkNotebook *nb = osm2go_platform::notebook_get_gtk_notebook(context->notebook);

  gint page_num = gtk_notebook_get_current_page(nb);

  if(page_num < 0)
    return false;

  return current_tab_is(nb, gtk_notebook_get_nth_page(nb, page_num), str);
}
Example #29
0
static gint catch_tabwin_key (GtkWidget *w, GdkEventKey *key, 
			      tabwin_t *tabwin)
{
    GtkNotebook *notebook = GTK_NOTEBOOK(tabwin->tabs);
    gint pg = gtk_notebook_get_current_page(notebook);
    GtkWidget *tab = gtk_notebook_get_nth_page(notebook, pg);
    windata_t *vwin = g_object_get_data(G_OBJECT(tab), "vwin");

    return catch_viewer_key(w, key, vwin);
}
Example #30
0
int DealSpecialWidget(const SpecialInfo* special_list)
{
	const SpecialInfo *special = NULL;
	GtkNotebook *notebook = NULL;

	special = special_list;
	while(special != NULL){
		if(special->type == 1){
			TopWidget *top_widget = malloc(sizeof(TopWidget));
			if(top_widget != NULL){
				memset(top_widget, 0, sizeof(TopWidget));
				top_widget->name = strdup(special->name);
				GladeXML *top_xml = glade_xml_new(glade_file, top_widget->name, NULL);
				top_widget->xml = top_xml;
				g_topwidget_list=g_list_append(g_topwidget_list, top_widget);
			}
		}else if(special->type == 0){
			Notebook *self_notebook = malloc(sizeof(Notebook));
			memset(self_notebook, 0, sizeof(Notebook));
			if(self_notebook != NULL){
				self_notebook->name = strdup(special->name);
				g_notebook_list = g_list_append(g_notebook_list, self_notebook);

        			GtkWidget *widget;
				notebook = (GtkNotebook*)glade_xml_get_widget(g_cngplp_xml,special->name);
		        	int notebook_page_num;
				int i = 0;
	                	notebook_page_num = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook));
				for(; i < notebook_page_num; i++){
                                	widget = gtk_notebook_get_nth_page(notebook, i);
					const gchar *name = gtk_widget_get_name(widget);
                                	GladeXML* tmp = glade_xml_new(glade_file, name, NULL);
					if(tmp != NULL){
                                		self_notebook->tab_xml = g_list_append(self_notebook->tab_xml, tmp);
					}
                                	gtk_widget_hide(gtk_notebook_get_nth_page(notebook, i));
                        	}
                	}
		}
		special=special->next;
	}
	return 0;
}