Home » ZPAD 4.0 » The Operating System » Functions » CreateRadioButton

CreateRadioButton

parameters:
      [short x, short y, char *title, const unsigned long *host, const unsigned long *hwnd]

return data type:
      unsigned long.

description:

Creates a radio button.

how to use:

The use of Radio Buttons, its better to have a group of them.
To create a group, Create the First RadioButton and take a note of its returned ID, note that the first RadioButton’s *host is set to NULL (or 0UL)
Create another button and set the *host of the First Radio Button.
No need keep a variable for the subsequent radio buttons.
*CAUTION* Freeing any of the RadioButtons, will result in ALL radio buttons being free’d from memory.

example:

// the hostwindowid is just the hosting window
 TESTRADIO1 = CreateRadioButton(160, 80, "Radio #1", 0UL, &hostwindowid ); // this is the host one

 CreateRadioButton(160, 100, "Radio #2", &TESTRADIO1, &hostwindowid ); // this is the second radio button

 CreateRadioButton(160, 120, "Radio #3", &TESTRADIO1, &hostwindowid ); // this is the third radio button

No flags required


x – starting location on the X

y – starting location on the Y

title* – a pointer to a const or a string which should be terminated with a NULL, eg “hello world\0”

host* – the ID of the first radio button in this group

hwnd* – the hosting window ID.

 

Catagories

ChatClick here to chat!+
Back