Sets the Look and Feel to the system default and sets the
property "apple.laf.useScreenMenuBar" to true (mac specific)
429426
public static void setSystemLookAndFeel() {
		try {
			System.setProperty("apple.laf.useScreenMenuBar", "true");
			System.setProperty("com.apple.mrj.application.apple.menu.about.name", Resources.getString(Resources.APPLICATION_NAME));
			
			String name = UIManager.getSystemLookAndFeelClassName();
			UIManager.setLookAndFeel(name);
		} catch (Exception e) {
			String s = "Couldn't set system LookandFeel";
			logger.log(Level.WARNING, s, e);
		}
	}
942437
public void addNavButtons()
    {
        ResourceBundle resources = ((BaseApplication)this.getTask().getApplication()).getResources(ResourceConstants.PROGRAM_RESOURCE, true);
        new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.GROUP, ClassProject.RESOURCE_DETAIL_SCREEN, resources.getString(ClassProject.RESOURCE_DETAIL_SCREEN));
        new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, MenuConstants.DISTRIBUTION, ClassProject.CLASS_DETAIL_SCREEN, resources.getString(ClassProject.CLASS_DETAIL_SCREEN));
        super.addNavButtons();
    }
110980
public void updateStyle(AbstractButton b) {
        SeaGlassContext context  = getContext(b, SynthConstants.ENABLED);
        SynthStyle      oldStyle = style;

        style = SeaGlassLookAndFeel.updateStyle(context, this);
        if (style != oldStyle) {
            if (b.getMargin() == null || (b.getMargin() instanceof UIResource)) {
                Insets margin = (Insets) style.get(context, getPropertyPrefix() + "margin");

                if (margin == null) {
                    // Some places assume margins are non-null.
                    margin = SeaGlassLookAndFeel.EMPTY_UIRESOURCE_INSETS;
                }

                b.setMargin(margin);
            }

            Object value = style.get(context, getPropertyPrefix() + "iconTextGap");

            if (value != null) {
                LookAndFeel.installProperty(b, "iconTextGap", value);
            }

            value = style.get(context, getPropertyPrefix() + "contentAreaFilled");
            LookAndFeel.installProperty(b, "contentAreaFilled", value != null ? value : Boolean.TRUE);

            value = b.getClientProperty(APPLE_PREFIX + "buttonType");
            if (value != null) {
                if ("segmented".equals(value)) {
                    b.setMargin(SeaGlassLookAndFeel.EMPTY_UIRESOURCE_INSETS);
                }
            }

            if (oldStyle != null) {
                uninstallKeyboardActions(b);
                installKeyboardActions(b);
            }
        }

        context.dispose();
    }
850229
def set_mac_wallpaper(img):
    """"""
    db_file = "Library/Application Support/Dock/desktoppicture.db"
    db_path = os.path.join(HOME, db_file)
    img_dir, _ = os.path.split(img)

    # Clear the existing picture data and write the image paths
    sql = "delete from data; "
    sql += "insert into data values(\"%s\"); " % img_dir
    sql += "insert into data values(\"%s\"); " % img

    # Set all monitors/workspaces to the selected image
    sql += "update preferences set data_id=2 where key=1 or key=2 or key=3; "
    sql += "update preferences set data_id=1 where key=10 or key=20 or key=30;"

    subprocess.call(["sqlite3", db_path, sql])

    # Kill the dock to fix issues with cached wallpapers.
    # macOS caches wallpapers and if a wallpaper is set that shares
    # the filename with a cached wallpaper, the cached wallpaper is
    # used instead.
    subprocess.call(["killall", "Dock"])
