SOLVED: Re: GtkLabel inside an eventbox
- From: Bohdan Vlasyuk <bohdan kivc vstu vinnica ua>
- To: Havoc Pennington <hp redhat com>
- Cc: gtk-app-devel-list gnome org
- Subject: SOLVED: Re: GtkLabel inside an eventbox
- Date: Tue, 5 Jun 2001 19:30:03 +0300
On Tue, Jun 05, 2001 at 11:16:52AM -0400, Havoc Pennington wrote:
I've decided to try to write some silly programs with Gtk+, and I
want to make `xclock -d' clone. I'm putting GtkLabel inside an
eventbox to catch moushe clicks so that window will be closed after
clicks [at first, it was button not label-in-the-box :-) ]. This
works fine, however, I can't understand why Window is bigger than
actual text is, or, rather, taller [width are same, and button seen
to behave similarly]. What can be done with it ??
If it isn't that size for you, send along a small test case showing
the problem.
Hehe.. silly me :-). That was not the problem :-).
The problem was that I've used
time_t now=time(NULL);
gtk_label_set_text(GTK_LABEL(data),ctime(&now));
but, ctime return nicely formated string, and this string already
contains '\n', so my label was twice large as required.
However, thanks all who replied..
--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]