diff options
| author | Gerd Moellmann | 2001-03-19 14:11:23 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-19 14:11:23 +0000 |
| commit | 275841bf2312cfd0df10c8822f7e176b069ed177 (patch) | |
| tree | 8850907e40207a9a288c54425d6de2b8729cace4 /src | |
| parent | 65a8f1bdc2d9150fc97338e4116680b255cd595f (diff) | |
| download | emacs-275841bf2312cfd0df10c8822f7e176b069ed177.tar.gz emacs-275841bf2312cfd0df10c8822f7e176b069ed177.zip | |
(x_create_tip_frame): Add parameter TEXT. Set the
tip frame's root window buffer to *tip* right after creating
the frame.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/xfns.c b/src/xfns.c index 97c57382f41..ddd158ed98a 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -10382,7 +10382,7 @@ hide_hourglass () | |||
| 10382 | ***********************************************************************/ | 10382 | ***********************************************************************/ |
| 10383 | 10383 | ||
| 10384 | static Lisp_Object x_create_tip_frame P_ ((struct x_display_info *, | 10384 | static Lisp_Object x_create_tip_frame P_ ((struct x_display_info *, |
| 10385 | Lisp_Object)); | 10385 | Lisp_Object, Lisp_Object)); |
| 10386 | static void compute_tip_xy P_ ((struct frame *, Lisp_Object, Lisp_Object, | 10386 | static void compute_tip_xy P_ ((struct frame *, Lisp_Object, Lisp_Object, |
| 10387 | Lisp_Object, int *, int *)); | 10387 | Lisp_Object, int *, int *)); |
| 10388 | 10388 | ||
| @@ -10420,7 +10420,8 @@ unwind_create_tip_frame (frame) | |||
| 10420 | 10420 | ||
| 10421 | 10421 | ||
| 10422 | /* Create a frame for a tooltip on the display described by DPYINFO. | 10422 | /* Create a frame for a tooltip on the display described by DPYINFO. |
| 10423 | PARMS is a list of frame parameters. Value is the frame. | 10423 | PARMS is a list of frame parameters. TEXT is the string to |
| 10424 | display in the tip frame. Value is the frame. | ||
| 10424 | 10425 | ||
| 10425 | Note that functions called here, esp. x_default_parameter can | 10426 | Note that functions called here, esp. x_default_parameter can |
| 10426 | signal errors, for instance when a specified color name is | 10427 | signal errors, for instance when a specified color name is |
| @@ -10428,9 +10429,9 @@ unwind_create_tip_frame (frame) | |||
| 10428 | when this happens. */ | 10429 | when this happens. */ |
| 10429 | 10430 | ||
| 10430 | static Lisp_Object | 10431 | static Lisp_Object |
| 10431 | x_create_tip_frame (dpyinfo, parms) | 10432 | x_create_tip_frame (dpyinfo, parms, text) |
| 10432 | struct x_display_info *dpyinfo; | 10433 | struct x_display_info *dpyinfo; |
| 10433 | Lisp_Object parms; | 10434 | Lisp_Object parms, text; |
| 10434 | { | 10435 | { |
| 10435 | struct frame *f; | 10436 | struct frame *f; |
| 10436 | Lisp_Object frame, tem; | 10437 | Lisp_Object frame, tem; |
| @@ -10441,6 +10442,8 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 10441 | struct gcpro gcpro1, gcpro2, gcpro3; | 10442 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 10442 | struct kboard *kb; | 10443 | struct kboard *kb; |
| 10443 | int face_change_count_before = face_change_count; | 10444 | int face_change_count_before = face_change_count; |
| 10445 | Lisp_Object buffer; | ||
| 10446 | struct buffer *old_buffer; | ||
| 10444 | 10447 | ||
| 10445 | check_x (); | 10448 | check_x (); |
| 10446 | 10449 | ||
| @@ -10466,6 +10469,15 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 10466 | GCPRO3 (parms, name, frame); | 10469 | GCPRO3 (parms, name, frame); |
| 10467 | f = make_frame (1); | 10470 | f = make_frame (1); |
| 10468 | XSETFRAME (frame, f); | 10471 | XSETFRAME (frame, f); |
| 10472 | |||
| 10473 | buffer = Fget_buffer_create (build_string (" *tip*")); | ||
| 10474 | Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer); | ||
| 10475 | old_buffer = current_buffer; | ||
| 10476 | set_buffer_internal_1 (XBUFFER (buffer)); | ||
| 10477 | Ferase_buffer (); | ||
| 10478 | Finsert (1, &text); | ||
| 10479 | set_buffer_internal_1 (old_buffer); | ||
| 10480 | |||
| 10469 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; | 10481 | FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; |
| 10470 | record_unwind_protect (unwind_create_tip_frame, frame); | 10482 | record_unwind_protect (unwind_create_tip_frame, frame); |
| 10471 | 10483 | ||
| @@ -10868,7 +10880,7 @@ DY added (default is -10).") | |||
| 10868 | 10880 | ||
| 10869 | /* Create a frame for the tooltip, and record it in the global | 10881 | /* Create a frame for the tooltip, and record it in the global |
| 10870 | variable tip_frame. */ | 10882 | variable tip_frame. */ |
| 10871 | frame = x_create_tip_frame (FRAME_X_DISPLAY_INFO (f), parms); | 10883 | frame = x_create_tip_frame (FRAME_X_DISPLAY_INFO (f), parms, string); |
| 10872 | f = XFRAME (frame); | 10884 | f = XFRAME (frame); |
| 10873 | 10885 | ||
| 10874 | /* Set up the frame's root window. Currently we use a size of 80 | 10886 | /* Set up the frame's root window. Currently we use a size of 80 |
| @@ -10882,12 +10894,8 @@ DY added (default is -10).") | |||
| 10882 | w->pseudo_window_p = 1; | 10894 | w->pseudo_window_p = 1; |
| 10883 | 10895 | ||
| 10884 | /* Display the tooltip text in a temporary buffer. */ | 10896 | /* Display the tooltip text in a temporary buffer. */ |
| 10885 | buffer = Fget_buffer_create (build_string (" *tip*")); | ||
| 10886 | Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer); | ||
| 10887 | old_buffer = current_buffer; | 10897 | old_buffer = current_buffer; |
| 10888 | set_buffer_internal_1 (XBUFFER (buffer)); | 10898 | set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); |
| 10889 | Ferase_buffer (); | ||
| 10890 | Finsert (1, &string); | ||
| 10891 | clear_glyph_matrix (w->desired_matrix); | 10899 | clear_glyph_matrix (w->desired_matrix); |
| 10892 | clear_glyph_matrix (w->current_matrix); | 10900 | clear_glyph_matrix (w->current_matrix); |
| 10893 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); | 10901 | SET_TEXT_POS (pos, BEGV, BEGV_BYTE); |