gnope php gtk gui gnope.org  

GtkHScale as an Active Control

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
rgljr



Joined: 10 Apr 2006
Posts: 15
Location: Minnesota, USA

PostPosted: Thu May 03, 2007 5:16 am    Post subject: GtkHScale as an Active Control Reply with quote

I'm trying to use GtkHScale in an application to control a network device.

Think of it as a Volume Control.

I can't seem to find an example of what I want to do.

Is there a Callback function for when a GtkHScale has stopped moving or is being moved.

I know how to get a value from the control if the user clicks a regular button to indicate that GtkHScale is set to the desired value, but I would like to make it an active control Similar to a Volume control would be actively controling the volume of an amplifier.

I know I could do this with a timer function but I thought there might be a callback to indicate that the control is moving or has been moved and I can't seem to find it or a clue to it in the PHP-GTK2 Documentation.

An example would be great!

Thanks in advance for any help.
Back to top
kksou



Joined: 06 Sep 2006
Posts: 25

PostPosted: Thu May 03, 2007 10:21 am    Post subject: Reply with quote

Have wrote two sample codes here:

http://www.kksou.com/php-gtk2/articles/set-up-volume-control---Part-1---using-GtkVScale.php

http://www.kksou.com/php-gtk2/articles/set-up-volume-control---Part-2---using-GtkHScale.php

Hope it's what you have in mind.

Regards,
/kksou

p.s. I thought these are simple widgets. Turns out that there are quite a number of tweaks here and there (in GtkScale, GtkRange and GtkAdjustment) that allow one to do very precise control. For example, what if you would like to add some spacing between the scale and the value? Or if you would like to change the font of the value? I will try to come out with a couple more examples in part 3 and 4.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.