1292437
public static void updateLookAndFeel(Container container, PropertyOwner propertyOwner, Map<String,Object> properties)
    {
        String lookAndFeelClassName = ScreenUtil.getPropery(ScreenUtil.LOOK_AND_FEEL, propertyOwner, properties, null);
        if (lookAndFeelClassName == null)
            lookAndFeelClassName = ScreenUtil.DEFAULT;
        if (ScreenUtil.DEFAULT.equalsIgnoreCase(lookAndFeelClassName))
        {
//            lookAndFeelClassName = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
            lookAndFeelClassName = UIManager.getCrossPlatformLookAndFeelClassName();
        }
        if (ScreenUtil.SYSTEM.equalsIgnoreCase(lookAndFeelClassName))
            lookAndFeelClassName = UIManager.getSystemLookAndFeelClassName();

        String themeClassName = ScreenUtil.getPropery(ScreenUtil.THEME, propertyOwner, properties, null);
        MetalTheme theme = null;

        FontUIResource font = ScreenUtil.getFont(propertyOwner, properties, false);
        ColorUIResource colorText = ScreenUtil.getColor(ScreenUtil.TEXT_COLOR, propertyOwner, properties);
        ColorUIResource colorControl = ScreenUtil.getColor(ScreenUtil.CONTROL_COLOR, propertyOwner, properties);
        ColorUIResource colorBackground = ScreenUtil.getColor(ScreenUtil.BACKGROUND_COLOR, propertyOwner, properties);

        if ((themeClassName == null) || (themeClassName.equalsIgnoreCase(ScreenUtil.DEFAULT)))
            if (font == null)
                font = ScreenUtil.getFont(propertyOwner, properties, true);

        if ((font != null) || (colorControl != null) || (colorText != null))
        {
            if (!(theme instanceof CustomTheme))
                theme = new CustomTheme();
            if (font != null)
                ((CustomTheme)theme).setDefaultFont(font);
            if (colorControl != null)
                ((CustomTheme)theme).setWhite(colorControl);
            if (colorText != null)
                ((CustomTheme)theme).setBlack(colorText);
            if (colorBackground != null)
            {
                ((CustomTheme)theme).setSecondaryColor(colorBackground);
                ((CustomTheme)theme).setPrimaryColor(colorBackground);
            }
        }
        else
        {
            if ((themeClassName == null) || (themeClassName.equalsIgnoreCase(ScreenUtil.DEFAULT)))
                theme = null;   //? createDefaultTheme();
            else
            	theme = (MetalTheme)ClassServiceUtility.getClassService().makeObjectFromClassName(themeClassName);
        }
        
        if (MetalLookAndFeel.class.getName().equals(lookAndFeelClassName))
        {
            if (theme == null)
                theme = new OceanTheme();
            MetalLookAndFeel.setCurrentTheme(theme);
        }
        
        try   {
            UIManager.setLookAndFeel(lookAndFeelClassName);
        } catch (Exception ex)  {
            ex.printStackTrace();
        }

        SwingUtilities.updateComponentTreeUI(container);
    }
958479
def setCurrentIndex(self, index):
        
        super(XViewPanel, self).setCurrentIndex(index)
        self.tabBar().setCurrentIndex(index)
817947
public void enablePreferencesMenuItem(boolean b) {
        getPreferencesMenuItem().setEnabled(b);
        if (MainFrame.MAC_OS_X) {
            if (osxPrefsEnableMethod != null) {
                Object args[] = { b };
                try {
                    osxPrefsEnableMethod.invoke(osxAdapter, args);
                } catch (Exception e) {
                    System.err.println("Exception while enabling Preferences menu: " + e);
                }
            }
        }
    }
127314
def set_visual_style(self, full_screen_style=False):
        

        LOGGER.debug("> Setting Application visual style.")
        platform_styles = {"Windows": (("Windows", "Microsoft"),
                                       UiConstants.windows_style,
                                       UiConstants.windows_stylesheet_file,
                                       UiConstants.windows_full_screen_stylesheet_file),
                           "Darwin": (("Darwin",),
                                      UiConstants.darwin_style,
                                      UiConstants.darwin_stylesheet_file,
                                      UiConstants.darwin_full_screen_stylesheet_file),
                           "Linux": (("Linux",),
                                     UiConstants.linux_style,
                                     UiConstants.linux_stylesheet_file,
                                     UiConstants.linux_full_screen_stylesheet_file)}

        style_sheet_file = None
        for platform_style, settings in platform_styles.iteritems():
            LOGGER.debug("> Setting '{0}' visual style.".format(platform_style))
            platform_systems, style, styleSheeFile, full_screen_style_sheet_file = settings
            if platform.system() in platform_systems:
                RuntimeGlobals.application.setStyle(style)
                style_sheet_path = umbra.ui.common.get_resource_path(styleSheeFile)
                if full_screen_style:
                    full_screen_style_sheet_path = umbra.ui.common.get_resource_path(full_screen_style_sheet_file,
                                                                                     raise_exception=False)
                    style_sheet_path = full_screen_style_sheet_path or style_sheet_path
                style_sheet_file = foundations.io.File(style_sheet_path)
                break

        if not style_sheet_file:
            raise foundations.exceptions.FileExistsError(
                "{0} | No stylesheet file found, visual style will not be applied!".format(self.__class__.__name__))

        if foundations.common.path_exists(style_sheet_file.path):
            LOGGER.debug("> Reading style sheet file: '{0}'.".format(style_sheet_file.path))
            style_sheet_file.cache()
            for i, line in enumerate(style_sheet_file.content):
                search = re.search(r"url\((?P<url>.*)\)", line)
                if not search:
                    continue

                style_sheet_file.content[i] = line.replace(search.group("url"),
                                                           foundations.strings.to_forward_slashes(
                                                               umbra.ui.common.get_resource_path(search.group("url"))))
            RuntimeGlobals.application.setStyleSheet(QString("".join(style_sheet_file.content)))
            return True
        else:
            raise foundations.exceptions.FileExistsError(
                "{0} | '{1}' stylesheet file is not available, visual style will not be applied!".format(
                    self.__class__.__name__, style_sheet_file.path))
