Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
110 user(s) are online (99 user(s) are browsing Forums)

Members: 0
Guests: 110

more...

Support us!

Headlines

 
  Register To Post  

Dynamic gadget CheckBox
Home away from home
Home away from home


See User information
I need help,i need to have a dynamically checkbox. I need several,someitmes 1,other times maybe 200. Anyone's got an idea how to do this?

The code i use for the checkbox.

LAYOUT_AddChild, gadgets[GID_CHECKBOX1] = (Object *)CheckBoxObject,
GA_ID, GID_CHECKBOX1,
GA_RelVerify, TRUE,
GA_Text, tempis,
CHECKBOX_TextPlace, PLACETEXT_RIGHT,
CheckBoxEnd,

X5000
Go to top
Re: Dynamic gadget CheckBox
Not too shy to talk
Not too shy to talk


See User information
@Antique

Maybe you should use a listbrowser for that, every entry in a listbrowser can have a checkbox befor it. Sys:Utilities/UnArc uses that for example.

Go to top
Re: Dynamic gadget CheckBox
Home away from home
Home away from home


See User information
@ZeroG

Nice idea btw.

Will look into that instead.

X5000
Go to top
Re: Dynamic gadget CheckBox
Amigans Defender
Amigans Defender


See User information
@Antique

If you need a changing number of checkboxes in your layout, you'd be better off using a listbrowser with checkable nodes. Adding and removing listbrowser nodes is much easier, faster and safer than performing in-place changes to a layout.

Another advantage is that your layout will keep a certain size and shape, regardless of whether you have three or 100 checkboxes.

Go to top
Re: Dynamic gadget CheckBox
Just popping in
Just popping in


See User information
@Antique

You can use LAYOUT_AddChild to dynamically add gadgets to a window however you run the risk of hanging the OS

In OS 4.1 a method LM_ADDCHILD was introduced which will attempt to add the child gadget.

As to why this new method was introduced rather than fix LAYOUT_AddChild is beyond me

Go to top
Re: Dynamic gadget CheckBox
Amigans Defender
Amigans Defender


See User information
@madmonkey

The reason might be a design flaw, don't know. But the introduction of a method is logical because in OOP, actions upon objects should be done through methods, not through attributes.

Go to top
Re: Dynamic gadget CheckBox
Just popping in
Just popping in


See User information
@trixie

I agree that logically it should be a method not an attribute. Just doesnt make any sense to me to introduce a new way of doing things rather than fix the existing way.

NB Setting attributes on an object calls the method OM_SET so everything is a method anyway.

Go to top
Re: Dynamic gadget CheckBox
Home away from home
Home away from home


See User information
@ZeroG

Thanks for the tip. Much easier than i thought when using listbrowser.

X5000
Go to top
Re: Dynamic gadget CheckBox
Not too shy to talk
Not too shy to talk


See User information
@Antique


Go to top
Re: Dynamic gadget CheckBox
Amigans Defender
Amigans Defender


See User information
@madmonkey
Quote:
As to why this new method was introduced rather than fix LAYOUT_AddChild is beyond me

Because it was the only way to remain backwards compatible. Plus it always should have been a method to synchronize with intuition, etc. properly.

ExecSG Team Lead
Go to top
Re: Dynamic gadget CheckBox
Just popping in
Just popping in


See User information
@ssolie

Quote:

ssolie wrote:
Because it was the only way to remain backwards compatible


Funniest thing I've heard in a long time. So if there's a bug that hangs the OS, it won't get fixed because then it wouldn't be backwards compatible! I'm sure all the major software houses follow the same development methods. Lol

I can appreciate it might take time and effort but remaining backwards compatible to keep the undocumented OS lockup is plain silly.

Go to top
Re: Dynamic gadget CheckBox
Amigans Defender
Amigans Defender


See User information
@madmonkey
Quote:
...remaining backwards compatible to keep the undocumented OS lockup is plain silly.

The situation is clearly documented in the layout.doc autodoc.

There are a lot more such situations in the OS. Perhaps you would like to point them all out and laugh some more?

ExecSG Team Lead
Go to top
Re: Dynamic gadget CheckBox
Home away from home
Home away from home


See User information
@madmonkey

What a constructive comment. And bugs will be fixed.

X5000
Go to top
Re: Dynamic gadget CheckBox
Just popping in
Just popping in


See User information
@ssolie

As I pointed out in my original post the lockup and new method are documented in the latest SDK.

However in previous SDKs there is no mention of the lockup or new method so forgive me for using LAYOUT_AddChild when there was no other way to create dynamic GUIs.

I just wish it had been documented previously as it caused me quite a few headaches.

I apologise if my comment caused offense. It just made me smile that backwards compatibility is the reason for not fixing the original mechanism.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project