- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
the compiler failed with error code 128 asp.net THE TEXT VIEW WIDGET in Font
CHAPTER 7 THE TEXT VIEW WIDGET Create Data Matrix ECC200 In None Using Barcode maker for Font Control to generate, create DataMatrix image in Font applications. www.OnBarcode.comEncode UPCA In None Using Barcode printer for Font Control to generate, create UPC Symbol image in Font applications. www.OnBarcode.comAlthough not used in Listing 7-7, it is possible to remove a tag from an area of text with gtk_text_buffer_remove_tag_by_name(). This function will remove all instances of the tag between the two iterators if they exist. void gtk_text_buffer_remove_tag_by_name (GtkTextBuffer *buffer, const gchar *name, const GtkTextIter *start, const GtkTextIter *end); PDF417 Generator In None Using Barcode encoder for Font Control to generate, create PDF 417 image in Font applications. www.OnBarcode.comPrinting Barcode In None Using Barcode printer for Font Control to generate, create Barcode image in Font applications. www.OnBarcode.com Note These functions only remove tags from a certain range of text. If the tag was added to a larger range Creating USS Code 39 In None Using Barcode printer for Font Control to generate, create Code-39 image in Font applications. www.OnBarcode.comDrawing Barcode In None Using Barcode generation for Font Control to generate, create Barcode image in Font applications. www.OnBarcode.comof text than the range specified, the tag will be removed for the smaller range, and new bounds will be created on either side of the selection. You can test this with the application in Listing 7-7. EAN 13 Generator In None Using Barcode printer for Font Control to generate, create EAN13 image in Font applications. www.OnBarcode.comUPC-E Encoder In None Using Barcode creation for Font Control to generate, create UPC - E0 image in Font applications. www.OnBarcode.comIf you have access to the GtkTextTag object, you can remove the tag with gtk_text_buffer_ remove_tag(). It is also possible to remove every tag within a range with gtk_text_buffer_remove_ all_tags(). Data Matrix 2d Barcode Creation In Java Using Barcode encoder for BIRT reports Control to generate, create DataMatrix image in BIRT applications. www.OnBarcode.comCreate ECC200 In .NET Framework Using Barcode drawer for Reporting Service Control to generate, create ECC200 image in Reporting Service applications. www.OnBarcode.comInserting Images
Barcode Generation In .NET Framework Using Barcode drawer for ASP.NET Control to generate, create Barcode image in ASP.NET applications. www.OnBarcode.comUPC-A Supplement 2 Recognizer In C#.NET Using Barcode decoder for VS .NET Control to read, scan read, scan image in Visual Studio .NET applications. www.OnBarcode.comIn some applications, you may want to insert images into a text buffer. This can easily be done with GdkPixbuf objects. In Figure 7-8, two images were inserted into a text buffer as GdkPixbuf objects. QR Code Printer In Java Using Barcode creator for Android Control to generate, create QR Code JIS X 0510 image in Android applications. www.OnBarcode.comGTIN - 12 Maker In Java Using Barcode maker for Java Control to generate, create UPC Symbol image in Java applications. www.OnBarcode.comFigure 7-8. GdkPixbuf objects in a text buffer Adding a pixbuf to a GtkTextBuffer is performed in three steps. First, you must create the pixbuf object and retrieve the GtkTextIter where it will be inserted. Then, you can use gtk_text_buffer_insert_pixbuf() to add it to the buffer. Listing 7-8 shows the process of creating a GdkPixbuf object from a file and adding it to a text buffer. PDF 417 Maker In None Using Barcode generator for Office Excel Control to generate, create PDF417 image in Office Excel applications. www.OnBarcode.comBarcode Creation In None Using Barcode maker for Online Control to generate, create Barcode image in Online applications. www.OnBarcode.comCHAPTER 7 THE TEXT VIEW WIDGET
Code-128 Printer In C#.NET Using Barcode generator for .NET framework Control to generate, create Code128 image in Visual Studio .NET applications. www.OnBarcode.comMake Universal Product Code Version A In Visual C#.NET Using Barcode maker for VS .NET Control to generate, create GTIN - 12 image in VS .NET applications. www.OnBarcode.comListing 7-8. Inserting Images into Text Buffers (images.c) #include <gtk/gtk.h> #define IMAGE_UNDO "/path/to/undo.png" #define IMAGE_REDO "/path/to/redo.png" int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *textview; GdkPixbuf *undo, *redo; GtkTextIter line; GtkTextBuffer *buffer; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Pixbufs"); gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_widget_set_size_request (window, 200, 150); textview = gtk_text_view_new (); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview)); gtk_text_buffer_set_text (buffer, " Undo\n Redo", -1); /* Create two images and insert them into the text buffer. */ undo = gdk_pixbuf_new_from_file (IMAGE_UNDO, NULL); gtk_text_buffer_get_iter_at_line (buffer, &line, 0); gtk_text_buffer_insert_pixbuf (buffer, &line, undo); redo = gdk_pixbuf_new_from_file (IMAGE_REDO, NULL); gtk_text_buffer_get_iter_at_line (buffer, &line, 1); gtk_text_buffer_insert_pixbuf (buffer, &line, redo); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (scrolled_win), textview); gtk_container_add (GTK_CONTAINER (window), scrolled_win); gtk_widget_show_all (window); gtk_main(); return 0; } Encode USS Code 128 In Objective-C Using Barcode creation for iPhone Control to generate, create Code-128 image in iPhone applications. www.OnBarcode.comPaint Barcode In Java Using Barcode creator for Java Control to generate, create Barcode image in Java applications. www.OnBarcode.comCHAPTER 7 THE TEXT VIEW WIDGET
Inserting a GdkPixbuf object into a text buffer is done with gtk_text_buffer_insert_pixbuf(). The GdkPixbuf object is inserted at the specified location, which can be any valid text iterator in the buffer. void gtk_text_buffer_insert_pixbuf (GtkTextBuffer *buffer, GtkTextIter *iter, GdkPixbuf *pixbuf); Pixbufs are handled differently by various functions. For example, gtk_text_buffer_ get_slice() will place the 0xFFFC character where a pixbuf is located. However, the 0xFFFC character can occur as an actual character in the buffer, so that is not a reliable indicator of the location of a pixbuf. Another example is gtk_text_buffer_get_text(), which will completely ignore nontextual elements, so there is no way to check for pixbufs within the text using this function. Therefore, if you are using pixbufs in a GtkTextBuffer, it is best to retrieve text from the buffer with gtk_text_buffer_get_slice(). You can then use gtk_text_iter_get_pixbuf() to check whether the 0xFFFC character represents a GdkPixbuf object; it will return NULL if a pixbuf is not found at that location. GdkPixbuf* gtk_text_iter_get_pixbuf (const GtktTextIter *iter); Inserting Child Widgets
Inserting widgets into a text buffer is a little more complicated than pixbufs, because you must notify both the text buffer and the text view to embed the widget. You begin by creating a GtkTextChildAnchor object, which will be used to mark the placement of the widget within the GtkTextBuffer. Then, you add the widget to the GtkTextView widget. Figure 7-9. A child widget inserted into a text buffer Figure 7-9 shows a GtkTextView widget that contains a child GtkButton widget. Listing 7-9 can be used to create this window. When the button is pressed, gtk_main_quit() is called, which terminates the application.
|
|