Meego上网本上怎么整合你的GTK应用

本文介绍了如何使用GTK库创建并配置窗口装饰,包括移除装饰、调整窗口大小及实现最大化。此外,还介绍了如何创建工具栏,并在工具栏中添加关闭按钮和设置按钮。

The WindowDecoration(装饰)

Remove the window decoration(删除窗口装饰):

1.  GtkWidget *window = gtk_window_new ();        gtk_window_set_decorated (GTK_WINDOW (window), FALSE);

复制代码


Window Size(窗口大小)Find the size of the screen and then set your preferred window size to it(找到窗口大小,设置为你的首选窗口大小):

1.  gtk_window_resize (GTK_WINDOW (window),                       max_screen_width,                       max_screen_height);       gtk_window_maximize (GTK_WINDOW (window));

复制代码


The Toolbar(工具条)Use a standard GtkToolbar along the top of the screen. Name this "MeeGoToolbar"(屏幕顶部用一个标准的GTK Toolbar:

1.  GtkWidget *toolbar = gtk_toolbar_new ();       gtk_widget_set_name (GTK_WIDGET (toolbar), "MeeGoToolbar");

复制代码


The Close Button(关闭按钮)Use a button in the far right hand corner of the toolbar for closing the window, name this "MeeGoCloseButton"(使用工具栏的最右边右上角的关闭窗口按钮):

1.  GtkWidget *close_button, *image;        close_button = gtk_button_new ();        gtk_widget_set_name (close_button, "MeeGoCloseButton");

复制代码


Use "window-close-hover" as the icon name(用“window-close-hover”作为图标名):

1.  image = gtk_image_new_from_icon_name ("window-close-hover", GTK_ICON_SIZE_DIALOG);    gtk_container_add (GTK_CONTAINER (close_button), image);

复制代码


The Settings ButtonSettings按钮)If your application has a settings area, add a GtkButton called "MeeGoSettingsButton"(假如你的应用有一个设置区,添加一个“MeeGoSettingsButton”为名的GtkButton:

1.      GtkWidget *close_button, *image;        close_button = gtk_button_new ();        gtk_widget_set_name (close_button, "MeeGoSettingsButton");

复制代码


Use "preferences-other-hover" as the icon name
(用“preferences-other-hover”作为图标的名):

1.  image = gtk_image_new_from_icon_name ("preferences-other-hover", GTK_ICON_SIZE_DIALOG);   

2.      gtk_container_add (GTK_CONTAINER (close_button), image);

复制代码

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值