Welcome, Guest. Please login or register.

Author Topic: MUI for dummies  (Read 5958 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: MUI for dummies
« Reply #14 from previous page: 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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #15 on: August 24, 2003, 07:04:15 PM »
@itix

Yes, I know that  :-P

But all that wouldn't be a real prob for my aim.

a) The object will never be in a virtual group as it supposed to show the actual stuff
the user is working with it. And I don't plan to add any virtual groups to the main win.

b) I would only need that "direct" draw when reacting an mo9usemove or
mousebutton events over said object. Won't happen when it is iconified.

c) I won't use register-groups either (in the main win).

The prob is like that :

On every mouseevent the figure is drawn using COMPLEMENT mode.

When it is finished it is drawn with JAM1.

Whenever a refresh is needed a full redraw of all figures is been done (that would be
o.k. with MUIM_Draw), but I don't see how I could do that for the construction phase,
without hitting a severe performance-penalty and/or much more work for me.

So what side effects do I have to fear when I bend/break the rules on this one ? :-o
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: MUI for dummies
« Reply #16 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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #17 on: August 24, 2003, 08:15:48 PM »
/me beats Stunzi with a stick  :-o

I'll see what I can do on that next week or so when I start on actually connecting
the prog to the GUI.
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline DethKnight

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 509
    • Show only replies by DethKnight
Re: MUI for dummies
« Reply #18 on: August 24, 2003, 09:51:47 PM »
Quote
what areas need more clarity, and what not.

 
for me, all of it, the config for 3.8 has way too much "info/config/options" at once.
this is why is haven't adjusted ANY setting in it since the day I bought the key.

I'm sure I could figure it out, but I've time to waste elsewhere
wanted; NONfunctional A3K keyboard wanted
 

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #19 on: August 28, 2003, 07:11:05 PM »
Round 2 is opened ......


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);


But when I try to draw something into the RPort of that window, I get massive
slowdowns and crashes. Drawing after assigning rp tp _rp(obj) does work, but this
ain't a option, sice I want to call a function which expects Window*, and doesn't
know nothing about MUI.
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline lempkee

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 2860
    • Show only replies by lempkee
    • http://www.amigaguru.com
Re: MUI for dummies
« Reply #20 on: August 28, 2003, 08:17:37 PM »
i post this in favor for a friend.

he told me to say this:

 reply to read the bottom of libraries/mui.h
 
and that i should mention _window( Object* )





reading the dev docs is a pain i know so much :)

cheers
Whats up with all the hate!
 

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show only replies by Kronos
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #21 on: August 28, 2003, 08:34:41 PM »
Quote

and that i should mention _window( Object* )


Ah..... that helped.

Quote
reading the dev docs is a pain i know so much :)


Well I did read the docs, and that was where the trouble started ....  :-o
1. Make an announcment.
2. Wait a while.
3. Check if it can actually be done.
4. Wait for someone else to do it.
5. Start working on it while giving out hillarious progress-reports.
6. Deny that you have ever announced it
7. Blame someone else
 

Offline blubbe

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 268
    • Show only replies by blubbe
    • http://somewhere.in-hell.com
Re: MUI for dummies
« Reply #22 on: August 30, 2003, 04:34:23 AM »
I found this was an old question threw some googleing.. The solution was said to be use
MUIA_FixWidth, MUIA_FixHeight (Because
ImageObject has some boopsi limitations
(compared to MUI) and has to be told the size of the image at creation time.
But.. still no luck, still getting an empty gadget.
i      i     i    i   i  i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i  i   i    i     i     i      i
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: MUI for dummies
« Reply #23 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