1360301
def _set_menu_toggles(self):
        """"""

        toggles = [
            (self.main_toolbar, "main_window_toolbar", _("Main toolbar")),
            (self.macro_toolbar, "macro_toolbar", _("Macro toolbar")),
            (self.macro_panel, "macro_panel", _("Macro panel")),
            (self.attributes_toolbar, "attributes_toolbar",
             _("Format toolbar")),
            (self.find_toolbar, "find_toolbar", _("Find toolbar")),
            (self.widget_toolbar, "widget_toolbar", _("Widget toolbar")),
            (self.entry_line_panel, "entry_line_panel", _("Entry line")),
            (self.table_list_panel, "table_list_panel", _("Table list")),
        ]

        for toolbar, pane_name, toggle_label in toggles:
            # Get pane from aui manager
            pane = self._mgr.GetPane(pane_name)

            # Get menu item to toggle
            toggle_id = self.menubar.FindMenuItem(_("View"), toggle_label)
            if toggle_id != -1:
                # Check may fail if translation is incomplete
                toggle_item = self.menubar.FindItemById(toggle_id)

                # Adjust toggle to pane visibility
                toggle_item.Check(pane.IsShown())
583998
function _setupGoLiveMenu() {
        LiveDevImpl.on("statusChange", function statusChange(event, status) {
            // Update the checkmark next to 'Live Preview' menu item
            // Add checkmark when status is STATUS_ACTIVE; otherwise remove it
            CommandManager.get(Commands.FILE_LIVE_FILE_PREVIEW).setChecked(status === LiveDevImpl.STATUS_ACTIVE);
            CommandManager.get(Commands.FILE_LIVE_HIGHLIGHT).setEnabled(status === LiveDevImpl.STATUS_ACTIVE);
        });
    }
508461
public static void setDefaults() {

        lineColor = Color.BLACK;
        fontColor=Color.WHITE;
        backgroundColor=Color.BLACK;
        lineWidth = 1f;
        fontSizeDp=32;
        DEBUG=false;
        DEBUG2=false;
    }
71089
def _overrideMasterSettings(self):
        
        # config-obj dict of defaults
        cod = self._getGuiSettings()

        # our own GUI setup
        self._appName              = APP_NAME
        self._appHelpString        = tealHelpString
        self._useSimpleAutoClose   = self._do_usac
        self._showExtraHelpButton  = False
        self._saveAndCloseOnExec   = cfgGetBool(cod, 'saveAndCloseOnExec', True)
        self._showHelpInBrowser    = cfgGetBool(cod, 'showHelpInBrowser', False)
        self._writeProtectOnSaveAs = cfgGetBool(cod, 'writeProtectOnSaveAsOpt', True)
        self._flagNonDefaultVals   = cfgGetBool(cod, 'flagNonDefaultVals', None)
        self._optFile              = APP_NAME.lower()+".optionDB"

        # our own colors
        # prmdrss teal: #00ffaa, pure cyan (teal) #00ffff (darker) #008080
        # "#aaaaee" is a darker but good blue, but "#bbbbff" pops
        ltblu = "#ccccff" # light blue
        drktl = "#008888" # darkish teal
        self._frmeColor = cod.get('frameColor', drktl)
        self._taskColor = cod.get('taskBoxColor', ltblu)
        self._bboxColor = cod.get('buttonBoxColor', ltblu)
        self._entsColor = cod.get('entriesColor', ltblu)
        self._flagColor = cod.get('flaggedColor', 'brown')

        # double check _canExecute, but only if it is still set to the default
        if self._canExecute and self._taskParsObj: # default _canExecute=True
            self._canExecute = self._taskParsObj.canExecute()
        self._showExecuteButton = self._canExecute

        # check on the help string - just to see if it is HTML
        # (could use HTMLParser here if need be, be quick and simple tho)
        hhh = self.getHelpString(self.pkgName+'.'+self.taskName)
        if hhh:
            hhh = hhh.lower()
            if hhh.find('<html') >= 0 or hhh.find('</html>') > 0:
                self._knowTaskHelpIsHtml = True
            elif hhh.startswith('http:') or hhh.startswith('https:'):
                self._knowTaskHelpIsHtml = True
            elif hhh.startswith('file:') and \
                 (hhh.endswith('.htm') or hhh.endswith('.html')):
                self._knowTaskHelpIsHtml = True
