@Override void createHandle (int index) { state |= HANDLE; fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_widget_set_has_window (fixedHandle, true); long /*int*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10); if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES); if ((style & SWT.HORIZONTAL) != 0) { handle = gtk_scrollbar_new (OS.GTK_ORIENTATION_HORIZONTAL, hAdjustment); } else { handle = gtk_scrollbar_new (OS.GTK_ORIENTATION_VERTICAL, hAdjustment); } if (handle == 0) error (SWT.ERROR_NO_HANDLES); /* * Bug in GTK. In GTK 2.10, the buttons on either end of * a horizontal slider are created taller then the slider bar * when the GTK_CAN_FOCUS flag is set. The fix is not to set * the flag for horizontal bars in all versions of 2.10. Note * that a bug has been logged with GTK about this issue. * (http://bugzilla.gnome.org/show_bug.cgi?id=475909) */ if ((style & SWT.VERTICAL) != 0) { OS.gtk_widget_set_can_focus (handle, true); } OS.gtk_container_add (fixedHandle, handle); }
@Override void createHandle (int index) { state |= HANDLE; fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_widget_set_has_window (fixedHandle, true); int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10); if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES); if ((style & SWT.HORIZONTAL) != 0) { handle = gtk_scrollbar_new (OS.GTK_ORIENTATION_HORIZONTAL, hAdjustment); } else { handle = gtk_scrollbar_new (OS.GTK_ORIENTATION_VERTICAL, hAdjustment); } if (handle == 0) error (SWT.ERROR_NO_HANDLES); /* * Bug in GTK. In GTK 2.10, the buttons on either end of * a horizontal slider are created taller then the slider bar * when the GTK_CAN_FOCUS flag is set. The fix is not to set * the flag for horizontal bars in all versions of 2.10. Note * that a bug has been logged with GTK about this issue. * (http://bugzilla.gnome.org/show_bug.cgi?id=475909) */ if ((style & SWT.VERTICAL) != 0) { OS.gtk_widget_set_can_focus (handle, true); } OS.gtk_container_add (fixedHandle, handle); }
@Override void createHandle (int index) { state |= HANDLE; fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_widget_set_has_window (fixedHandle, true); int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10); if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES); if ((style & SWT.HORIZONTAL) != 0) { handle = gtk_scrollbar_new (OS.GTK_ORIENTATION_HORIZONTAL, hAdjustment); } else { handle = gtk_scrollbar_new (OS.GTK_ORIENTATION_VERTICAL, hAdjustment); } if (handle == 0) error (SWT.ERROR_NO_HANDLES); /* * Bug in GTK. In GTK 2.10, the buttons on either end of * a horizontal slider are created taller then the slider bar * when the GTK_CAN_FOCUS flag is set. The fix is not to set * the flag for horizontal bars in all versions of 2.10. Note * that a bug has been logged with GTK about this issue. * (http://bugzilla.gnome.org/show_bug.cgi?id=475909) */ if ((style & SWT.VERTICAL) != 0) { OS.gtk_widget_set_can_focus (handle, true); } OS.gtk_container_add (fixedHandle, handle); }
/** * Removes the listener from the collection of listeners who will * be notified when the user changes the receiver's value. * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see SelectionListener * @see #addSelectionListener */ public void removeSelectionListener (SelectionListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection,listener); }
/** * Removes the listener from the collection of listeners who will * be notified when the user changes the receiver's value. * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see SelectionListener * @see #addSelectionListener */ public void removeSelectionListener (SelectionListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection,listener); }
/** * Removes the listener from the collection of listeners who will * be notified when the user changes the receiver's value. * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see SelectionListener * @see #addSelectionListener */ public void removeSelectionListener (SelectionListener listener) { checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection,listener); }
/** * Removes the listener from the collection of listeners who will * be notified when the user changes the receiver's value. * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see SelectionListener * @see #addSelectionListener */ public void removeSelectionListener(SelectionListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook(SWT.Selection, listener); eventTable.unhook(SWT.DefaultSelection,listener); }
/** * Removes the listener from the collection of listeners who will * be notified when the user changes the receiver's value. * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see SelectionListener * @see #addSelectionListener */ public void removeSelectionListener (SelectionListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); if (eventTable == null) return; eventTable.unhook (SWT.Selection, listener); eventTable.unhook (SWT.DefaultSelection,listener); }
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection,typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener(listener); addListener(SWT.Selection,typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection,typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection,typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener(listener); addListener (SWT.Selection,typedListener);