Selected text color in HAL_SpinButton

More
18 Sep 2020 10:07 #182626 by aekhv
Hi everyone,

Is it possible to change the color of selected text in HAL_SpinButton? By default it's light-light-gray, and it's really hard to see is anything selected or not. I didn't find any color's options in the Glade editor.

Attachments:

Please Log in or Create an account to join the conversation.

More
20 Sep 2020 10:34 #182865 by aekhv
Finally solved! :woohoo:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import gtk
import linuxcnc

    def __init__(self, halcomp, builder, useropts):
        self.builder = builder
        spinbtn = self.builder.get_object('spinbutton1')

        # Border
        spinbtn.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("black"))
        spinbtn.modify_bg(gtk.STATE_INSENSITIVE, gtk.gdk.color_parse("black"))

        # Up/down arrows
        spinbtn.modify_fg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#00ff00"))
        spinbtn.modify_fg(gtk.STATE_INSENSITIVE, gtk.gdk.color_parse("red"))

        # Selected text background
        spinbtn.modify_base(gtk.STATE_ACTIVE, gtk.gdk.color_parse("blue"))

        # Selected text
        spinbtn.modify_text(gtk.STATE_ACTIVE, gtk.gdk.color_parse("white"))

def get_handlers(halcomp, builder, useropts):
    return [HandlerClass(halcomp, builder, useropts)]



Attachments:
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
21 Sep 2020 00:05 #182992 by cmorley
You should be able to do this by using a modified theme too.
Some where on the forum was some question about themes for gscreen.
The solutions should be similar for gmoccapy

Please Log in or Create an account to join the conversation.

Moderators: mhaberler
Time to create page: 0.162 seconds
Powered by Kunena Forum