Re: gtk-list digest, Vol 1 #1385 - 9 msgs



 

 gtk-list-request gnome org wrote:

Send gtk-list mailing list submissions to
gtk-list gnome org

To subscribe or unsubscribe via the World Wide Web, visit
http://mail.gnome.org/mailman/listinfo/gtk-list
or, via email, send a message with subject or body 'help' to
gtk-list-request gnome org

You can reach the person managing the list at
gtk-list-admin gnome org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of gtk-list digest..."


Today's Topics:

1. need entry widget to dynamically resize to fit contents (george young)
2. Buglet in gtk-1.2.10 (torsten)
3. Re: need entry widget to dynamically resize to fit contents (Paul Davis)
4. Re: need entry widget to dynamically resize to fit contents (Valdis Kletnieks vt edu)
5. Re: need entry widget to dynamically resize to fit contents (george young)
6. GTK+ with framebuffer gui not repainting. (Binoj VB)
7. Pango problem (Bernd Demian)
8. Cygwin Gtk without XServer? (Victor Hugo Dorantes Gonzalez)
9. Re: WIN32 build of a GTK2 app (Victor Hugo Dorantes Gonzalez)

--__--__--

Message: 1
Date: Thu, 6 Feb 2003 13:15:32 -0500
From: george young
To: gtk-list gnome org
Subject: need entry widget to dynamically resize to fit contents
Reply-To: gry ll mit edu
Organization: MIT Lincoln Laboratory

[gtk-2.2.0, pango-1.2.0, pygtk-1.99.14, python-2.3a1, linux]
I need a gtk2 entry widget to expand (and hopefully contract too)
so as to always display just the text it contains. It is critical
that all the text be visible, not scroll out of sight. I'm using a
monospace font. Is there some neat way to do this?

I've tried a 'changed' callback which does set_size_request, but
calculating the right value (in a multiplatform environment) seems
very hard. Am I missing something simple?

-- George

--
I cannot think why the whole bed of the ocean is
not one solid mass of oysters, so prolific they seem. Ah,
I am wandering! Strange how the brain controls the brain!
-- Sherlock Holmes in "The Dying Detective"

--__--__--

Message: 2
Date: Thu, 6 Feb 2003 13:29:52 -0500
From: torsten
To: gtk-list gnome org
Subject: Buglet in gtk-1.2.10

Hi,

when I have a toolbar with icons, the text labels are of
equal width for all buttons. This means, a long text label
spreads all of the buttons out, purshing some menu items
off the screen.

Hmmmm,
Torsten

--__--__--

Message: 3
To: gry ll mit edu
Cc: gtk-list gnome org
Subject: Re: need entry widget to dynamically resize to fit contents
Date: Thu, 06 Feb 2003 13:43:25 -0500
From: Paul Davis

>[gtk-2.2.0, pango-1.2.0, pygtk-1.99.14, python-2.3a1, linux]
>I need a gtk2 entry widget to expand (and hopefully contract too)
>so as to always display just the text it contains. It is critical
>that all the text be visible, not scroll out of sight. I'm using a
>monospace font. Is there some neat way to do this?
>
>I've tried a 'changed' callback which does set_size_request, but
>calculating the right value (in a multiplatform environment) seems
>very hard. Am I missing something simple?

this is what i use. it sets the size request for any widget so that it
will be big enough to display the given text. note that its broken for
GtkCombo, which stupidly makes a size request, then takes some of the
space for the arrow/button. i imagine its not been fixed in GTK2.

in the gtkmm list archives there is an equivalent using pango.

--p


/*
Copyright (C) 1998-99 Paul Barton-Davis

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

$Id: gtkutils.c,v 1.1.1.1 2001/11/24 00:44:26 pbd Exp $
*/

#include
#include

void
gtk_widget_set_usize_to_display_given_text (GtkWidget *w,
const gchar *text,
gint hpadding,
gint vpadding)

{
guint width;
guint lbearing;
guint rbearing;
guint ascent;
guint descent;

gdk_string_extents (w->style->font,
text,
&lbearing,
&rbearing,
&width,
&ascent,
&descent);

if (vpadding >= 0) {
vpadding += ascent+descent;
}

if (hpadding >= 0) {
hpadding += width;
}

gtk_widget_set_usize (w, hpadding, vpadding);
}


--__--__--

Message: 4
To: gry ll mit edu
Cc: gtk-list gnome org
Subject: Re: need entry widget to dynamically resize to fit contents
From: Valdis Kletnieks vt edu
Date: Thu, 06 Feb 2003 16:21:29 -0500

--==_Exmh_-893435471P
Content-Type: text/plain; charset=us-ascii

On Thu, 06 Feb 2003 13:15:32 EST, george young said:
> [gtk-2.2.0, pango-1.2.0, pygtk-1.99.14, python-2.3a1, linux]
> I need a gtk2 entry widget to expand (and hopefully contract too)
> so as to always display just the text it contains. It is critical
> that all the text be visible, not scroll out of sight. I'm using a
> monospace font. Is there some neat way to do this?

What's the desired behavior if the text goes out-of-range in size? For
instance, if you're using a 8x10 monospace font, the window is 400x200,
and the display is 800x600, what should happen if your text exceeds 50x20
or 100x60 chars in size? And if you have something like:

