GNOME Bugzilla – Bug 737670
GtkCalendar days cannot be selected if vertical size is greater than preferred (e.g when inside a fill container)
Last modified: 2014-10-02 00:11:18 UTC
As of Gtk3 (tested on 3.10) GtkCalendar days become unseletable if GtkCalendar is inside a vertical-fill box.
Created attachment 287470 [details] gtk2 vs gtk3
Below is a bit of sample code to show the issue. In gtk3, the days shift to the bottom. The first two row of days (31 1 2 3 ...) can be selected, but anything below cannot. Tested on Fedora Linux 20. GtkVersion 3.10.9 #include <stdio.h> #include <stdlib.h> #include <gtk/gtk.h> int main( int argc, char *argv[] ) { //------------------ INIT GtkWidget *window; GtkWidget *vbox; GtkCalendar *calendar; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "GtkCalendar GTK3"); gtk_window_set_default_size(window, 300, 350); gtk_container_set_border_width (GTK_CONTAINER (window), 5); //--- Vertical Layout: vbox = gtk_vbox_new (FALSE, 10); gtk_container_add (GTK_CONTAINER (window), vbox); //------------------ ADD ELEMENTS calendar=gtk_calendar_new (); gtk_container_add (GTK_CONTAINER (vbox), calendar); //------------------ POST LOOP gtk_widget_show_all (window); gtk_main (); return 0; }
Once bug is fixed, could someone please reply in: https://bugs.eclipse.org/bugs/show_bug.cgi?id=445539 (SWT DateTime is affected by this). Thank you
If you want the calendar to stay at the top, just set the valign: gtk_widget_set_valign (calendar, GTK_ALIGN_START);
reopening; we should still try to improve the rendering with valign = FILL, and possibly there is some problem with clicking on days too
Created attachment 287524 [details] Screen shot with annotation outlining selection issue thank you for your comments, for clarification, attached is a screen shot with annotation showing the selection issue
Created attachment 287525 [details] issue in grid layout I read that gtk_vbox is deprecated as of gtk3.2: https://developer.gnome.org/gtk3/stable/GtkVBox.html#gtk-vbox-new It suggests to switch over to grid instead. If of use, I wrote a bit of code with 'grid' layout where the issue occurs also. (attached).
Created attachment 287526 [details] Screenshot with annotation for gtk_grid_calendar.c