Welcome, Guest. Please login or register.

Author Topic: MUI for dummies  (Read 5979 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: MUI for dummies
« on: August 24, 2003, 12:13:48 PM »
Use tag MUIA_FixWidthTxt. For example

str = StringObject, MUIA_FixWidthTxt, "0000000", End;

Note 7 characters there: one is for cursor. And use characters which are wide by nature (read MUI_Area.doc and you understand why).
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: MUI for dummies
« Reply #1 on: August 24, 2003, 06:51:54 PM »
Quote

Is there a save way to do draw into a window/MUI-object outside a Draw-event
(that just wouldn't be good for my proggy) ?


You can draw only inside MUIM_Draw because:

 - your object may belong to virtual group and needs clipping (MUI installs this automatically for MUIM_Draw)

 - your application can be hidden (in the iconified state) at anytime and thus _rp(obj) is not always valid.

 - your object could be hidden for some reason (page and register groups)
My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: MUI for dummies
« Reply #2 on: August 24, 2003, 08:11:43 PM »
I think you just want draw new parts of your objects without full redraw? Then you could do something like this:

 data->DrawCommand = MY_OWN_DRAW_COMMAND;
 MUI_Redraw(obj, MADF_DRAWUPDATE);

And then in your MUIM_Draw method:

MyDraw()
{
  DoSuperMethod();

  if (msg->flags & MADF_DRAWUPDATE)
  {
     switch (data->DrawCommand)
     {
        /* UPDATE PARTS YOU WANT TO */
     }
  }
  else
  {
     /* FULL REDRAW */
  }
}

(I hope I got your problem right.. :-) )

As far as I know there arent problems for direct draw if it is really limited and you know what you are doing. But you never know what Stuntzi does for the next MUI release. Your code could fail in the future.

My Amigas: A500, Mac Mini and PowerBook
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: MUI for dummies
« Reply #3 on: August 30, 2003, 11:36:58 AM »
Quote

How the h'** do I get the actual Window from my MUI-object ???

thought it should have been this:
struct Window *win;
DoMethod(obj,MUIA_Window,&win);


MUIA_Window is an attribute. You can read attributes by calling GetAttr() from Intuition:

GetAttr(MUIA_Window, obj, &x);

And few warnings:

 - MUIA_Window is only valid when the window is opened
 - MUIA_Window is an area class tag. Use MUIA_Window_Window for window objects.
My Amigas: A500, Mac Mini and PowerBook