Re: GtkTextView / GtkTextBuffer and g_signal_connect



On Mon, 19 Aug 2002 19:11:12 -0700 "Joe" <joeja mindspring com> wrote:

Hello,
    I am not on this list and I have a few questions.  I am attempting 
to develop a simple editor using the GtkTextView / GtkTextBuffer.

    1) I am not sure this is a bug but here goes. I have created a 
composit textwidget called GXTEXT.  The buffer is a text buffer and the 
textarea is the textview.  I add the two signals below:    

    g_signal_connect(GXTEXT(maintext)->buffer, "changed",
                        (GtkSignalFunc)lineposition, label);

    // this signal fails to pass the label but the previous one does ?
    g_signal_connect(GXTEXT(maintext)->textarea, "move_cursor",
                        (GtkSignalFunc)textlineposition, label);

    The function prototypes are below:

        static void lineposition (GtkTextBuffer *, GtkWidget *);
        static void textlineposition (GtkWidget *, GtkWidget *);

read the f)(&^%$ manual
according to the reference guide the prototype for move-cursor is:
"move-cursor"
            void        user_function      (GtkTextView *textview,
                                            GtkMovementStep arg1,
                                            gint arg2,
                                            gboolean arg3,
                                            gpointer user_data);

    2) Do I need to do something special to get scrolling to work?  I 
get scroll bars in the scrolled window, but when I am typing and I hit 
carriage return or get out of the viewport I have to manually move the 
window.  Is this a bug?

set the scrolling of the scrolwin to auto

    3) How do I select all the text in the textbuffer?  I know how to 
get the textbounds, but how would I implement a 'select all' menu type 
item?  Is there a special tag I should use or something?

just set the insert and selection markers to the beginning and the end of
the buffer

    4) Is there an easy way to do syntax highlightening?

depends on what you want, about 1100 lines of code needed in bluefish

regards,
        Olivier
-- 
Bluefish web editor
http://bluefish.openoffice.nl/
development mailinglist: bluefish-dev lists ems ru
send "subscribe" to bluefish-dev-request lists ems ru
#bluefish on IRCnet



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