|| label |input area| || (where || is a window edge)

what should happen to the label if 'input area' grows enough to push it off
the screen?
--
Valdis Kletnieks
Computer Systems Senior Engineer
Virginia Tech


--==_Exmh_-893435471P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Exmh version 2.5 07/13/2001

iD8DBQE+QtHZcC3lWbTT17ARAihKAKCCdHW4a5lSAC+S87YYjArSrQG1TACg1Zpj
TQLEXclZxDTKNlwnfycOKDU=
=84gt
-----END PGP SIGNATURE-----

--==_Exmh_-893435471P--

--__--__--

Message: 5
Date: Thu, 6 Feb 2003 17:49:05 -0500
From: george young
To: Valdis Kletnieks vt edu
Cc: gtk-list gnome org
Subject: Re: need entry widget to dynamically resize to fit contents
Reply-To: gry ll mit edu
Organization: MIT Lincoln Laboratory

On Thu, 06 Feb 2003 16:21:29 -0500
Valdis Kletnieks vt edu wrote:

> On Thu, 06 Feb 2003 13:15:32 EST, george young said:
> > [gtk-2.2.0, pango-1.2.0, pygtk-1.99.14, python-2.3a1, linux]
> > I need a gtk2 entry widget to expand (and hopefully contract too)
> > so as to always display just the text it contains. It is critical
> > that all the text be visible, not scroll out of sight. I'm using a
> > monospace font. Is there some neat way to do this?
>
> What's the desired behavior if the text goes out-of-range in size? For
> instance, if you're using a 8x10 monospace font, the window is 400x200,
> and the display is 800x600, what should happen if your text exceeds 50x20
> or 100x60 chars in size? And if you have something like:
>
> || label |input area| || (where || is a window edge)
>
> what should happen to the label if 'input area' grows enough to push it off
> the screen?

The window should simply expand as far as necessary. The application's main window
is inside a scrolled window, so the user can manually scroll if need be --
(and this is important): manually scroll to see part of the window the scroll bars
tell her are obscured. A *fixed* width gtk_Entry does not provide any visual cue
when some data is obscured.

In practice, the awkwardness of dealing with a data window much wider than
the screen will sharply curtail user's verbosity, so I don't worry too much
about people writing War&Peace in a gtk.Entry. The application provides
other places to enter long multi-line verbiage.

-- George
--
I cannot think why the whole bed of the ocean is
not one solid mass of oysters, so prolific they seem. Ah,
I am wandering! Strange how the brain controls the brain!
-- Sherlock Holmes in "The Dying Detective"

--__--__--

Message: 6
Subject: GTK+ with framebuffer gui not repainting.
Date: Thu, 6 Feb 2003 18:37:48 -0700
From: "Binoj VB"
To: "gtk-list"

Hello all,=20

I have installed the gtk+-2.2 with frame buffer support on Redhat 8.0.
The configuration option used is=20

configure --enable-debug=3Dno --with-gtktarget=3DLinux-fb =
--disable-shadowfb
--disable-module -with-included-loaders=3Dxpm,png,jpeg

I tried to run the test programs in the directory,
Gtk+-2.2.0/tests/testcalendar.=20

The GUI poped up and I am able to use my keyboard to select buttons.
When I take the mouse over the GUI, where ever the mouse pointer is
taken the gui color disappears/ I can see the background(black color). I
feel like the GUI is not getting repainted.=20

How do I solve this problem?? Please help..=20

Thanks and regards,=20
Binoj =20



--__--__--

Message: 7
Subject: Pango problem
From: Bernd Demian
To: GTK
Organization: CSC Ploenzke
Date: 07 Feb 2003 09:44:51 +0100

Hello all,
I wrote this in the past, but nobody can help me. So I try again,
because this is for us very important.
In dialogs we use gtk_entry_set_width_chars(GTK_ENTRY(entry),length) and
mono spaced fonts like courier 12 to told the entry the visible lenght.
With Linux all is ok. When we start the application on TRU64 or start
the appl remote to Windows with Exceed the entrys are to long, it means
when length is 6 then in the entry has space for 10 character.


Thanks for any help
--
Bernd Demian
CSC Ploenzke


--__--__--

Message: 8
Date: Fri, 7 Feb 2003 10:11:06 -0600 (CST)
From: Victor Hugo Dorantes Gonzalez
To:
Subject: Cygwin Gtk without XServer?



Some body has build an application in cygwinw that don't need the
Xserver, some compilation option??? Thanks in advance.



V. Hugo



--__--__--

Message: 9
Date: Fri, 7 Feb 2003 10:22:17 -0600 (CST)
From: Victor Hugo Dorantes Gonzalez
To:
Subject: Re: WIN32 build of a GTK2 app


> > I'm trying to compile/link/run a GTK app on WIN32 (it works on Linux).
> > I'm using:
> >
> > MinGW-2.0.0-3.exe
> > MSYS-1.0.8-rc-1.exe
> > gtk+-dev-2.2.0-20030119.zip

Somebody has using some aleternative to use uio.h (in particular readv and
writev) in win32??


V. Hugo




--__--__--

_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list


End of gtk-list Digest



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

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