MUI: set the font of an object
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    Hi,

    I would like to change the font of an object during runtime, but MUIA_Font is only useable at object creation.
    It only works if I close and reopen the window, after I set MUIA_Font to a TextFont structure returned by OpenDiskFont().

    But in the MUI Prefs its possible to change the font without closing and reopen, so my question is how can I do that too?
  • »08.01.17 - 18:44
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 2323 from 2003/2/24
    Font size is used to calculate the (min) size of the object and therefor the window so changing it on the fly might cause layout problem.

    Easy fixes:

    - Use gfx.library functions in MUIM_Draw to render text

    - Put the object into a group and only remove/add that object when needed (don't forget to call Init/ExitChange on the group)


    Without knowing further details it is impossible wether any of the above applies.
  • »08.01.17 - 19:19
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    I wanted to know how MUI Prefs does this, you can change the font there and all objects using this font will be changed immediately.
  • »08.01.17 - 19:45
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 2323 from 2003/2/24
    My guess s on something like my 2nd fix
  • »08.01.17 - 19:47
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    I do InitChange, then I set MUIA_Font, then ExitChange.
  • »08.01.17 - 19:53
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    Ok, now I do InitChange, OM_REMMEMBER my obj , set MUIA_Font, then OM_ADDMEMBER and then ExitChange.
    This way it works!
  • »08.01.17 - 20:28
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    r-tea
    Posts: 306 from 2005/3/27
    From: Poland, Zdzies...
    As for MUI and as in the subject, is there Lamp.mcc as AmigaE module available?
    Mac mini G4@1,5GHz silent upgrade + Xerox Phaser 3140 + EPSON Perfection 1240U
    Commodore C64C + 2 x 1541II + Datasette + SD-Box

    I miss draggable screens... and do you? I know I'm in a minority unfortunately.
  • »08.01.17 - 20:39
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    I can send it to you later, I think I have it.
    I have also done a new MUI module where the names are the same as in the C header and with many macros to easily create custom classes.
  • »09.01.17 - 09:22
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    @r-tea: Here is an archive of my AmigaE modules for some .mccs.
  • »09.01.17 - 10:58
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    r-tea
    Posts: 306 from 2005/3/27
    From: Poland, Zdzies...
    @igracki

    Thanks a lot! :-) Gonna make use of it soon.

    Edit:
    I use EC v 3.3a. It woun't read these modules.


    [ Edited by r-tea 10.01.2017 - 17:26 ]
    Mac mini G4@1,5GHz silent upgrade + Xerox Phaser 3140 + EPSON Perfection 1240U
    Commodore C64C + 2 x 1541II + Datasette + SD-Box

    I miss draggable screens... and do you? I know I'm in a minority unfortunately.
  • »10.01.17 - 16:08
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    igracki
    Posts: 416 from 2003/2/24
    From: Berlin
    I used ECX to compile the modules, but I included the source so you could compile with EC if necessary.
  • »10.01.17 - 16:48
    Profile Visit Website