837724
def apply_settings(self):
        """"""
        qapp = QApplication.instance()
        # Set 'gtk+' as the default theme in Gtk-based desktops
        # Fixes Issue 2036
        if is_gtk_desktop() and ('GTK+' in QStyleFactory.keys()):
            try:
                qapp.setStyle('gtk+')
            except:
                pass
        else:
            style_name = CONF.get('appearance', 'windows_style',
                                  self.default_style)
            style = QStyleFactory.create(style_name)
            if style is not None:
                style.setProperty('name', style_name)
                qapp.setStyle(style)

        default = self.DOCKOPTIONS
        if CONF.get('main', 'vertical_tabs'):
            default = default|QMainWindow.VerticalTabs
        if CONF.get('main', 'animated_docks'):
            default = default|QMainWindow.AnimatedDocks
        self.setDockOptions(default)

        self.apply_panes_settings()
        self.apply_statusbar_settings()

        if CONF.get('main', 'use_custom_cursor_blinking'):
            qapp.setCursorFlashTime(CONF.get('main', 'custom_cursor_blinking'))
        else:
            qapp.setCursorFlashTime(self.CURSORBLINK_OSDEFAULT)
884062
def wm_preferences(name,
                   user=None,
                   action_double_click_titlebar=None,
                   action_middle_click_titlebar=None,
                   action_right_click_titlebar=None,
                   application_based=None,
                   audible_bell=None,
                   auto_raise=None,
                   auto_raise_delay=None,
                   button_layout=None,
                   disable_workarounds=None,
                   focus_mode=None,
                   focus_new_windows=None,
                   mouse_button_modifier=None,
                   num_workspaces=None,
                   raise_on_click=None,
                   resize_with_right_button=None,
                   theme=None,
                   titlebar_font=None,
                   titlebar_uses_system_font=None,
                   visual_bell=None,
                   visual_bell_type=None,
                   workspace_names=None,
                   **kwargs):
    '''
    
    '''
    gnome_kwargs = {
        'user': user,
        'schema': 'org.gnome.desktop.wm.preferences'
    }

    preferences = ['action_double_click_titlebar',
            'action_middle_click_titlebar', 'action_right_click_titlebar',
            'application_based', 'audible_bell', 'auto_raise',
            'auto_raise_delay', 'button_layout', 'disable_workarounds',
            'focus_mode', 'focus_new_windows', 'mouse_button_modifier',
            'num_workspaces', 'raise_on_click', 'resize_with_right_button',
            'theme', 'titlebar_font', 'titlebar_uses_system_font',
            'visual_bell', 'visual_bell_type', 'workspace_names']

    preferences_hash = {}
    for pref in preferences:
        if pref in locals() and locals()[pref] is not None:
            key = re.sub('_', '-', pref)
            preferences_hash[key] = locals()[pref]

    return _do(name, gnome_kwargs, preferences_hash)
584799
def setOrientation( self, orientation ):
        
        super(XToolBar, self).setOrientation(orientation)
        self.refreshButton()
225999
private void installDefaults() {
        // Basic
        setFont(UIManager.getFont("InternalFrame.titleFont"));
        closeButtonToolTip   = UIManager.getString("InternalFrame.closeButtonToolTip");
        iconButtonToolTip    = UIManager.getString("InternalFrame.iconButtonToolTip");
        restoreButtonToolTip = UIManager.getString("InternalFrame.restoreButtonToolTip");
        maxButtonToolTip     = UIManager.getString("InternalFrame.maxButtonToolTip");

        // Synth
        updateStyle(this);
    }
168743
public void applyDefaults() {
		if (fillColor == null) {
			fillColor = "#ffffff"; // white
		}
		if (strokeColor == null) {
			strokeColor = "#000000"; // black
		}
		if (strokeOpacity == -1) {
			strokeOpacity = 1; // fully opaque by default
		}
		if (fillOpacity == -1) {
			fillOpacity = .5f; // 50% transparent by default
		}
		if (strokeWidth == -1) {
			strokeWidth = 1; // white
		}
		if (symbol == null) { // circle with radius 10 by default
			symbol = new SymbolInfo();
		}
		if (symbol.getCircle() == null && symbol.getRect() == null && symbol.getImage() == null) {
			symbol.setCircle(new CircleInfo());
			symbol.getCircle().setR(10);
		}
	}