Mercurial > emacs
comparison src/xterm.c @ 33303:1dc1953987a7
(x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]: Map the
scroll bar widget after configuring it, so that it will appear at
the right position from the start.
(XTredeem_scroll_bar): Cleaned up.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 08 Nov 2000 15:45:40 +0000 |
parents | 834a6b4f08a4 |
children | 41fcaa0b864b |
comparison
equal
deleted
inserted
replaced
33302:c47be4412cfd | 33303:1dc1953987a7 |
---|---|
8294 if (!NILP (bar->next)) | 8294 if (!NILP (bar->next)) |
8295 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); | 8295 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
8296 | 8296 |
8297 /* Map the window/widget. */ | 8297 /* Map the window/widget. */ |
8298 #if USE_TOOLKIT_SCROLL_BARS | 8298 #if USE_TOOLKIT_SCROLL_BARS |
8299 XtMapWidget (SCROLL_BAR_X_WIDGET (bar)); | |
8300 XtConfigureWidget (SCROLL_BAR_X_WIDGET (bar), | 8299 XtConfigureWidget (SCROLL_BAR_X_WIDGET (bar), |
8301 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, | 8300 left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, |
8302 top, | 8301 top, |
8303 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, | 8302 width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, |
8304 height, 0); | 8303 height, 0); |
8304 XtMapWidget (SCROLL_BAR_X_WIDGET (bar)); | |
8305 #else /* not USE_TOOLKIT_SCROLL_BARS */ | 8305 #else /* not USE_TOOLKIT_SCROLL_BARS */ |
8306 XMapRaised (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar)); | 8306 XMapRaised (FRAME_X_DISPLAY (f), SCROLL_BAR_X_WINDOW (bar)); |
8307 #endif /* not USE_TOOLKIT_SCROLL_BARS */ | 8307 #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
8308 | 8308 |
8309 UNBLOCK_INPUT; | 8309 UNBLOCK_INPUT; |
8636 XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar; | 8636 XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar; |
8637 FRAME_CONDEMNED_SCROLL_BARS (frame) = bar; | 8637 FRAME_CONDEMNED_SCROLL_BARS (frame) = bar; |
8638 } | 8638 } |
8639 } | 8639 } |
8640 | 8640 |
8641 | |
8641 /* Un-mark WINDOW's scroll bar for deletion in this judgment cycle. | 8642 /* Un-mark WINDOW's scroll bar for deletion in this judgment cycle. |
8642 Note that WINDOW isn't necessarily condemned at all. */ | 8643 Note that WINDOW isn't necessarily condemned at all. */ |
8644 | |
8643 static void | 8645 static void |
8644 XTredeem_scroll_bar (window) | 8646 XTredeem_scroll_bar (window) |
8645 struct window *window; | 8647 struct window *window; |
8646 { | 8648 { |
8647 struct scroll_bar *bar; | 8649 struct scroll_bar *bar; |
8650 struct frame *f; | |
8648 | 8651 |
8649 /* We can't redeem this window's scroll bar if it doesn't have one. */ | 8652 /* We can't redeem this window's scroll bar if it doesn't have one. */ |
8650 if (NILP (window->vertical_scroll_bar)) | 8653 if (NILP (window->vertical_scroll_bar)) |
8651 abort (); | 8654 abort (); |
8652 | 8655 |
8653 bar = XSCROLL_BAR (window->vertical_scroll_bar); | 8656 bar = XSCROLL_BAR (window->vertical_scroll_bar); |
8654 | 8657 |
8655 /* Unlink it from the condemned list. */ | 8658 /* Unlink it from the condemned list. */ |
8656 { | 8659 f = XFRAME (WINDOW_FRAME (window)); |
8657 FRAME_PTR f = XFRAME (WINDOW_FRAME (window)); | 8660 if (NILP (bar->prev)) |
8658 | 8661 { |
8659 if (NILP (bar->prev)) | 8662 /* If the prev pointer is nil, it must be the first in one of |
8660 { | 8663 the lists. */ |
8661 /* If the prev pointer is nil, it must be the first in one of | 8664 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) |
8662 the lists. */ | 8665 /* It's not condemned. Everything's fine. */ |
8663 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) | 8666 return; |
8664 /* It's not condemned. Everything's fine. */ | 8667 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), |
8665 return; | 8668 window->vertical_scroll_bar)) |
8666 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), | 8669 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; |
8667 window->vertical_scroll_bar)) | 8670 else |
8668 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; | 8671 /* If its prev pointer is nil, it must be at the front of |
8669 else | 8672 one or the other! */ |
8670 /* If its prev pointer is nil, it must be at the front of | 8673 abort (); |
8671 one or the other! */ | 8674 } |
8672 abort (); | 8675 else |
8673 } | 8676 XSCROLL_BAR (bar->prev)->next = bar->next; |
8674 else | 8677 |
8675 XSCROLL_BAR (bar->prev)->next = bar->next; | 8678 if (! NILP (bar->next)) |
8676 | 8679 XSCROLL_BAR (bar->next)->prev = bar->prev; |
8677 if (! NILP (bar->next)) | 8680 |
8678 XSCROLL_BAR (bar->next)->prev = bar->prev; | 8681 bar->next = FRAME_SCROLL_BARS (f); |
8679 | 8682 bar->prev = Qnil; |
8680 bar->next = FRAME_SCROLL_BARS (f); | 8683 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); |
8681 bar->prev = Qnil; | 8684 if (! NILP (bar->next)) |
8682 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); | 8685 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
8683 if (! NILP (bar->next)) | |
8684 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); | |
8685 } | |
8686 } | 8686 } |
8687 | 8687 |
8688 /* Remove all scroll bars on FRAME that haven't been saved since the | 8688 /* Remove all scroll bars on FRAME that haven't been saved since the |
8689 last call to `*condemn_scroll_bars_hook'. */ | 8689 last call to `*condemn_scroll_bars_hook'. */ |
8690 | 8690 |