> Pedro Rodriguez <[EMAIL PROTECTED]> writes:
>
> On Friday 18 January 2002 20:33, Steve McClure wrote:
> > This isn't necessarily Python related but:
> >
> > I wan't to use a GtkSpinButton to display the port of a service but I
> > want to display the text for know services.  e.g. if 79 is displayed
> > and they increment, display 'http' instead of 80.  Does anyone know
> > if this is possible?  
> 
> Not easily. I think this will mean twisting the widget (at least for
> gtk 1.2.x). You will need to intercept the value change event and then
> try to put your own value without triggering/or ignoring the new
> value change :( ...
> 
> > ...There is an attribute to allow non-numeric
> > input but when i call get_text(), I get back the minimum value. 
> > There must be some non-obvious (to me) use for this attribute?
> 
> get_text works fine for me. Don't forget that GtkSpinButton is
> a subclass of GtkEntry, from which you can use methods/callbacks.
> 
> 
> But I don't know what should your widget look like :
>   - more than 30000 possibles values 
>   - several protocols (tcp, udp).
> I would have thought using a combo if you only want to peek valid
> values, or have a quick of what exists, but there are more than 400 
> available for the tcp protocol.
> 
> Skip idea to define a new widget is a good idea (target gtk 1.99 ;).
> But I think you will need to tailor it for your needs : should the
> user be allowed to type text, what about aliases, should he be able
> to have a look at the known protocols ?
> 
> You may try the following code to get an idea.
> Hoping this help...

[ code deleted for brevity ]

Thanks for the replies and good ideas.  I liked Skip's idea about the 
scale widget, but Pedro is probably correct in his concerns of what it 
should really look like.  The SpinButton was an easy way to ensure the 
user entered an integer but now I think I'm going to change things a 
bit.  Let the user enter the number or the symbolic name and perhaps a 
list of some kind.  Tying the protocol in doesn't help much since 
almost every service (at least those listed in /etc/services) are 
registered for both protocols.

Anyway, thanks for the input.
-- 
Steve McClure                   430 10th St NW
Racemi                          Suite N-210
http://www.racemi.com           Atlanta, GA 30318
[EMAIL PROTECTED]             voice/fax: 404-892-5850


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to