GNOME Bugzilla – Bug 98711
Display week numbers in GtkCalendar
Last modified: 2004-12-22 21:47:04 UTC
It would be nice if the calendar could show week numbers to the left of each row. Possibly by preference setting? By using a somehow different text style, you could make it separated from the day numbers, so that it doesn't get confusing. Like an italic fixed font or something. I never know what is the current week number, but sometimes I need to know. Then it would be very handy to be able to look it up from the clock applet calendar.
Hakon: what version of gnome-panel are you talking about ? There's no calendar in the clock applet of GNOME 2 (or GNOME 2.1)...
It is gnome-panel-2.0.6 that is included in Red Hat Linux 8.0. I reach the calendar by clicking on the clock display. And that spawned window is also referred to as "Calendar" in the ALT+TAB window list. Perhaps Red Hat has made their own enhancement of the clock applet then?
Havoc: is this calendar thing Red Hat specific (something to do with your patch in bug #85723) ?
Yes, it's referring to my patch. This bug would go to gtk+ against GtkCalendar though, as the popup menu just shows a GtkCalendar widget.
Hmm, I can't find the component in Bugzilla. gtk+ doesn't contain any product like GtkCalendar.
Moving to gtk.
Well, GtkCalendar can display week numbers just fine (cf GTK_CALENDAR_SHOW_WEEK_NUMBERS), so I guess this bug should go back to gnome-panel.
I have a patch for this, but it needs GTK+ 2.5.x because we need gtk_calendar_get_display_options and gtk_calendar_set_display_options (else we'll override the GtkCalendarDisplayOptions of the calendar). I'm not sure what to do: will HEAD depends on GTK+ 2.5.x or not ? Patch is : @@ -462,6 +467,7 @@ { GtkWindow *window; GtkWidget *calendar; + GtkCalendarDisplayOptions options; window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); @@ -478,6 +484,11 @@ G_CALLBACK (close_on_escape), cd); calendar = gtk_calendar_new (); + + options = gtk_calendar_get_display_options (GTK_CALENDAR (calendar)); + options |= GTK_CALENDAR_SHOW_WEEK_NUMBERS; + gtk_calendar_set_display_options (GTK_CALENDAR (calendar), + options); gtk_container_add (GTK_CONTAINER (window), calendar);
The patch looks good. As soon as we start depending on gtk+ HEAD please go ahead and commit. Thanks :)
Fixed in HEAD: 2003-10-28 Vincent Untz <vincent@vuntz.net> * clock.c: (create_calendar) show the week numbers in the calendar. Fix bug #98711.
*** Bug 135331 has been marked as a duplicate of this bug. ***