Mercurial > emacs
comparison src/widget.c @ 6629:1a11d0ceb11b
(EmacsFrameSetCharSize): Clean up code.
Replace XtVaSetValues by XtSetValues.
author | Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr> |
---|---|
date | Fri, 01 Apr 1994 13:39:34 +0000 |
parents | c0a3d01237ed |
children | 492ff2e2ddb7 |
comparison
equal
deleted
inserted
replaced
6628:c359dfd21b00 | 6629:1a11d0ceb11b |
---|---|
873 { | 873 { |
874 EmacsFrame ew = (EmacsFrame) widget; | 874 EmacsFrame ew = (EmacsFrame) widget; |
875 Dimension pixel_width, pixel_height, granted_width, granted_height; | 875 Dimension pixel_width, pixel_height, granted_width, granted_height; |
876 XtGeometryResult result; | 876 XtGeometryResult result; |
877 struct frame *f = ew->emacs_frame.frame; | 877 struct frame *f = ew->emacs_frame.frame; |
878 | 878 Arg al[2]; |
879 int ac = 0; | |
880 | |
879 if (columns < 3) columns = 3; /* no way buddy */ | 881 if (columns < 3) columns = 3; /* no way buddy */ |
880 if (rows < 3) rows = 3; | 882 if (rows < 3) rows = 3; |
881 | 883 |
882 f->display.x->left_pos = f->display.x->widget->core.x; | 884 f->display.x->left_pos = f->display.x->widget->core.x; |
883 f->display.x->top_pos = f->display.x->widget->core.y; | 885 f->display.x->top_pos = f->display.x->widget->core.y; |
887 = (FRAME_HAS_VERTICAL_SCROLL_BARS (f) | 889 = (FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
888 ? VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f) | 890 ? VERTICAL_SCROLL_BAR_PIXEL_WIDTH (f) |
889 : 0); | 891 : 0); |
890 char_to_pixel_size (ew, columns, rows, &pixel_width, &pixel_height); | 892 char_to_pixel_size (ew, columns, rows, &pixel_width, &pixel_height); |
891 | 893 |
892 /* Dont call XtMakeResize Request. This appears to not work for all | |
893 the cases. | |
894 Use XtVaSetValues instead. */ | |
895 #if 0 | |
896 result = XtMakeResizeRequest ((Widget)ew, | |
897 pixel_width, pixel_height, | |
898 &granted_width, &granted_height); | |
899 if (result == XtGeometryAlmost) | |
900 XtMakeResizeRequest ((Widget) ew, granted_width, granted_height, | |
901 NULL, NULL); | |
902 #endif | |
903 /* Recompute the entire geometry management. */ | 894 /* Recompute the entire geometry management. */ |
904 if (ew->core.width != pixel_width || ew->core.height != pixel_height) | 895 if (ew->core.width != pixel_width || ew->core.height != pixel_height) |
905 { | 896 { |
906 int hdelta = pixel_height - ew->core.height; | 897 int hdelta = pixel_height - ew->core.height; |
907 int column_widget_height = f->display.x->column_widget->core.height; | 898 int column_widget_height = f->display.x->column_widget->core.height; |
908 Arg al[2]; | |
909 int ac = 0; | |
910 | |
911 XawPanedSetRefigureMode (f->display.x->column_widget, False); | 899 XawPanedSetRefigureMode (f->display.x->column_widget, False); |
912 | 900 |
901 ac = 0; | |
913 XtSetArg (al[ac], XtNheight, pixel_height); ac++; | 902 XtSetArg (al[ac], XtNheight, pixel_height); ac++; |
914 XtSetArg (al[ac], XtNwidth, pixel_width); ac++; | 903 XtSetArg (al[ac], XtNwidth, pixel_width); ac++; |
915 XtSetValues ((Widget) ew, al, ac); | 904 XtSetValues ((Widget) ew, al, ac); |
916 #if 0 | 905 |
917 XtVaSetValues ((Widget) ew, | 906 ac = 0; |
918 XtNheight, pixel_height, | 907 XtSetArg (al[ac], XtNheight, column_widget_height + hdelta); ac++; |
919 XtNwidth, pixel_width, | 908 XtSetArg (al[ac], XtNwidth, pixel_width); ac++; |
920 0); | 909 XtSetValues (f->display.x->column_widget, al, ac); |
921 #endif | 910 |
922 XtVaSetValues (f->display.x->column_widget, | |
923 XtNwidth, pixel_width, | |
924 XtNheight, column_widget_height + hdelta, | |
925 0); | |
926 XawPanedSetRefigureMode (f->display.x->column_widget, True); | 911 XawPanedSetRefigureMode (f->display.x->column_widget, True); |
927 } | 912 } |
928 | 913 |
929 /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to | 914 /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to |
930 receive in the ConfigureNotify event; if we get what we asked | 915 receive in the ConfigureNotify event; if we get what we asked |
932 we have to make sure to do it here. */ | 917 we have to make sure to do it here. */ |
933 SET_FRAME_GARBAGED (f); | 918 SET_FRAME_GARBAGED (f); |
934 | 919 |
935 /* Coordinates of the toplevel widget seem to have been lost. | 920 /* Coordinates of the toplevel widget seem to have been lost. |
936 So set it to the rignt values. */ | 921 So set it to the rignt values. */ |
937 XtVaSetValues (f->display.x->widget, | 922 ac = 0; |
938 XtNx, f->display.x->left_pos, | 923 XtSetArg (al[ac], XtNx, f->display.x->left_pos); ac++; |
939 XtNy, f->display.x->top_pos, | 924 XtSetArg (al[ac], XtNy, f->display.x->top_pos); ac++; |
940 0); | 925 XtSetValues (f->display.x->widget, al, ac); |
941 } | 926 } |