程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> C語言 >> C >> 關於C >> C指針原理(35)

C指針原理(35)

編輯:關於C

 

 

#include



static void destroy(GtkWidget *window,gpointer data){
printf(%s,gtk_label_get_text(data));
gtk_main_quit();
}
static gboolean delete_event(GtkWindow *window,GdkEvent *event,gpointer data){
return FALSE;
}


int main( int argc, char *argv[])
{
GtkWidget *window;
char *markup;
char *str=hello,world;


gtk_init(&argc, &argv);


window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), 你好);
gtk_container_set_border_width(GTK_CONTAINER(window),10);
gtk_window_set_default_size(GTK_WINDOW(window), 130, 150);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);



GtkWidget * label=gtk_label_new();
markup = g_markup_printf_escaped (%s,str );
gtk_label_set_markup (GTK_LABEL (label), markup);
gtk_label_set_selectable(GTK_LABEL(label),TRUE);
g_signal_connect(G_OBJECT(window), destroy,G_CALLBACK(destroy),(gpointer)label);


g_signal_connect(G_OBJECT(window), delete _event,G_CALLBACK(delete_event),NULL);


gtk_container_add(GTK_CONTAINER(window),label);
gtk_widget_show_all(window);
gtk_main();
g_free (markup);
return 0;
}

 

 

\

\


  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved