惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cloudbric
Cloudbric
T
Threat Research - Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
AWS News Blog
AWS News Blog
P
Privacy & Cybersecurity Law Blog
H
Help Net Security
云风的 BLOG
云风的 BLOG
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
P
Privacy International News Feed
Blog — PlanetScale
Blog — PlanetScale
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
The Register - Security
The Register - Security
Recorded Future
Recorded Future
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cisco Blogs
PCI Perspectives
PCI Perspectives
Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
A
About on SuperTechFans
W
WeLiveSecurity
GbyAI
GbyAI
V
Vulnerabilities – Threatpost
The GitHub Blog
The GitHub Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Check Point Blog
Y
Y Combinator Blog
月光博客
月光博客
Scott Helme
Scott Helme
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
U
Unit 42
G
Google Developers Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Threatpost
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google Online Security Blog
Google Online Security Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 司徒正美

Virtual Reality

Implementing WebXR in WebKit for WPE A New Way to Browse: Eye Tracking Comes to Wolvic! Flexbox Cats (a.k.a fixing images in flexbox) Closing the gap (in flexbox 😇) Automatizing the Grid BlinkOn 3 I'm attending BlinkOn3 Grids everywhere! Adventures in the Grid Improving the editing code in WebKit http://publicsuffix.org support coming to libsoup ReSiStance 0.9.2 released ReSiStance 0.8 with Google Reader support WebKitGtk+ HTTP cache ready! ReSiStance 0.5 released ReSiStance with WebKitGtk inside Vive la ReSiStance! Tinymail 1.0 released The Postman always rings twice Some Modest sir? Sure, with Sugar please Moblin support for Tinymail Dear GMail IMAP server developers Another One Bites the Dust Modest with BODYSTRUCTURE support Speed, speed, speed !!! The beauty of git GCDS day #3 (a.k.a. GUADEC day #2) GCDS day #2 (a.k.a. GUADEC day #1) Igalia' new office party Modest @ FreeNode Modest Reloaded Back from GUADEC Get in touch Modest released! JHBuild and SVN problem Our little babies Igalia in the news Be Modest my friend Our dreams came true I want my GConf notifications Faster is better They're coming, don't let them go Dancing with mailboxes Drag and drop with sorted tree models (2) Drag and drop with sorted tree models Not so tiny ChangeLog Not so tiny(mail) Ekiga builds 😀 The 3.60 happiness movement GNOME 2.16 is dead. Long live GNOME 2.18 Lightweight apps Bye bye, Pluto Back to home/work/sound The real (virtual?) telepathy Mozilla Thunderbird 1 Evolution 0 What is a galago? Very special numbers Again with some DBUS stuff Gedit hacking; porting gedit to use D-BUS
Turn a GtkMenuBar into a GtkMenu
svillar · 2007-01-20 · via Virtual Reality

Again, a lot of time since my last post. If you’re interested, yes I’m still happy and I’m still contributing to tinymail. My contributions decreased a little bit these last weeks because I had other priorities but I’ll try to keep them going.

This afternoon I was trying to use the nice GtkUIManager stuff inside a Hildon application but when trying to add a new menu described in the UI XML definition file to the HildonWindow I realized that I had a problem. The reason is that hildon_window_set_menu expects a GtkMenu as second argument, but the GtkUIManager gives me a GtkMenuBar.

So I had to add an utility function to the code that converts from a GtkMenuBar to a GtkMenu. As you could see it’s really simple, but the very nice thing is that it still uses the definitions of the UI XML file.

GtkWidget *
menubar_to_menu (GtkUIManager *ui_manager) {
GtkWidget *main_menu;
GtkWidget *menubar;
GList *iter;

/* Create new main menu */
main_menu = gtk_menu_new();

/* Get the menubar from the UI manager */
menubar = gtk_ui_manager_get_widget (ui_manager, "/MenuBar");

iter = gtk_container_get_children (GTK_CONTAINER (menubar));
while (iter) {
GtkWidget *menu;

menu = GTK_WIDGET (iter->data);
gtk_widget_reparent(menu, main_menu);

iter = g_list_next (iter);
}
return main_menu;
}