Welcome, Guest. Please login or register.

Author Topic: MUI for dummies  (Read 5985 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
MUI for dummies
« on: August 24, 2003, 11:14:47 AM »
I just started learning how to code for MUI, but ran into some probs about gadget-layout.

While I managed to fiddle most of it to look allmost like I wanted, it is the string-gadgets
that still give me a severe headache.

There 2 of them in a HGroup together with an selfmade BOOPSI-gagdets
(and no that ain't the prob here) which will be used to display the current cursor-pos
(this can be float-numbers so an integer-gadget wouldn't do).

The problem is that I can't get them to stay the right size. They are either spread all
over the window, or cramped into o9ne edge, when all I want them to do is to stay
on the right and just as big to display 6 chars (as long as possible).

MUIA_String_Maxlen seems to have no effect, and just forcing one width doesn't
seem right as you never know wether the user may prefer to use a font 50 pixels wide  ;-)

Any suggestions ?

Oh and expect this thread to go on as I only got the GUI showing up, but have yet to
find out how to connect that to the rest of the program  :-o  :-D
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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #1 on: August 24, 2003, 11:34:43 AM »
The code ? You want to see the code ? Believe me you can't handle the code ...... ;-)

The spaces aren't the prob here, but how to get the gadget to be just wide enough
to hold 6 chars of the given font. I would't mind a few extra pixels to cater for non-
proportinal fonts or so.


Filling in some HSpaces doesn't really help, as the gadgets still rezize like wild when
the window is resized.
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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #2 on: August 24, 2003, 11:58:04 AM »
"weight" doesn't help either as it will only result in the string-gadgets exploding on a big window,
or being cramped on smaller one.

Seems that I will have to force one size with MUIA_Width and MUIA_MaxWidth
based on the current font and change it whenever the font is changed ....
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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #3 on: August 24, 2003, 12:21:15 PM »
Thanks, thats it .....

be prepared for round 2 to follow  :-P
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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #4 on: August 24, 2003, 05:23:54 PM »
@Downix

Sounds nice, and here are some things I'm still stumbling on about:

How does the whole  notifying work, and how do I make my prog react on normal
events (other than gadgets).

How does one avoid getting an unresponsive GUI while the prog does something else.

How do I convert a normal Amiga-app with an event-loop into something MUI ?

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) ? And how does one create such a
object for personal use ?

I allready did a quick scan over the doku, and found hints for most of the probs, but help
on those is still much welcomed.


@Gadget
Prize ? Didn't you read ? I get the prize !!!  :-D
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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #5 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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #6 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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #7 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 KronosTopic starter

  • Resident blue troll
  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 4017
    • Show all replies
    • http://www.SteamDraw.de
Re: MUI for dummies
« Reply #8 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