[问个问题]这个widget是什么,怎么调出来?

软件和网站开发以及相关技术探讨
回复
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

[问个问题]这个widget是什么,怎么调出来?

#1

帖子 cnkilior » 2009-06-18 22:47

Screenshot.png
Screenshot.png (12.74 KiB) 查看 1014 次
图中黄色区域“单击可查看您的约会和任务”,叫什么,使用了什么信号,怎么显示出来?

我查了不少代码,不是C++就是Glade,没有一个看得懂。
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

Re: [问个问题]这个widget是什么,怎么调出来?

#2

帖子 cnkilior » 2009-06-18 23:08

是不是GtkTooltips?
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

Re: [问个问题]这个widget是什么,怎么调出来?

#3

帖子 cnkilior » 2009-06-18 23:10

貌似真是。
头像
hubert_star
论坛版主
帖子: 5373
注册时间: 2007-10-29 22:12
系统: OSX 10.9 + Ub 1304
来自: 江苏南京

Re: [问个问题]这个widget是什么,怎么调出来?

#4

帖子 hubert_star » 2009-06-18 23:36

路过路过路过路过路过路过路过
佛经说,人有八苦: 生、老、病、死、求不得、怨憎、爱别离、五阴盛 故我苦!
圣经说,人有七罪: 饕餮、贪婪、懒惰、淫欲、傲慢、嫉妒和暴怒  故我有罪!

我这篇帖子里面没有任何攻击我们伟大的中华人民共和国政府和任劳任怨的人民公仆(和本论坛高素质的版主)的文字和含义;

特此声明!

有些事,我们明知道是错的,也要去坚持,因为不甘心;有些人,我们明知道是爱的,也要去放弃,因为没结局;有时候,我们明知道没路了,却还在前行,因为习惯了。

欢迎来我的新浪微博@me
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

Re: [问个问题]这个widget是什么,怎么调出来?

#5

帖子 cnkilior » 2009-06-18 23:37

代码: 全选

   #include <gtk/gtk.h>
   
   int main(int argc,char *argv[])
{
	GtkWidget *window;
   GtkWidget *load_button, *save_button, *hbox;
   GtkTooltips *button_bar_tips;
   gtk_init (&argc, &argv);
   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title(GTK_WINDOW(window),"GtkTooltip");
   g_signal_connect(G_OBJECT(window),"delete_event",G_CALLBACK(gtk_main_quit),NULL);
   g_signal_connect(G_OBJECT(window),"destroy",G_CALLBACK(gtk_main_quit),NULL);
   gtk_container_set_border_width(GTK_CONTAINER(window),2);
   button_bar_tips = gtk_tooltips_new ();
   /* Create the buttons and pack them into a GtkHBox */
   hbox = gtk_hbox_new (TRUE, 2);
   load_button = gtk_button_new_with_label ("Load a file");
   gtk_box_pack_start (GTK_BOX (hbox), load_button, TRUE, TRUE, 2);
   gtk_widget_show (load_button);
   save_button = gtk_button_new_with_label ("Save a file");
   gtk_box_pack_start (GTK_BOX (hbox), save_button, TRUE, TRUE, 2);
   gtk_widget_show (save_button);
   gtk_widget_show (hbox);
   /* Add the tips */
   gtk_tooltips_set_tip (GTK_TOOLTIPS (button_bar_tips), load_button,
				 "Load a new document into this window",
				 "Requests the filename of a document.\
				  This will then be loaded into the current\
				  window, replacing the contents of whatever\
				  is already loaded.");
   gtk_tooltips_set_tip (GTK_TOOLTIPS (button_bar_tips), save_button,
				 "Saves the current document to a file",
				 "If you have saved the document previously,\
				  then the new version will be saved over the\
				  old one. Otherwise, you will be prompted for\
				  a filename.");
	gtk_container_add(GTK_CONTAINER(window),hbox);
	gtk_widget_show(window);
	gtk_main();
	}
GObject Reference Manual里面的例子!
头像
cnkilior
论坛版主
帖子: 4984
注册时间: 2007-08-05 17:40

Re: [问个问题]这个widget是什么,怎么调出来?

#6

帖子 cnkilior » 2009-06-18 23:41

代码: 全选

type gtk
gtk 已被别名为“gcc -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lgio-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0  ”
gtk gtktooltips.c -o gtktooltips
回复