help me on GUI question, please!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
digo_rp
Member
Member
Posts: 233
Joined: Sun Jun 05, 2005 11:00 pm

help me on GUI question, please!

Post by digo_rp »

guis I would like to understand how to do it...

I´m trying to create a gui interface to my o.s. digo´s.

I got ps2mouse working very simple

how do I can click on button " test" for example ?

right now I got a loop
exit=false;
while (!exit) do {
if mouse.button(1) and mouse.x >... and mouse.x < ...
{
mouse_hide();
button(x,y,x2,y2, press);
delay_ms(20);
button(x,y,x2,y2, not_press);
mouse_show();
}
}

with this simple example, when you click on that button test the mouse disapper "hide " and then it shows. I saw in so many example on internet
that when user click on button, the mouse doesn´t hide. looks like windows / linux.... how do I to that ? could anyone give some help ?
please
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Generally, the mouse only needs to be hidden during drawing operations. Hiding it during wait states indeed cause it to disappear from the screen

A better sequence would be:

Code: Select all

mouse_hide();
button_down();
mouse_show();
delay();       // maybe wait until the button is released?
mouse_hide();
button_up();
mouse_show();
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply