Re: Usage of GTK+ headers

2005-10-11 Thread Matthias Clasen
On Tue, 2005-10-11 at 15:00 -0700, Banginwar, Rajesh wrote:
> Hello,
> 
> Many of the GTK+ libraries have one or more top level
> header files. E.g. Glib has glib.h, gdk-pixbuf has two gdk-data.h and
> gdk-pixbuf.h and so on… My question is about what applications
> typically use? Do they use just the top level header only? Or is it ok
> to use the specific header file as needed e.g. gtk/gtkstyle.h?
> 
>  

The indended use is to just include the toplevel header file, ie 

#include  

or 

#include 

An exception from this rule are the stdio wrappers, for which you
explicitly have to 

#include 

This is because glib.h is not supposed to pull in stdio.h.

All of this is documented in the API docs.


Matthias


___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


gtk_text_view_get_text ()

2005-10-11 Thread Krzysiek Szczuka

Hi..
I'm new on this list (in GTK+ too;>) so here's about me:
I'm Krzysiek Szczuka, student from Poland.
I've wrote function that I think should be useful, so i'm sending it to You:

gchar * gtk_text_view_get_text (GtkTextView *text_view)
{
GtkTextIter start, end;
GtkTextBuffer *buff =
	gtk_text_view_get_buffer(GTK_TEXT_VIEW(lookup_widget(widget,			 
 "textview_workers_memo")));


gtk_text_buffer_get_start_iter(buff, &start);
gtk_text_buffer_get_end_iter(buff, &end);

return gtk_text_buffer_get_text(buff, &start, &end,
 FALSE);
}

Regards!
ksz
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Usage of GTK+ headers

2005-10-11 Thread Banginwar, Rajesh








Hello,

    Many of the GTK+ libraries have one or more top
level header files. E.g. Glib has glib.h, gdk-pixbuf has two gdk-data.h and
gdk-pixbuf.h and so on… My question is about what applications typically use?
Do they use just the top level header only? Or is it ok to use the specific
header file as needed e.g. gtk/gtkstyle.h?

 

Thanks,

 

-Rajesh






___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


no gtk team meeting this week

2005-10-11 Thread Matthias Clasen
I guess most people are still tired from the Summit,
or still traveling, and I don't have much time this week,
so lets take a break this week.

Matthias

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Proposal for GTK+ advanced formatted entry and spinner API

2005-10-11 Thread Itai Bar-Haim
Hi all.I would like to propose my idea for Format-Elements, that will be used to control GtkEntry and GtkSpinButton.The idea is to allow organized, element-based formatting of data displayed textually.The
current common formatting methods include regular expressions and
masking, and can be done either "real-time" (as you type) or "offline"
(upon validation request, like a "lose-focus-event").While these
methods are sufficient in some places, they are very limited for the
common uses and I see it. For example, the most common uses for
formatted entries include a date/time entry and an IP address entry.With the lack of a good formatting method, these are implemented as a set of spin-buttons or with an offline-validators.
It would look much nicer if there could be a formatted spin-button that
could handle each of the elements separately, while maintaining the
outputted, visible value as a simple textual string.What I would like to propose is as follows:

  Define a base "format_element" structure that will dictate the
interface. It will include methods for getting the value as a string
(formatted to fit in a given minimum width), the minimum width (in
characters) of the element, and scrolling methods (step up, step down,
page up, page down, top, and bottom). It will also allow the programmer
to define whether the element is editable or static (say, a separator
or a format specifier, like the brackets in a phone-number). The format
element also holds its own value.
  Define several format elements implementing this interface, each
handles a different type of data. There will be format elements to
handle integer values, floating-point values, enumeration/completion
strings, general strings, and others as needed.
  Let GtkEntry contain a list of format elements (and the needed API to handle this list). The entry need to know what is the current focused format element (this can be done by checking the cursor position whenever it changes, using the notify::cursor_position event), and need to pass the element the character that the user wanted to enter. The only change in value in this case is done within the format-element. When a change in a format element occures, the entry need to rewrite itself by concatanating the values of all its format elements in order.

  Let GtkSpinButton send the relevant scroll requests to the focused format-element.
  Create a simple, non-programmative API for definition of the format (say, using a string in a defined format) that will
internally create the needed format-elements and will add them to the
list. This way, creating a date/time field will look something like
this:
  

GtkWidget *spinner;
spinner = gtk_spin_button_new ();
gtk_entry_add_format_element
(spinner, gtk_format_element_int_new (1,
31)); // day
gtk_entry_add_format_element (spinner, gtk_format_element_string_new_static ("-")); // separator
gtk_entry_add_format_element
(spinner, gtk_format_element_int_new (1,
12)); // month
gtk_entry_add_format_element (spinner, gtk_format_element_string_new_static ("-")); // separator
gtk_entry_add_format_element (spinner, gtk_format_element_int_new (0, ));       // year
gtk_entry_add_format_element (spinner, gtk_format_element_string_new_static (" ")); // separator
gtk_entry_add_format_element
(spinner, gtk_format_element_int_new (1,
12)); // hour
gtk_entry_add_format_element (spinner, gtk_format_element_string_new_static (":")); // separator
gtk_entry_add_format_element
(spinner, gtk_format_element_int_new (0,
59)); // minute
gtk_entry_add_format_element (spinner, gtk_format_element_string_new_static (":")); // separator
gtk_entry_add_format_element (spinner, gtk_format_element_int_new (0, 59));         // second
gtk_entry_add_format_element (spinner, gtk_format_element_string_new_static (" ")); // separator
gtk_entry_add_format_element (spinner, gtk_format_element_enum_new ("AM", "PM", NULL));

(simply, adding the wanted format elements in the wanted order to the spin button.)The
value of the spin-button could be taken as a string in this case, or a
reference can be held to  each of the non-static format elements,
and its inner, real value can be used.
This is my proposal, I would like to know what you think and receive comments about it.Itai.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list