aboutsummaryrefslogtreecommitdiffstats
path: root/src/widget.c
diff options
context:
space:
mode:
authorFred Pierresteguy1994-04-01 13:39:34 +0000
committerFred Pierresteguy1994-04-01 13:39:34 +0000
commitb3ccf2a206a2297cab3aabb02737691a22baa337 (patch)
treefaac9beec67aa809aaf149b333ba9f9472796acf /src/widget.c
parentd1cb44a4d6f9946a72f7555228c5f8c8487f15cf (diff)
downloademacs-b3ccf2a206a2297cab3aabb02737691a22baa337.tar.gz
emacs-b3ccf2a206a2297cab3aabb02737691a22baa337.zip
(EmacsFrameSetCharSize): Clean up code.
Replace XtVaSetValues by XtSetValues.
Diffstat (limited to 'src/widget.c')
-rw-r--r--src/widget.c43
1 files changed, 14 insertions, 29 deletions
diff --git a/src/widget.c b/src/widget.c
index c7f9accde85..4f212c99673 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -875,7 +875,9 @@ EmacsFrameSetCharSize (widget, columns, rows)
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
@@ -889,40 +891,23 @@ EmacsFrameSetCharSize (widget, columns, rows)
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
896result = 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
@@ -934,8 +919,8 @@ result = XtMakeResizeRequest ((Widget)ew,
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}