Re: [gtk-list] Widget questions
- From: "Emmanuel DELOGET" <pixel epita fr>
- To: <gtk-list redhat com>
- Subject: Re: [gtk-list] Widget questions
- Date: Wed, 7 Jul 1999 13:24:39 +0200
> I discovered gtk+ just last week and have decided that it is just what
I'm
>looking for. I've started reading the included docs and read completely the
>New Rider book (much easier to carry on a trip).
Hope you like it :)
>
> Despite my readings I cannot find the answer to two questions:
>
>1) Is there a list of all the widgets provided with the gtk+ distribution?
The GTK+ FAQ provide a list of widgets (with the hierarchy).
You shoud habe a look at it.
>2) Is there a data entry validator (called in other development
environments
>a mask or a pattern)? For example, if a data entry field if for a telephone
>number the mask (in Paradox/DOS where my business applications were
created)
>would be [(###)] ###-####. This means that the field accepts only digits
and
>if the opening parenthesis is entered by the user, then the closing
>parenthesis will automatically be placed after the area code. Also, the
>space and hyphen will be added to the text-entry widget field (but not the
>field in the database software). Another example, for a US state code the
>mask could be && which is interpreted as two (and only two) uppercase
>letters.
>
>I expect that someone has already written such a tool, but I've not found
>it. BTW, I've tried searching the archives but without success.
I don't think that such a widget exist (but I may be wrong).
Adding a validator should not be so difficult (it could be
a glib object).
The basic algorithme may be :
[connect a function to the "changed" signal]
check if the beginning of the entry text is correct
If not, send a new signal (something like "validator-error" perhaps).
If it is, continue.
You should have a look to the sample chapters of the free 'GTK+/Gnome
Application Development' book by Havoc Pennington. Two sample chapters
are available at http://www106.pair.com/rhp/sample_chapters.html.
Section 9.6.1 deals with adding new signals to a widget (the v-error).
There are some informations about the GTK+ architecture that could be
useful if you implement such a widget.
Yours,
pixel@epīta.fr
>
>TIA,
>
>Rich
>
>Dr. Richard B. Shepard, President
>Applied Ecosystem Services, Inc.
>2404 SW 22nd Street
>Troutdale, OR 97060-1247 U.S.A.
>+ 1 503-667-4517 (voice) | + 1 503-667-8863 (fax)
>rshepard@appl-ecosys.com
> Making environmentally-responsible mining happen.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]