Changeset 3325 for trunk/jons-gtk2-gui

Show
Ignore:
Timestamp:
03/02/03 04:12:57 (6 years ago)
Author:
bostjanlah
Message:

Add a handy helper for getting the text of a gtk_entry as a string

Location:
trunk/jons-gtk2-gui/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/jons-gtk2-gui/src/utilities.cpp

    r3307 r3325  
    6868} 
    6969 
     70std::string 
     71entry_get_chars(GtkWidget *w) 
     72{ 
     73    char *et = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1); 
     74    if (et != NULL) { 
     75        std::string s(et); 
     76        g_free(et); 
     77        return s; 
     78    } 
     79    return std::string(); 
     80} 
     81 
  • trunk/jons-gtk2-gui/src/utilities.h

    r3307 r3325  
    1010s_convert_to_utf8(const char *input_text, const char *input_enc = NULL); 
    1111 
     12std::string 
     13entry_get_chars(GtkWidget *w); 
     14 
    1215#endif