Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
button wont work #280839
07/24/09 12:01
07/24/09 12:01
Joined: Jul 2009
Posts: 40
E
enrike Offline OP
Newbie
enrike  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 40
hi

I must be doing really stupid but i cannot make my button respond to a click. This is the code

////
function test(button_number,panel)
{
printf("on");
}


PANEL* pTest =
{
pos_x = 10; pos_y = 10;
size_x = 150; size_y = 300;

button(10, 10, "boton2.bmp", "boton1.bmp", NULL, test, NULL, NULL);

red = 128;
green = 128;
blue = 128;
flags = LIGHT | VISIBLE;
}
///

The button is there but it never calls the test() function, also it never changes to bmapOn. I tried setting panel and button possition to 0 but does not work. Also I defined the function like this but it did not help.
function test()
{
printf("on");
}

i cannot really see what i am doing wrong. thanks

enrike

Last edited by enrike; 07/24/09 12:02.
Re: button wont work [Re: enrike] #280844
07/24/09 12:18
07/24/09 12:18
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You starts in window-mode? At Fullscreen the message don`t show up. Try sys_exit instead fprint.

Re: button wont work [Re: Widi] #280846
07/24/09 12:21
07/24/09 12:21
Joined: Jul 2009
Posts: 40
E
enrike Offline OP
Newbie
enrike  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 40
no i am opening a window with no borders but not fullscreen. I have tried to open different type of windows and it never worked.I also tried to set a global variable from the function and it never change its value. I changed the bitmaps to pcx as well, and set mouse_mode to different values. I am using Vindows Vista with A7 version 7.02.4

Last edited by enrike; 07/24/09 12:24.
Re: button wont work [Re: enrike] #280849
07/24/09 12:26
07/24/09 12:26
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
UPDATE !!!!!

Re: button wont work [Re: Widi] #280850
07/24/09 12:27
07/24/09 12:27
Joined: Jul 2009
Posts: 40
E
enrike Offline OP
Newbie
enrike  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 40
common ... that cannot be the reason for this issue smile

Re: button wont work [Re: enrike] #280852
07/24/09 12:31
07/24/09 12:31
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Yes, that it is...

Re: button wont work [Re: Widi] #280853
07/24/09 12:32
07/24/09 12:32
Joined: Jul 2009
Posts: 40
E
enrike Offline OP
Newbie
enrike  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 40
really??? wow! thats a nasty bug then. I just tried with latest demo version and does the same. i mean it does not work either

Last edited by enrike; 07/24/09 12:34.
Re: button wont work [Re: enrike] #280856
07/24/09 12:38
07/24/09 12:38
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Try to set the layer to 1 or higher

Re: button wont work [Re: Widi] #280858
07/24/09 12:46
07/24/09 12:46
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
mouse_mode must be greater than zero (or something like that)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: button wont work [Re: EvilSOB] #281409
07/27/09 06:30
07/27/09 06:30
Joined: Jul 2009
Posts: 40
E
enrike Offline OP
Newbie
enrike  Offline OP
Newbie
E

Joined: Jul 2009
Posts: 40
just tried with layer=5 and mouse_mode = 1 and 3 and it does not work either. This is a simple version of my script. It does not work for me.

#include <acknex.h>
#include <default.c>

var watch ;

function test()
{
watch = 1234;
printf("on");
}



PANEL* pTest =
{
pos_x = 10; // CONTROL PANEL POSITION IN WINDOW
pos_y = 10;
size_x = 150;
size_y = 300;

layer = 2;

button(10, 10, "boton2.bmp", "boton1.bmp", NULL, test, NULL, NULL);

red = 128;
green = 128;
blue = 128;
flags = LIGHT | VISIBLE;
}



function main()
{
video_mode = 6;
while(1) wait(1);
}

Last edited by enrike; 07/27/09 06:36.
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1