Archive

Archive for January, 2007

Not so tiny ChangeLog

January 28th, 2007 svillar No comments

A few days ago Philip wrote the following in the tinymail mailing list in response to a patch that I sent to the list:

Yep, let's go for this. Commit please  :)  

Don't forget our poor little ChangeLog file

I thought, OK Philip it could be poor, but little? Then I decided to take a deeper look to our lovely ChangeLog file and I extracted some figures. First of all the number of entries is 153, really impressive if you realize that the first commit was made on 2006-01-17, just one year ago. The list of contributors ordered by number of entries is shown next

Philip Van Hoof 101
Sergio Villar Senin 20
Dirk-Jan C. Binnema 10
Øystein Gisnås 7
Florian Boor 3
Thomas Hisch 3
James Doc Livingston 2
Raphaël Slinckx 1
Chris Lord 1
Thomas Viehmann 1
Gustavo J. A. M. Carneiro 1
Sankarshan Mukhopadhyay 1
Scott Arrington (muppet) 1
Don Scorgie 1

As you could see, there are great names there, and I’m currently in the second place, Philip don’t look behind because I’m getting closer :-) .

Categories: Hacking Tags:

Turn a GtkMenuBar into a GtkMenu

January 19th, 2007 svillar No comments

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;
}
Categories: Hacking Tags:

Bad Behavior has blocked 25 access attempts in the last 7 days.