• Acolyte of the Butterfly
    Acolyte of the Butterfly
    Leif
    Posts: 111 from 2006/5/31
    From: Sweden
    Quote:

    r-tea wrote:
    How to notify Coloradjust Object properly to get proper response?
    I have tried all available InputMode values already: RelVerify, Toggle, Immediate.
    I set notification on Pressed attribute like this"

    Code:
    domethod(ca,[MUIM_Notify, MUIA_Pressed, MUI_TRUE, MUIV_Notify_Self,2,MUIM_CallHook,get_colHook])


    The procedure installed as a hook looks like this:

    Code:

    DEF get_colHook:hook

    PROC get_col()
    get(ca,MUIA_Coloradjust_RGB,[col])
    StringF(rgb,'zh[8]',col)
    set(str_hex, MUIA_String_Contents, rgb)
    set(str_dec, MUIA_String_Contents, rgb)
    WriteF(rgb, 'dn')
    ENDPROC


    And inside the main() procedure:

    .Code:
     installhook(get_colHook, {get_col})


    To simplify things I made all variables global. And everything would be ok for me except the Coloradjust gadget response only when one clicks outside the triangle and outside the thick circle. When I click inside the triangle or onto the thick color ring the notification seems to not work.



    Code:
    get(ca,MUIA_Coloradjust_RGB,[col])


    should be

    Code:
    get(ca,MUIA_Coloradjust_RGB,{col})


    doh

    /Leif


    [ Edited by Leif 15.01.2017 - 13:49 ]
  • »15.01.17 - 11:28
    Profile