MUIA_Group_LayoutHook does not work
  • Cocoon
    Cocoon
    ciVic
    Posts: 45 from 2013/6/2
    Hi all,

    I'm trying to layout some buttons on a map (for the next twittAmiga). I can set this attribute so that my hook is called, but the data transfered via registers seems to be corrupt. Here is the hook definition:


    HOOKPROTO(LayoutFunc, ULONG, Object *obj, struct MUI_LayoutMsg *lm)
    {
    ...
    }

    I use the sdi_hook.c. This works for example with the HTMLView class, but here lm does not contain meaningfull data. E.g. lm->lm_Type should be the type of the call (0 or 1), but is something >2000 and couting up. I have it from the Layout example from MUI 3.8, but I miss this example on MorphOS. Can somebody help me?
  • »08.08.13 - 18:38
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Quote:

    ciVic wrote:
    Hi all,

    I'm trying to layout some buttons on a map (for the next twittAmiga). I can set this attribute so that my hook is called, but the data transfered via registers seems to be corrupt. Here is the hook definition:


    HOOKPROTO(LayoutFunc, ULONG, Object *obj, struct MUI_LayoutMsg *lm)
    {
    ...
    }

    I use the sdi_hook.c. This works for example with the HTMLView class, but here lm does not contain meaningfull data. E.g. lm->lm_Type should be the type of the call (0 or 1), but is something >2000 and couting up. I have it from the Layout example from MUI 3.8, but I miss this example on MorphOS. Can somebody help me?




    I dont know. Maybe sdi_hook.c is buggy because layout hook certainly works correctly. You can find examples from Ambient code.
    1 + 1 = 3 with very large values of 1
  • »09.08.13 - 04:09
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3200 from 2003/3/5
    From: Canada
    Quote:

    ciVic wrote:
    HOOKPROTO(LayoutFunc, ULONG, Object *obj, struct MUI_LayoutMsg *lm)



    Best use the macros from Ambient - these will at least work. The layout functionality works for sure since many MorphOS apps rely on it.
  • »09.08.13 - 05:00
    Profile Visit Website
  • MorphOS Developer
    geit
    Posts: 1055 from 2004/9/23
    The SDI headers work fine for sure. I use them all the time for cross over projects. I guess they were just wrongly used or simply are outdated.

    AFAIR you need to use HOOKPROTONH() as you did not specifiy the hook.

    The latest files from SourceForge YAM account should work, if not (no clue) contact me by mail and I send them to you.

    Geit

    [ Edited by geit 09.08.2013 - 12:07 ]
  • »09.08.13 - 07:58
    Profile
  • Cocoon
    Cocoon
    ciVic
    Posts: 45 from 2013/6/2
    Thank you all very much. Indeed, the sdi header was too old, now it works. I must say, very competent forum here.
  • »10.08.13 - 20:32
    Profile