Home   Archive   Permalink



RebGUI - Buttons lose color after mouseover?

Hello, I notice that buttons go back to the default green color once moused over. Same behavior in the RebGUI demo. I tried testing an on-away action for the button, but that does nothing:
    
display {test} [button "Test" red on-click [print "hello"] on-away [print "goodbye"]]
    
Is there an action handler for a button that could be used to reset the button color back to red after mouseover? Using set-color ??
    
Thank you!
    


posted by:   JackKort     22-Feb-2018/15:51:21-8:00



display {test} [b: button red "Test" on-click [wait .1 set-color face red]] do-events
    
That color is in this draw block:
    
display {test} [b: button "Test" red on-click [help b/effect/draw/14] button [help b/effect/draw/14]] do-events

posted by:   Nick     22-Feb-2018/22:23:11-8:00



BTW, it may be worth looking at the 'request-ui function. It creates a ui.dat file like this:
    
make object! [
     page: 255.255.240
     text: 64.64.64
     theme-light: 114.159.207
     theme-dark: 32.74.135
     state-light: 114.159.207
     state-dark: 32.74.135
     outline-light: 204.204.204
     outline-dark: 136.136.136
] make object! [
     cell: 4
     edge: 1
     font: 12
     font-height: 14
     gap: 2
     line: 20
     margin: 4
     slider: 16
] make object! [
     action-on-enter: [drop-list edit-list field password spinner
     ]
     action-on-tab: [field
     ]
     caret-on-focus: [area
     ]
     cyclic: [group-box panel sheet tab-panel
     ]
     hilight-on-focus: [edit-list field password spinner
     ]
     tabbed: [area button drop-list drop-tree edit-list field grid password spinner
     ]
] make object! [
     arrows-together: false
     radius: 5
     font: "verdana"
     fonts: ["arial" "courier new" "times" "verdana"
     ]
     splash-delay: 1
     tooltip-delay: 0:00:01
     webdings: true
     window: none
]

posted by:   Nick     22-Feb-2018/22:34:05-8:00



Thanks again Nick! Your on-click color reset would be good, but my red buttons are all window closers; was hoping to keep them red if user just passed cursor over them. Not a big deal.
I'll have to digest what the 'request-ui is all about. Frustrating to me that I keep coming back to REBOL, but never get to devote the time I need to get better at it.
I appreciate all your help, but hate to be a constant bother to you, since no one else chimes in here on my newbie questions. Is there another forum (AltME?) you'd rather direct me to for these types of questions? I like your forum's usability and I'm getting great help!
    
Take Care!

posted by:   JackKort     23-Feb-2018/11:29:11-8:00