I have a window with a lot of gui stuff going on, among other things a clicktab object with two tabs. Now, when a certain event happens, I want to be able to switch to tab number two, and I am trying to do it with this code:
IIntuition->SetAttrs(ClickTabObj, CLICKTAB_Current, (uint16)1, TAG_DONE);
...which is obviously wrong, because it either locks up the program or does some weird stuff showing the tab at (0,0) offset in the window. So what am I supposed to do?
Try with
Still doesn't work. Just hangs up the program and I have to reboot... :-/
@ alfkil
I assume you have a page object attached to the clicktab via CLICKTAB_PageGroup?
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
That's strange.. i use it without any problem..
"yourWindow" must be a pointer to struct Window, not the window object.
@trixie
Yes, I have a PageGroup attached to it. Do I need to detach that or smth??
@thomas
Yes, I am using the struct Window pointer, not the Object.
I think the problem is elsewhere. Do you have a stacktrace?
@afxgroup
No, but I can list the code that generates the clicktab object:
It's hard to understand where could be the problem without any stack trace.. you should buy a cheap null modem cable to print the output.. or try to get it with DumpDebugBuffer
I already have a serial connection on my skod-pc, but I don't get a trace. Instead, the tab is shown at window coords (0, 0) on top of my window bare and everything else... I think there must be something wrong with the way I am configuring my objects. Strange though, that everything works perfectly normal when I just select the tabs with the mouse...
I have tried with a small modification of one of the sdk reaction examples, and here it also doesn't work. If I don't refresh the gadgets, then page two is NOT shown, but becomes temporarily unavailable until I press page 3. If I DO refresh, page 2 is shown at window coords (0, 0), Does anyonw have a (small) example where it actually works??
@alfkil
Which clicktab is it that you're trying to change with IIntuition->SetGadgetAttrs()? If it's the OBJ_CLICKTAB_2 one that's on a page you need to use ILayout->SetPageGadgetAttrs() instead (see page_gc.doc autodoc for details).
@salass00
No, I am trying to set the OBJ_CLICKTAB_1, it is the child of a VLayoutObject.
Does nobody have a working example of how to change the current clicktab without graphics corruption??
@alfkil
I've used clicktab in some of my programs but as far as I remember I haven't had any cause to write code to change which tab is the current one while the window is open yet.
I just tried this:
and it works, at least on OS 3.9.
@thomas
THANK you, phew that was a relief :).