14 August 2023, 22:55 | #1 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
gadget down locking window
Hi,
When a new window opens, it does not get activated immediately if the user is currently playing with gadgets. For example, if you press a button (or move a knob) but do not release it, the other window will open but remain inactive. Once you release the mouse button, the other window suddenly becomes active. So far so good, but it doesn't work when playing with window areas that are not gadgets. Is there a way to 'lock' the window without having to create a gadget on it ? |
18 August 2023, 18:57 | #2 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,307
|
This is a result of the rather particular intuition event system. Changing the input focus while a gadget is active is prevented from intuition - another one is if the menu is active, this will also prevent the input focus from changing.
I'm not sure whether this helps, but you could try intuition requesters. By that I do not mean the autorequesters, but the old "struct request". |
18 August 2023, 19:07 | #3 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Quote:
Quote:
I just want to have intuition 'think' a gadget is currently active. |
||
18 August 2023, 19:09 | #4 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,307
|
|
18 August 2023, 19:23 | #5 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Quote:
Because i have no idea what to try. What's an 'old' requester anyway. |
|
18 August 2023, 19:54 | #6 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,307
|
Code:
NAME Request -- Activate a requester. SYNOPSIS Success = Request( Requester, Window ) D0 A0 A1 BOOL Request( struct Requester *, struct Window * ); FUNCTION Links in and displays a requester into the specified window. This routine ignores the window's IDCMP_REQVERIFY flag. |
18 August 2023, 20:07 | #7 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
And so ? What am I supposed to do with that ? I don't want to display anything.
|
19 August 2023, 12:04 | #8 | |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,719
|
Quote:
Do you have a reason for not wanting to create a gadget on the window? |
|
19 August 2023, 12:18 | #9 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
|
19 August 2023, 12:52 | #10 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,349
|
You can create a gadget without Intuition doing any rendering?
From intuition.h: Code:
/* --- Gadget.Flags values --- */ ... #define GFLG_GADGHNONE 0x0003 /* don't highlight */ |
19 August 2023, 13:15 | #11 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Creating a giant, invisible gadget covering the whole window's surface is an idea.
I guess i will try that. I just hoped there was a quick, easy way to tell intuition to not remove focus from my window. |
19 August 2023, 14:38 | #12 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
|
19 August 2023, 20:51 | #13 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,307
|
I still fail to understand the use case. Why is this required?
|
19 August 2023, 21:04 | #14 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Quote:
I draw things on the window that are not gadgets, but do everything as if they were. Oh, i could perhaps have tried to do custom gadgets, but it ended up simpler this way. Owner-drawn gadgets with custom behaviour, for my UI library. Think about things such as real combo box without having to use third-party software, for example. |
|
19 August 2023, 23:51 | #15 | ||
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,307
|
Quote:
Quote:
Owner-drawn gadgets are called boopsis. That's pretty much what they are good for. You are using the wrong tool for what you want to achieve. |
||
20 August 2023, 07:51 | #16 | |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,719
|
Horrible name, can't be bothered finding out more. I bet they don't work in 1.x either.
I have been working with 1.x gadgets for compatibility and for the challenge (imagining I'm back in 1990...), but they have some annoying limitations and take a lot of fiddling to get the features I want. So I have been thinking of building my own from scratch. Quote:
So I looked up BOOPSI, and as expected my eyes were glazing over within seconds. "In general, BOOPSI objects are "black boxes". This means the inner workings of BOOPSI objects are not visible to the application programmer, so the programmer does not know what goes on inside it."Oh yay. Next we will see 'the code is the documentation'. |
|
20 August 2023, 12:24 | #17 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,307
|
Quote:
This principle is called "information hiding" and is quite valuble when writing complex programs. They reason why it is valuable is that such components are interchangable, regardless of what the actual implementation does, provided the interface is satisfied. You can plug in a boopsi of an Image class into whereever an IntuiImage would fit, *regardless* of what is within the "black box", and you can plug in a gadget class boopsi whenever a gadget fits, *regardless* of what is going on within the boopsi. This is also exactly the reason why boospis are recommended - you do not need to "code around" assumptions on the intution system that are not documented. Silently, it is here assumed that intuition blocks windows activation functions on gadgets, but there is no documentation on this, and this assumption may be even wrong with various patches, improvements or versions of intuition. If you depend on undocumented behavoir, it is quite likely that you creating a fragile program, a program that breaks in certain configurations. So, just: don't. |
|
21 August 2023, 08:37 | #18 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
I tried and they didn't behave properly.
Ordinary gadgets can use borders or images but never both. I also ended up with large structures consisting of many images. Gadtools does not provide bitmap buttons at all (among other things), its radio buttons can't be freely placed - and it does not mix well with non-gadtools stuff (if at all). Quote:
Complicated ? Yes, but it was boopsi that was complicated, not my own way. Quote:
I might be using the wrong tool, but the one you're suggesting is even worse. Will for example boopsi allow gadgets that overlap and do proper refresh of them in the right order ? They are not layered and can draw anywhere on the window, including the border. If you think boopsis are good and easy to use, then please provide me with some skeleton code of a custom gadget. I need to have a suitable place to draw the gadget, and another where it receives input events. |
||
21 August 2023, 12:34 | #19 | ||||||
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,307
|
Again, if you need an "ordinary button" with an "unordinary rendering", create a "struct Gadget" as you now it, make the gadget rendering an "IntuiImage", but instead of putting an old-style IntuiImage, use a boopsi of the image class there, then in its rendering call, do whatever rendering you seem necessary. I believe there was an example in RKRM libraries to give you a quick start, but it's really not complicated.
Quote:
The radio buttons cannot be placed freely, but they do not need to. You can add spacing between them, and you can scale them (or even let them scale with the font size from v47 onwards). But gadtools is something entirely different than boopsis. Quote:
Quote:
Quote:
What you render, and how you render in a boopsi is up to you. Thus, if you really realy want something overlapping, you can always clip rendering through a mask, or simply do not render into parts that overlap. But, again, RKRM user interface style guide. Quote:
Quote:
(Yes, they do have internet in planes nowadays...) |
||||||
21 August 2023, 12:44 | #20 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,307
|
After only 5 minutes browsing, here is an example:
https://amigadev.elowar.com/read/ADC.../node0580.html This is not the "simplest possible", but maybe a starter. Again, if you just need custom rendering (but nothing very specific as a gadget), I would start to derive from the image class, but that's all up to your likings. The good part about boopsis is that they have many more rendering options than regular gadgets, i.e. it is not only "pressed" or "releaesed", but also also "inactive", "activated" etc. as states such that you can customize the pens. The ViNCEd "iconification" gadget is under 3.1 a boopsi as this version still lacked a system iconification sysiclass image. It uses sysiclass from 3.2 onwards to allow customization of the "look and feel", which I consider "a good thing" (leave the style to the user, do not enforce your own style upon the user). That's one of the advantages if you use system provided classes. But, again, not accessible right now, sorry. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to remove/hide any gadget from window (gadtools) | peceha | Coders. System | 9 | 18 September 2019 08:45 |
How to add an Iconify-Gadget to a Window? | AGS | Coders. System | 5 | 15 January 2014 15:41 |
I am locking for a game | MuffinMan | Looking for a game name ? | 3 | 29 August 2010 03:12 |
Sinbad WHD locking up | Kurtz | project.Killergorilla's WHD packs | 15 | 23 March 2009 12:33 |
Gadget/Layout.gadget V44 | ruliovega | support.Apps | 6 | 02 January 2006 11:50 |
|
|