Re: Small question about GtkTextBuffer

2005-04-28 Thread Paolo Costabel
Catch "mark-set" and reset the cursor position if it falls oustide the range. Pavel Syomin wrote: Hi! Can anybody suggest me how can I restrict cursor movement on GtkTextBuffer? Now I connect to "key-press-event" signal and handle key codes, but user can change cursor position with mouse. Any i

Re: Small question about GtkTextView

2005-04-21 Thread Paolo Costabel
You can use the "insert-text" signal of GtkTextBuffer to filter input and the "mark-set" signal to catch cursor movements. Pavel Syomin wrote: Hi, I'm try to create something like console widget using GtkTextView, but I'm confronted with some difficults. I want to process user input before chang

Re: Window buttons

2005-04-20 Thread Paolo Costabel
delete_event g_signal_connect ((gpointer) MainWindow, "delete_event", G_CALLBACK (on_MainWindow_delete_event), NULL); Daniel Ferreira Monteiro Alves wrote: What signal is send after click in the close button of a window? It's because I want to check if the user r

Re: Progress bars and syscals

2005-04-19 Thread Paolo Costabel
You need to call while( g_main_iteration (FALSE)); to update the progress bar. The gtk_progress_bar_set_fraction queues draw requests that are then executed inside gtk main event loop. Be careful that calling g_main_iteration also processes user messages, so if the user clicks on something, the c

Re: running a function

2005-04-13 Thread Paolo Costabel
Yes, just use gboolean(*timeout_callback)(gpointer data); int tag = gtk_timeout_add( 100, timeout_callback, user_data); to add your function and gtk_timeout_remove(tag); to turn it off. timothy johnson wrote: I am new to gtk, and trying my hand at writing a mp3player, I am working on th

Re: GtkTextView and scrolled window

2005-04-12 Thread Paolo Costabel
I that case you need to use gtk_text_view_scroll_to_iter to force an update. Mishael A Sibiryakov wrote: Ð ÐÑÑ, 12/04/2005 Ð 10:15 -0700, Paolo Costabel ÐÐÑÐÑ: Mishael A Sibiryakov wrote: Hello. I have a two small question about GtkTextView and about how it works with scrolled

Re: GtkTextView and scrolled window

2005-04-12 Thread Paolo Costabel
Mishael A Sibiryakov wrote: Hello. I have a two small question about GtkTextView and about how it works with scrolled window widget. 1. I have a TextView witch is placed to scrolled window (this is simple chat window), and i want to do automatic scroll is new message inserted to Tex

Re: gtk and fonts on OS X

2005-02-28 Thread Paolo Costabel
A bit off topic, but I think you might be interested in this project: http://sourceforge.net/projects/gtk-cocoa/ It's a port of Gtk+ 1.2 to cocoa native. I'm still working on it, but there is quite a lot of functionality already in. Allin Cottrell wrote: I'm able to build and run my gtk app just

Re: Blocking signals

2005-02-24 Thread Paolo Costabel
This is one of the recurring problems in GTK. If you only want to block your own handlers, the easiest way is to have a global flags that every handler checks to determine whether or not it should execute. It is not elegant, but it's easy and failproof. Of course if you are trying to block defaul

GtkTextView: scrolling last line to top

2005-02-16 Thread Paolo Costabel
Is there a way to scroll the last line of a text view to the top of the view? I tried to use the align parameter like this: gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW(EditorTextView), &iter, 0.0, TRUE, 0.0, 0.0); where iter points to the last line in the buffer, but the view only scrolls so

Re: can I pass user data to a button callback?

2005-02-15 Thread Paolo Costabel
The prototype for the "pressed" and "released" callback is user_function (GtkButton *button, gpointer user_data); gpointer is typedef'd as void *. If you are getting a compiler error, you are probably not including the right headers. Felix Kater wro

Re: how to justify text in a GtkTextView

2005-02-01 Thread Paolo Costabel
0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); gtk_widget_show (button); gtk_widget_show (window); gtk_main(); return 0; } -Original Message- From: Paolo Costabel [mailto:[EMAIL PROTECTED] Sent: Monday, January 31, 2005 5:42 P

Re: how to justify text in a GtkTextView

2005-01-31 Thread Paolo Costabel
Hmm, works fine here. Are you doing something after insterting the text that could affect the justification? Boncek, John wrote: Thanks for your suggestion, which I just tried. No difference. -Original Message- From: Paolo Costabel [mailto:[EMAIL PROTECTED] Sent: Monday, January 31

Re: how to justify text in a GtkTextView

2005-01-31 Thread Paolo Costabel
Do gtk_text_buffer_set_text after gtk_text_view_set_justification Boncek, John wrote: I can't get text justification to work. Am I missing something? Here is a code snippet: // create TextView GtkTextView * view; GtkTextBuffer * buffer; view = G

Re: GtkTextBuffer: how to insert new line?

2005-01-27 Thread Paolo Costabel
*text, gint len); /buffer/ : a GtkTextBuffer <cid:[EMAIL PROTECTED]> /text/ : some text in UTF-8 format /len/ : length of text, in bytes Plus, why are you adding a NULL terminator? And yes, it inserted four newlines. I put four to make it more obvious. Felix Kater

Re: GtkTextBuffer: how to insert new line?

2005-01-27 Thread Paolo Costabel
I just tried this: gtk_text_buffer_insert_at_cursor(buffer, "\n\n\n\n", 4); and works fine here (gtk 2.4.10). What call are you using? Felix Kater wrote: Hi, how do I insert a new line after I inserted text into a GtkTextBuffer? I am using gtk 2.4 (with win32/mingw) and got gtk errors when I tri

Re: how hide mouse cursor?

2005-01-26 Thread Paolo Costabel
gdk_window_set_cursor(GTK_WINDOW(window)->window, cursor); ALLs soft wrote: how i can hide cursor in this window (not GDK, it is GTK)? (code down don't work but i can compile it without errors.) do somebody can send me an example, maybe in gdk (with full source ready for compile)? thanks #includ

Re: size adaptive window layout

2005-01-26 Thread Paolo Costabel
What layout widget are you using for your table? Stefan Kost wrote: hi hi, I generate layouts for property windows. It is basically a large table, where each property is a row. I've put the table into a scrolled window to care for very large windows (taller that the screen). Here is how it looks li

Re: How to specify max char limit on GtkTextView

2005-01-25 Thread Paolo Costabel
You could connect to the GtkTextBuffer insert-text signal and remove character in excess of the desired length. Gaurav Jain wrote: Hi All, I wish to enforce a maximum character limit on a GtkTextView. For GtkEntry, there is an API called gtk_entry_set_max_length(), but I couldn't find one for Gt

Re: compare entry with list

2005-01-25 Thread Paolo Costabel
Vinod Joseph wrote: Hello Members Please guide me why this operation fails logically for some values at some times Dosent give a consistent behavior... Please help... Callback_Function_on_userid_entry(GtkWidget *entry) { const gchar *entry_text; entry_text = gtk_entry_get_text (GTK_ENTRY (en