pike.git / src / post_modules / GTK2 / source / gtkbutton.pre

version» Context lines:

pike.git/src/post_modules/GTK2/source/gtkbutton.pre:45:   //! If a string is supplied, a W(Label) is created and added to the button.   {    pgtk_verify_not_inited();    pgtk_verify_setup();    if (args) {    if (Pike_sp[-args].type==PIKE_T_STRING) {    struct pike_string *t;    GtkWidget *gb;    get_all_args("create",args,"%T",&t);    if (t) { -  if (g_utf8_validate((char *)STR0(t),t->len,NULL)) -  gb=gtk_button_new_from_stock((char *)STR0(t)); -  else -  gb=gtk_button_new(); +  ref_push_string(t); +  f_string_to_utf8(1); +  gb=gtk_button_new_from_stock((char *)STR0(Pike_sp[-1].u.string)); +  pop_stack();    } else    gb=gtk_button_new();    THIS->obj=G_OBJECT(gb);    } else {    INIT_WITH_PROPS(GTK_TYPE_BUTTON);    }    my_pop_n_elems(args);    } else {    GtkWidget *gb;    gb=gtk_button_new();