[9792] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] RE: ANNOUNCE: GtkSheet-5.3

daemon@ATHENA.MIT.EDU (Rostedt, Steven)
Tue Nov 3 10:31:15 1998

Date: Tue, 03 Nov 1998 10:21:59 -0500
From: "Rostedt, Steven" <steven.rostedt@lmco.com>
To: "'gtk-list@redhat.com'" <gtk-list@redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01BE073E.21948DD5
Content-Type: text/plain;
	charset="iso-8859-1"


I've noticed that using GtkSheet (on Slackware Linux 2.0.35 - XFree86 3.3.2
- GTK 1.0.6)
That if you click quickly (and randomly) around that when you destroy the
window
your receive the following messages:


** WARNING **: invalid cast from `(unknown)' to `GtkSheet'

** WARNING **: invalid cast from `(unknown)' to `GtkWidget'

** WARNING **: invalid cast from `(unknown)' to `GtkObject'

This is caused by the "timeout" calls in the gtk_sheet_button_pressed.
It seems that multiple clicks will cause the routine to be called before
a timeout is removed. When the routine is called again, the original
timeout is lost, thus causing the warning messages after the widget is 
destroyed.

I added a test to see if the timeout exists before creating a new one.
If one does, then I remove it.  This may not be the best implementation
but it was the only one I had time for. I haven't taken a look to see
what ramifications that this will cause.

Please take a look, and maybe someone could fix this better :)

 <<gtksheet.diff>> 
This is a diff of gtksheet.c for 5.3


> -----Original Message-----
> From:	Adrian Feiguin [SMTP:adrian@ifir.ifir.edu.ar]
> Sent:	Monday, November 02, 1998 1:09 PM
> To:	gtk-list@redhat.com
> Subject:	[gtk-list] ANNOUNCE: GtkSheet-5.3
> 
> 
> GtkSheet-5.3
> ============
> 
> The graphic interface is nicer and more friendly. 
> The appeareance is more familiar and I added some new features:
> 
> You can make a selection and move it dragging the border.
> 
> You can resize the selection dragging the bottom-right corner.
> 
> You can store the selection on the clipboard. 
> 
> (All this functions emit a signal. You can cutomize your application
>  connecting a signal handler in order to do the desired action. See
>  the example 1 in the demo program) 
> 
> NOTE: the selection handler has not been implemented yet.
> The demo program is an application which includes an external entry 
> connected with the sheet's entry. The external entry does not belong to
> the 
> widget, the widget has its own entry and the text is edited interactivelly
> and "on the site". 
> You can download it from my ftp site:
>   ftp://ripley.ifir.edu.ar/pub/gtk/gtksheet/gtksheet-5.3.tar.gz
> I'm uploading the new version to gtk.org
> I hope it will be included in future releases of gtk.
> 
> --------------------------------------------------------------------------
> 
> GtkSheet is a Matrix/Table widget for Gtk+
> Originally, it was a variant of GtkClist widget (by Jay Painter) but
> it became more than I expected, and actually it has almost nothing to do 
> with it.
> 
> This distribution includes a demo program where you can see many of the
> widget's features.
> 
> You can download it from my ftp site:
>   ftp://ripley.ifir.edu.ar/pub/gtk/gtksheet/gtksheet-5.3.tar.gz
> 
> BRIEF DESCRIPTION
> =================
> 
> GtkSheet is a matrix where you can allocate cells of text.
> 
> Cell contents can be edited interactively with an specially designed
> entry, based on GtkEntry (so it has the same features).
> 
> You can parse text connecting a parser to the "set cell" signal.
> (See example 2 in the demo program)
> 
> You can change width, height, background color, foreground color, border
> color, border style, and many other attributes of the cells.
> (see examples in the demo program)
> 
> You can use the matrix as a browser with gtk_sheet_new_browser, and the
> cell contents could not be edited.
> 
> ** READ THE HEADERS FOR MORE INFORMATION **
> 
> TO DEVELOPERS
> ==============
> 
> GtkSheet is a composite widget: scrollbars, entry, and a button.
> 
> I realized that I can gain a lot of time and memory replacing button
> widgets with button emulating gadgets. This is one of the main differences
> with GtkClist GUI, and I don't use windows to resize rows/columns. 
> 
> To allocate memory, I used an array of pointers. I could used a linked
> list or a hash table, but I was originally inspired in SC (I wanted to do
> a Gtk port for it), so memory allocation routines are inspired on SC's.
> 
> I didn't take advantage of the use of glibs, maybe many features could be
>  optimized in this way.
> 
> GtkSheetEntry is based on the gtk+-0.99.3 realease of GtkEntry, so many
> bugs must be fixed, and features must be updated.
> 
> I have no experience on XFonts, so I left this part of the attributes
> setting to be done by anyone who wants to.
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
> /dev/null

------_=_NextPart_000_01BE073E.21948DD5
Content-Type: application/octet-stream;
	name="gtksheet.diff"
Content-Disposition: attachment;
	filename="gtksheet.diff"
Content-Location: ATT-0-F881D3712873D21192A90000F81F19F3-G
	TKSHE%7E1.DIF

727a728,729
>   sheet->timer = -1;
> 
1402a1405,1408
>   /* remove any timers */
>   if (sheet->timer > 0) 
>     gtk_timeout_remove(sheet->timer);
> 
3285a3292,3294
>      /* remove any timers */
>      if (sheet->timer > 0) 
>        gtk_timeout_remove(sheet->timer);
3322a3332,3334
>        /* remove any timers */
>        if (sheet->timer > 0) 
> 	 gtk_timeout_remove(sheet->timer);
3336a3349,3351
>        /* remove any timers */
>        if (sheet->timer > 0) 
> 	 gtk_timeout_remove(sheet->timer);
3514a3530
>   sheet->timer = -1;

------_=_NextPart_000_01BE073E.21948DD5--

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post