Changeset 10231
- Timestamp:
- Feb 19, 2010, 2:49:03 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/details.c
r10099 r10231 546 546 } 547 547 548 /* Only call gtk_label_set_text() if the new text differs from the old. 549 * This way if the user has text selected, refreshing won't deselect it */ 548 550 static void 549 551 gtr_label_set_text( GtkLabel * lb, const char * newstr ) … … 553 555 if( ( oldstr == NULL ) || strcmp( oldstr, newstr ) ) 554 556 gtk_label_set_text( lb, newstr ); 557 } 558 559 /* Only call gtk_text_buffer_set_text() if the new text differs from the old. 560 * This way if the user has text selected, refreshing won't deselect it */ 561 static void 562 gtr_text_buffer_set_text( GtkTextBuffer * b, const char * str ) 563 { 564 char * old_str; 565 GtkTextIter start, end; 566 567 if( str == NULL ) 568 str = ""; 569 570 gtk_text_buffer_get_bounds( b, &start, &end ); 571 old_str = gtk_text_buffer_get_text( b, &start, &end, FALSE ); 572 573 if( ( old_str == NULL ) || strcmp( old_str, str ) ) 574 gtk_text_buffer_set_text( b, str, -1 ); 575 576 g_free( old_str ); 555 577 } 556 578 … … 632 654 str = mixed; 633 655 } 634 gt k_text_buffer_set_text( di->comment_buffer, str, -1);656 gtr_text_buffer_set_text( di->comment_buffer, str ); 635 657 636 658 /* destination_lb */
Note: See TracChangeset
for help on using the changeset viewer.