"Linking" two adjustment widgets?



Hi there,

suppose I have a GtkHScrollbar and a GtkEntry both of which control the same numerical quantity. Whenever the user changes the position of the slider I want this change to be reflected in the GtkEntry and vice versa.

Obviously it won't do to connect the "changed" signals of each widget to callbacks that change the setting of the other widget because the other one in turn would emit a "changed" signal as well, creating an infinite loop.

Actually I find it strange that this isn't even in the FAQ, considering that many applications have such functionality.

In my case there may or may not be added complications because the entry setting and the slider setting don't have 1:1 correspondence but an exponential / loigarithmic one.

Thanks, --Daniel




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]