Re: Can I make a IM Module resident?
Oh, I see. But the interface of this function is different with the static one, could you please give me some hint on how to use it? The GTypeInfo parameter is replaced by a GTypePlugin pointer. Could you please tell me how can I convert a GTypeInfo into GTypePlugin? Regards James Su Sven Neumann wrote: Hi, James Su <[EMAIL PROTECTED]> writes: Then, how can I use my own class within a IM module? There is no type register function like g_type_register_dynamic. I'm pretty sure there is exactly this function. But don't take my word that this is the right way to do this, I'm more or less only guessing here. Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Can I make a IM Module resident?
Hi, James Su <[EMAIL PROTECTED]> writes: > Oh, I see. But the interface of this function is different with the > static one, could you please give me some hint on how to use it? > > The GTypeInfo parameter is replaced by a GTypePlugin pointer. Could > you please tell me how can I convert a GTypeInfo into GTypePlugin? as I said, I'm not an expert in this area but I had a short look and I'd say that you don't need to use this function directly. Why don't you just register all types from your module using g_type_module_register_type() ? I don't see why that should not work. Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: TreeView speedup
On Mon, 2003-03-24 at 11:41, Andrew E. Makeev wrote: > Good day, > > I would to ask if someone got TreeView widget filling in speed really > improved? > > On our side we made 2 improvements: > > 1. Added function in GTK that fills TreeModel row with values stored in > GList. > Test case: 1 rows with 4 string, 4 int, 4 double, 4 bool columns. > Model was filled with values in 3-4 x times faster. (1 sec against 4 > sec). > > 2. Wrote our own simple TextRenderer with "cached" Pango::Layout where > only text could be changed. > Test case: 1 rows with 4 string, 4 int, 4 double, 4 bool columns. > TreeView was filled with values in 3-4 x times faster. (8-9 sec > against 30 sec). > Hi, Could you post code for these improvements? I just use CList, because of TreeView being so slow. But I would like to use TreeView, and it would be easier for me to write TextRenderer if I see something similar. Regards, Olaf Fraczyk ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
method for destroying GtkFileSelection
Hi here is the handler I use to destroy a gtkfileselection, when CANCEL button is pushed void cancel(GtkButton *cancel_button) { GtkWidget *window; window=gtk_wifget_get_parent(GTK_WIDGET(cancel_button)); window=gtk_wifget_get_parent(window); window=gtk_wifget_get_parent(window); gtk_widget_destroy(window); } Is there a better way than that? (get the parent widget until you get the window) Axel ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
RE: TreeView speedup
Can't you just freeze and unfreeze the TreeView somehow when adding lots of rows? Murray Cumming [EMAIL PROTECTED] www.murrayc.com > -Original Message- > From: Olaf Fraczyk [mailto:[EMAIL PROTECTED] > Sent: Freitag, 28. März 2003 10:49 > To: Andrew E. Makeev > Cc: gtkmm-main; GTK-MAIN > Subject: Re: TreeView speedup > > > On Mon, 2003-03-24 at 11:41, Andrew E. Makeev wrote: > > Good day, > > > > I would to ask if someone got TreeView widget filling in > speed really > > improved? > > > > On our side we made 2 improvements: > > > > 1. Added function in GTK that fills TreeModel row with > values stored in > > GList. > > Test case: 1 rows with 4 string, 4 int, 4 double, 4 > bool columns. > > Model was filled with values in 3-4 x times faster. (1 > sec against 4 > > sec). > > > > 2. Wrote our own simple TextRenderer with "cached" > Pango::Layout where > > only text could be changed. > > Test case: 1 rows with 4 string, 4 int, 4 double, 4 > bool columns. > > TreeView was filled with values in 3-4 x times faster. (8-9 sec > > against 30 sec). > > > Hi, > > Could you post code for these improvements? > I just use CList, because of TreeView being so slow. > But I would like to use TreeView, and it would be easier for > me to write > TextRenderer if I see something similar. > > Regards, > > Olaf Fraczyk > > > > > ___ > gtk-list mailing list > [EMAIL PROTECTED] > http://mail.gnome.org/mailman/listinfo/gtk-list > ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: GtkFileSelection
Hi, On Tue, 25 Mar 2003, Axel wrote: > so i don' t think being wrong. > so the handler to use shoud be > > void store_filename (GtkButton *ok_button, GtkFileSelection){ } > and the connect : > g..connect(GTK_OBJECT (file_selector->ok_button),"clicked",G_CALLBACK > (store_filename),file_selector); Yes, that looks better. > but I don' t like that, because I d like to store filename in another > variable that i can pass to create_file_selection() or in another way, > not a local variable to store_filename() > How could I do? I don't believe there's a "create_file_selection ()" variant that allows to set the initial file, if that's what you're asking for. But won't a subsequent call to gtk_file_selection_set_filename () after you've created the file_selection be the same thing? Ray ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: method for destroying GtkFileSelection
Hi, On Fri, 28 Mar 2003, Axel wrote: > Hi > here is the handler I use to destroy a gtkfileselection, when CANCEL > button is pushed ... > Is there a better way than that? (get the parent widget until you get > the window) This works for me: static void cancel (GtkWidget *w, GtkWidget *data) { gtk_widget_destroy (GTK_WIDGET (data)); } where I've connected the callback as follows: g_signal_connect (GTK_FILE_SELECTION (filebox) -> cancel_button,"clicked", G_ CALLBACK (cancel), filebox); Works fine, though I'm not sure if that's the way you're suppose to do it. Ray ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
RE: TreeView speedup
On Fri, 2003-03-28 at 12:04, [EMAIL PROTECTED] wrote: > Can't you just freeze and unfreeze the TreeView somehow when adding lots of > rows? Please take a look at "speeding up GtkTreeView?" thread on gtk-app-devel from 11 Feb 2003. There were also discussion about it last year, but I don't remember exactly when. The conclusion was that the only solution was to write custom GtkTreeModel. And that other source of slowness is pango. Regards, Olaf ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: TreeView speedup
On Mon, 2003-03-24 at 11:41, Andrew E. Makeev wrote: 2. Wrote our own simple TextRenderer with "cached" Pango::Layout where only text could be changed. Test case: 1 rows with 4 string, 4 int, 4 double, 4 bool columns. TreeView was filled with values in 3-4 x times faster. (8-9 sec against 30 sec). Hi, Could you post code for these improvements? I just use CList, because of TreeView being so slow. But I would like to use TreeView, and it would be easier for me to write TextRenderer if I see something similar. Well, here is test sample with simple text renderer (column size is not handled well though). -andrew #include #include class CellRendererTextSimple : public Gtk::CellRenderer { public: CellRendererTextSimple (); virtual ~CellRendererTextSimple () { } Glib::PropertyProxy property_text(); protected: virtual void get_size_vfunc (Gtk::Widget& widget, const Gdk::Rectangle* cell_area, int* x_offset, int* y_offset, int* width, int* height); virtual void render_vfunc (const Glib::RefPtr& window, Gtk::Widget& widget, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, const Gdk::Rectangle& expose_area, Gtk::CellRendererState flags); private: Glib::Property property_text_; Glib::RefPtr< Pango::Layout > m_ptrLayout; bool m_needLayout; }; CellRendererTextSimple::CellRendererTextSimple () : Glib::ObjectBase (typeid(CellRendererTextSimple)), Gtk::CellRenderer (), property_text_(*this, "text", ""), m_needLayout (true) { property_mode () = Gtk::CELL_RENDERER_MODE_INERT; property_xpad () = 2; property_ypad () = 2; property_xalign () = 0.0; property_yalign () = 0.5; } Glib::PropertyProxy CellRendererTextSimple::property_text () { return property_text_.get_proxy(); } void CellRendererTextSimple::get_size_vfunc (Gtk::Widget& widget, const Gdk::Rectangle* cell_area, int* x_offset, int* y_offset, int* width, int* height) { if (m_needLayout) { m_ptrLayout = widget.create_pango_layout (""); m_needLayout = false; } Pango::Rectangle rect = m_ptrLayout->get_pixel_logical_extents (); if (width) { *width = property_xpad ()*2 + rect.get_width (); } if (height) { *height = property_ypad ()*2 + rect.get_height (); } if (cell_area) { if (x_offset) { *x_offset = int (property_xalign ()*(cell_area->get_width () - rect.get_width () - 2*property_xpad ())); *x_offset = std::max (*x_offset, 0); } if (y_offset) { *y_offset = int (property_yalign ()*(cell_area->get_height () - rect.get_height () - 2*property_ypad ())); *y_offset = std::max (*y_offset, 0); } } } void CellRendererTextSimple::render_vfunc (const Glib::RefPtr& window, Gtk::Widget& widget, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, const Gdk::Rectangle& expose_area, Gtk::CellRendererState flags) { if (m_needLayout) { m_ptrLayout = widget.create_pango_layout (""); m_needLayout = false; } m_ptrLayout->set_text (property_text ()); const unsigned int cell_xpad = property_xpad (); const unsigned int cell_ypad = property_ypad (); Gtk::StateType state; int x_offset = 0, y_offset = 0, width = 0, height = 0; get_size (widget, cell_area, x_offset, y_offset, width, height); if((flags & Gtk::CELL_RENDERER_SELECTED) != 0) { state = (widget.has_focus()) ? Gtk::STATE_SELECTED : Gtk::STATE_ACTIVE; } else { state = (widget.is_sensitive()) ? Gtk::STATE_NORMAL : Gtk::STATE_INSENSITIVE; } widget.get_style () ->paint_layout (window, state, true, cell_area, widget, "cellrenderertext", cell_area.get_x () + x_offset + cell_xpad, cell_area.get_y () + y_offset + cell_ypad, m_ptrLayout); } class MyWindow : public Gtk::Window { struct MyColumnModel : Gtk::TreeModel::ColumnRecord { Gtk::TreeModelColumn< int > id; Gtk::TreeModelColumn< Glib::ustring > label; Gtk::TreeModelColumn< double > val; Gtk::TreeModelColumn< bool > check; Gtk::TreeModelColumn<
Re: File Descriptor Input
in addition to points made by others: >/ Ok, I have now revised it as follows ***/ > >void input_callback( gpointer data, > gint source, > GdkInputCondition condition ) >{ > gchar *mesg; > mesg =data; > g_print("Got something.\n"); >} this is still not the correct function prototype. it doesn't return a value. moreover, i think you misunderstand what "data" is. its not the data that is available to read. its the pointer you supplied in gdk_input_add(). its your function's job to read the data from the source. the "data" argument is just there in case it needs help (e.g. some kind of additional information needed to read the data; not normally necessary for simple i/o based on file descriptors). a typical handler would look something like: int input_callback (gpointer data, gint source, GdkInputCondition cond) { char buf[SOME_SIZE]; int call_again = TRUE; switch (cond) { case GDK_INPUT_READ: read (source, buf, SOME_SIZE); ... do something ... break; case GDK_INPUT_EXCEPTION: ... do something ... call_again = FALSE; break; } return call_again; } >> you can't do this. if you don't read the data, then >> your function will >> be called again immediately, because there is still >> data to be read. > >I wish, it is called again and again :-) >My problem is that it is not being called at all :-( if you want it called again and again, the least you have to do is to make it return TRUE. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
question about encoding
hi I m trying to open and read file which contains accentued characters like éèùà so I open a file, with GIOChannel and read the strings but what is the function to get the encoding ? I didn' t found it in API I have seen call to convert to utf8 but it needs the original encoding from the string, and I didn' t found how to get it. Someone could help me ? Thanks Axel ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Can I make a IM Module resident?
On Fri, 2003-03-28 at 03:31, James Su wrote: > Oh, I see. But the interface of this function is different with the > static one, could you please give me some hint on how to use it? > > The GTypeInfo parameter is replaced by a GTypePlugin pointer. Could you > please tell me how can I convert a GTypeInfo into GTypePlugin? The idea of GTypePlugin is that you provide information to GObject as to how to load your type when necessary. However, you don't need to provide your own GTypePlugin or use g_type_register_dynamic() directly... what the GTypeModule parameter passed to your init() is is basically an implementation of GTypePlugin that is already set up to for you use. Just use g_type_module_register_type() rather than g_type_register_static(). There are multiple examples of this in the provided input modules, or for more examples, you can look at the theme engines in the gtk-engines/ modules. (They generally register two types .. one GtkStyle type and one GtkRcStyle type.) Regards, Owen > Regards > James Su > > Sven Neumann wrote: > > >Hi, > > > >James Su <[EMAIL PROTECTED]> writes: > > > > > > > >>Then, how can I use my own class within a IM module? There is no type > >>register function like g_type_register_dynamic. > >> > >> > > > >I'm pretty sure there is exactly this function. But don't take my word > >that this is the right way to do this, I'm more or less only guessing > >here. ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Make widgets visible in a Scrolled Window
On Thu, 2003-03-27 at 12:57, Sebastian Ley wrote: > Hello, > > I have a scrolled window, created with > gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW (scroll), targetbox); > > The targetbox is a vbox, which will get only another vbox named > questionbox packed in. This questionbox gets now stuffed with > widgets. I do not know at build time how many this will be, sometimes > only one, but possibly many more. To be able to display them all I use > the scrolled window. > > Here some examples how this could look like: > http://www.mmweg.rwth-aachen.de/~sebastian.ley/d-i/screenshots/main-menu.png > http://www.mmweg.rwth-aachen.de/~sebastian.ley/d-i/screenshots/choose-mirror.png > > Now I have two problems: > > 1) Whenn moving the focus inside the widgets when there is a >scrollbar, the focus disappears when widgets currently not on the >screen get it. I want some mechanisme that the focus is always >visible. > > 2) Similar to 1), it is possible, that I have a default widget, that >should be centered (if possible) in the scrolled window. > > Do you have any suggestions how to accomplish that? void gtk_container_set_focus_hadjustment (GtkContainer *container, GtkAdjustment *adjustment); void gtk_container_set_focus_vadjustment (GtkContainer *container, GtkAdjustment *adjustment); Are probably useful for you. There is an example of using them in the testgtk sources. Regards, Owen ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: question about encoding
On Fri, 2003-03-28 at 09:41, Axel wrote: > hi > I m trying to open and read file which contains accentued characters > like éèùà > so > I open a file, with GIOChannel and read the strings > but what is the function to get the encoding ? > I didn' t found it in API > I have seen call to convert to utf8 but it needs the original encoding > from the string, and I didn' t found how to get it. > Someone could help me ? How can GLib know this? You can use g_get_charset() to find out the encoding of the user's locale, but that doesn't necessarily correspond to the encoding of a particular file on disk. Regards, Owen ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: question about encoding
Hi, Axel <[EMAIL PROTECTED]> writes: > I m trying to open and read file which contains accentued characters > like éèùà > so > I open a file, with GIOChannel and read the strings > but what is the function to get the encoding ? > I didn' t found it in API > I have seen call to convert to utf8 but it needs the original encoding > from the string, and I didn' t found how to get it. you need to know it beforehand. No application can interpret a text file without knowledge about the character encoding. That's why every sane file format that includes text, defines the encoding or defines how the encoding is specified. There are some reasonable heuristics that can be used to guess encodings but that is outside the realm of GLib. In your case, I'd guess your file is ISO-8859-1 encoded. Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: question about encoding
Owen Taylor wrote: On Fri, 2003-03-28 at 09:41, Axel wrote: hi I m trying to open and read file which contains accentued characters like éèùà so I open a file, with GIOChannel and read the strings but what is the function to get the encoding ? I didn' t found it in API I have seen call to convert to utf8 but it needs the original encoding from the string, and I didn' t found how to get it. Someone could help me ? How can GLib know this? You can use g_get_charset() to find out the encoding of the user's locale, but that doesn't necessarily correspond to the encoding of a particular file on disk. Regards, Owen Yes but imagine there are some people (me , by example) who have locales set to "POSIX" and have though files with accentued characters, this don' t solve problems. the problem is when I use g-io_channel_read* I get the error : "Invalid byte sequence in conversion input" because glib wait for utf8 and found char like orààà so I found that :g_io_channel_set_encoding() it take in argument the GIOChannel and an encoding, in a string so passing "UTF8" set a GIOChannel to UTF8, I d like to pass another encoding But I don' t know the encodings and strings I can use with that call. API don' t talk about them setting encoding of io channel , then read, and then convert to utf 8 should work but first I need to know what encoding and string to pass to the function I can use to set GIOChannel Someone would have a pointer to them ? Thanks Axel ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: GtkFileSelection
Axel, Use: g_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->ok_button), "clicked", G_CALLBACK (store_filename), (gpointer)file_selection_widget_goes_here); } Then: void store_filename (GtkFileSelection *file_selector, gpointer user_data){ gtkFileSelection fs = GTK_FILESELECTION(user_data); } Hope this helps. That way, you can --- Axel <[EMAIL PROTECTED]> wrote: > hi > I want to use a file selector > > http://developer.gnome.org/doc/API/2.0/gtk/GtkFileSelection.html > describe one of the possible utilisation > but the code given in example looks strange , correct me if I am wrong > but following code can' t work : > > void store_filename (GtkFileSelection *file_selector, gpointer user_data){ } > > void create_file_selection (void) { > GtkWidget *file_selector; > file_selector = gtk_file_selection_new ("Please select a file for editing."); > g_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->ok_button), > "clicked", > G_CALLBACK (store_filename), > NULL); > } > > > > the item sent to the handler is a GtkButton, and handler wait for a > GtkFileSelection > so storing the filename with this method is not possible > > following the log of the test program with the method from API > > GLib-GObject-WARNING **: invalid cast from `GtkButton' to `GtkFileSelection' > (projet:1056): Gtk-CRITICAL **: file gtkfilesel.c: line 1242 > (gtk_file_selection_get_filename): assertion `GTK_IS_FILE_SELECTION > (filesel)' failed > > > > so i don' t think being wrong. > so the handler to use shoud be > > void store_filename (GtkButton *ok_button, GtkFileSelection){ } > and the connect : > g..connect(GTK_OBJECT (file_selector->ok_button),"clicked",G_CALLBACK > (store_filename),file_selector); > > but I don' t like that, because I d like to store filename in another > variable that i can pass to create_file_selection() or in another way, not a > local variable to store_filename() > How could I do? > > > > > ___ > gtk-app-devel-list mailing list > [EMAIL PROTECTED] > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: utility of GtkTextIter ?
On Tue, Mar 25, 2003 at 12:26:11PM +0100, Axel wrote: > Text Widget Overview in API doesn' t talk about it and its API isn' t > very explainative... > so, what is the utility of GtkTextIter ? > Hogwash. Goto the text widget overview and grep for: Most text manipulation is accomplished with iterators It covers the essentials: 1) logically, an iter is a position between to characters in a buffer 2) the underlying data structure is designed for stack allocation and copying. 3) its short lived, modifying the buffer could make it invalid. As for the utility of an Iter, you will notice that they are used to a great extent in the API of TextBuffer and View for communicating a specific location in a TextBuffer. --jkl ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
fork problem
Dear all, I have tried to write a program, which also act as a server when I run it. I use gtk/gnome to build an interface for it. However, when I run it, there is error on the child programme: Gdk-ERROR **: BadIDChoice (invalid resource ID chosen for this connecion) serial 30742 error_code 14 request_code 1 minor_code 0 my program can be simplified as follow int main(int argc, char *argv[]) { /* some gnome setting */ if ( fork() ) { /* server programme */ else gtk_main(); return 0; } when I run the server programme in the child and run the gtk_main() in the parent, the same problem comes out and the server programme can't work at this time. Could you plz help me on the above issue?? Thank you very much. Best wishes, Wai ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Problem building GTK+2.2.1
Hi, I hope someone can help me. I've searched tis and related mail lists (and google) for an answer to my problem, but to no avail. As part of trying to build Gnome 2.2, I am having a real problem with GTK+-2.2.1. AS far as I know, I've built and installed all the dependencies but when I try GTK, I get the following: Peanut:~/gnome/build/gtk+-2.2.1$ ./configure --prefix=/usr Peanut:~/gnome/build/gtk+-2.2.1$ make make all-recursive make[1]: Entering directory `/home/chris/gnome/build/gtk+-2.2.1' Making all in po make[2]: Entering directory `/home/chris/gnome/build/gtk+-2.2.1/po' make[2]: Leaving directory `/home/chris/gnome/build/gtk+-2.2.1/po' Making all in gdk-pixbuf make[2]: Entering directory `/home/chris/gnome/build/gtk+-2.2.1/gdk-pixbuf' Making all in pixops make[3]: Entering directory `/home/chris/gnome/build/gtk+-2.2.1/gdk-pixbuf/pixops' /bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c pixops.c gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c pixops.c -fPIC -DPIC -o pixops.lo /bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c have_mmx.S gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c have_mmx.S -fPIC -DPIC -o have_mmx.lo /bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c scale_line_22_33_mmx.S gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c scale_line_22_33_mmx.S -fPIC -DPIC -o scale_line_22_33_mmx.lo /bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c composite_line_22_4a4_mmx.S gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c composite_line_22_4a4_mmx.S -fPIC -DPIC -o composite_line_22_4a4_mmx.lo /bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c composite_line_color_22_4a4_mmx.S gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -Os -mcpu=i386 -fno-strength-reduce -Wall -c composite_line_color_22_4a4_mmx.S -fPIC -DPIC -o composite_line_color_22_4a4_mmx.lo /bin/sh ../../libtool --mode=link gcc -Os -mcpu=i386 -fno-strength-reduce -Wall -o libpixops.la pixops.lo have_mmx.lo scale_line_22_33_mmx.lo composite_line_22_4a4_mmx.lo composite_line_color_22_4a4_mmx.lo mkdir .libs rm -fr .libs/libpixops.la .libs/libpixops.* .libs/libpixops.* ar cru .libs/libpixops.al pixops.lo have_mmx.lo scale_line_22_33_mmx.lo composite_line_22_4a4_mmx.lo composite_line_color_22_4a4_mmx.lo ranlib .libs/libpixops.al creating libpixops.la (cd .libs && rm -f libpixops.la && ln -s ../libpixops.la libpixops.la) gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED-Os -mcpu=i386 -fno-strength-reduce -Wall -c timescale.c /bin/sh ../../libtool --mode=link gcc -Os -mcpu=i386 -fno-strength-reduce -Wall -o timescale timescale.o libpixops.la -Wl,--export-dynamic -pthread -lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0 -lm gcc -Os -mcpu=i386 -fno-strength-reduce -Wall -o timescale timescale.o -Wl,--export-dynamic -pthread ./.libs/libpixops.al /usr/l
Newbie in over head -- Marshallers
Hello, I need to add a signal to the GtkWidget so that the callback functions will take two pointers instead of one. i.e. foo(GtkWidget *widget, gpointer clientdata, gpointer datastruct){} I realize that I need to use gtk_object_class_user_signal_new(), however, I don't understand how to define a new marshaller for this. The FAQ simply says "If you want your new signal to have more than the classical gpointer parameter, you'll have to play with GTK+ marshallers." I'm guessing that I need to use GtkCallbackMarshal() to define a function, but I can't seem to find any documentation on what the marshaller functions actually need to do. Note: I don't have access to the gtk src code on the machine I'm using yet, so I can't look there for an example Can anyone help me? Thanks, Brooke ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Ping
Someone can tell me how can i display a result from a ping command? ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
How is GdkPixbuf pixel data stored?
Hi I'm looking to manipulate a GdkPixbuf at the pixel level and have found that the actual pixel data is not stored in the way I expected. In order to get the pixel data I have used the following code (where image is a static GtkWidget declared in the header file): void pixel_data(GtkWidget *widget, GdkEvent *event, gpointer data) { int i, array_size; GdkPixbuf *image_data; i = 0; image_data = gtk_image_get_pixbuf(GTK_IMAGE(image)); array_size = 3 * (gdk_pixbuf_get_width(image_data) * gdk_pixbuf_get_height(image_data)); for(i=0; i < array_size; i++) g_print("%d, ", (int) gdk_pixbuf_get_pixels(image_data)[i]); } My assumption was that the guchar pointer returned by gdk_pixbuf_get_pixels() would store the pixel data as an 8 bit int for the R, G and B channels for each pixel. ie. a 2*2 pixel image with 24bit colour would print out the following (assuming the image was white): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, However the following was output: 255, 255, 255, 255, 255, 255, 80, 64, 255, 255, 255, 255, I then output the rowstride for the image which was 8 (bytes per row) which prompted me to hack the code to loop 16 times and got: 255, 255, 255, 255, 255, 255, 80, 64, 255, 255, 255, 255, 255, 255, 0, 0, rowstride: 8 My Question is simply why are there two extra bytes per image row, what do they represent and what is a rowstride? - the documentation assumes this knowledge! I'm using GTK2.0 and redhat 7.3 Cheers ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Can I make a IM Module resident?
Hi, The class I registered is not the im module class, it's another class defined by myself. The im class is registered by g_type_module_register_type(). Regards James Su Sven Neumann wrote: Hi, James Su <[EMAIL PROTECTED]> writes: Recently, I'm developing a IM Module for gtk+-2.x, but I met a problem. Because I registered a new class within my IM Module by g_type_register_static, then when I open a input context the second time, the application crashed. The error message shows can not register a type which already registered. In order to solve this problem, I realized that I must make my IM module resident in the memory to prevent my class being registered twice. you should do what the other input modules do and use g_type_module_register_type() instead of g_type_register_static(). Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: File Descriptor Input
your problem is that standard input is line-buffered, so you only get input when ENTER is pressed. (in the terminal from which you run the program!) I don't know exactly the behavior you want when you "trap the keyboard". if you are writing a gui, you must use X windows (eg gtk_widget_add_events() and connecting to the "key-pressed-event" signal (only works with a toplevel widget!)) if you are writing a ncurses program, there's other functions you must read about in that library... in any event, without special calls to tcsetattr to put stdin in "raw" mode, gdk_input_add( fileno(stdin), ...) is unlikely to be what you want. the reason why no one responds: keyboard handling is a mess, and your question seems vague to someone who knows the answer ;) - dave On Thu, Mar 27, 2003 at 07:40:55PM -0800, Shiraz Baig wrote: > > --- Paul Davis <[EMAIL PROTECTED]> wrote: > > First Point: > > > that's not what it says. it says: > > > > gintgdk_input_add (gint > > source, > > > > GdkInputCondition condition, > > > > GdkInputFunction function, > > gpointer data); > > / Ok, I have now revised it as follows ***/ > > void input_callback( gpointer data, > gint source, > GdkInputCondition condition ) > { > gchar *mesg; > mesg =data; > g_print("Got something.\n"); > } > > main() > . > gint gdk_input_add( fileno(stdin), > GTK_INPUT_READ, > (GtkInputFunction) input_callback, > gpointer data ); > . > > But it still does not invoke that function call. My > purpose is that at least the function be called. Then > I can start thinking of something else. > > Second Point: > - > > you can't do this. if you don't read the data, then > > your function will > > be called again immediately, because there is still > > data to be read. > > I wish, it is called again and again :-) > My problem is that it is not being called at all :-( > > Third point: > --- > > this is completely wrong. i think you need a little > > experience with C programming. > > May be I failed to explain myself. I have been doing > programming in c for last 10 years. In fact, recently, > ,I have written a multi-threaded, multiplexed (stdin > and socket input), multicast application in > transmission of video image with RTP protocol. > So, I hope, I have adequate experience. > > Thanks for bearing with me, and listening to my, may > be foolish questions. > > Bye and I shall wait for your answer. At least you are > responding , others are not. > > bye > > __ > Do you Yahoo!? > Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! > http://platinum.yahoo.com > ___ > gtk-list mailing list > [EMAIL PROTECTED] > http://mail.gnome.org/mailman/listinfo/gtk-list -- ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: method for destroying GtkFileSelection
gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW) or gtk_widget_get_toplevel(widget) they both have thier particularities; http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#gtk-widget-get-toplevel gives a brief description. Cheers, -Tristan Axel wrote: > > Hi > here is the handler I use to destroy a gtkfileselection, when CANCEL > button is pushed > > void cancel(GtkButton *cancel_button) > { > GtkWidget *window; > window=gtk_wifget_get_parent(GTK_WIDGET(cancel_button)); > window=gtk_wifget_get_parent(window); > window=gtk_wifget_get_parent(window); > gtk_widget_destroy(window); > } > > Is there a better way than that? (get the parent widget until you get > the window) > > Axel > > ___ > gtk-app-devel-list mailing list > [EMAIL PROTECTED] > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: question about encoding
On Fri, Mar 28, 2003 at 16:18:48 +0100, Axel wrote: > > > But I don' t know the encodings and strings I can use with that call. > API don' t talk about them > setting encoding of io channel , then read, and then convert to utf 8 > should work > but first I need to know what encoding and string to pass to the > function I can > use to set GIOChannel > Try "iconv --list". I think these are the encodings you can use. If your file just has characters like àé and so on, there's a good chance it's ISO8859-1. Noah ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
problem with the new GTK+2.2.1 compilation after crash
Hi, can somebody help me with this, please? I has been compiling the GTK+2.2.1 from source code following instructions on http://beyond.linuxfromscratch.org/view/cvs/x/gtk2.html *./configure --prefix=/usr --sysconfdir=/etc && make && make install* , but the computer crashed during the make or make install commands. After the reboot, I deleted the gtk src dictory, recreated source tree from the distribution file, but the compilation stopped in this time soon with these message: In file included from ../../gdk/x11/gdkwindow-x11.h:30, from gdkprivate-x11.h:36, from gdkx.h:78, from gdkcolor-x11.c:31: ../../gdk/x11/gdkdrawable-x11.h:69: parse error before "XftDraw" ../../gdk/x11/gdkdrawable-x11.h:69: warning: no semicolon at end of struct or union In file included from gdkprivate-x11.h:36, from gdkx.h:78, from gdkcolor-x11.c:31: ../../gdk/x11/gdkwindow-x11.h:69: field `parent_instance' has incomplete type In file included from gdkprivate-x11.h:37, from gdkx.h:78, from gdkcolor-x11.c:31: ../../gdk/x11/gdkpixmap-x11.h:52: field `parent_instance' has incomplete type make[3]: *** [gdkcolor-x11.lo] Error 1 make[3]: Leaving directory `/usr/src/gtk+-2.2.1/gdk/x11' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/src/gtk+-2.2.1/gdk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/gtk+-2.2.1' make: *** [all-recursive-am] Error 2 So I tried make uninstall, then deleted manually gtk related files in /etc, also some files for pkg-config and something in /usr/lib directory, everything related with the name and the time to the previous uncompleted installation, but without help. What can I try? Thank you for any help, Jiri ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: question about encoding
Hello, On Fri, 2003-03-28 at 06:41, Axel wrote: > hi > I m trying to open and read file which contains accentued characters > like éèùà > so > I open a file, with GIOChannel and read the strings > but what is the function to get the encoding ? > I didn' t found it in API > I have seen call to convert to utf8 but it needs the original encoding > from the string, and I didn' t found how to get it. > Someone could help me ? I don't think that GIOChannel has anything to do with the encoding of a string in a file. To GIOChannel, you are dealing with a file. It really doesn't care what's in it. It's just a bunch of bytes to it. To know what kind strings you are reading from the file. (Or even to know that there are even strings in the file.) You'll have to know something about the type of file you are dealing with. For example, you could be dealing with a MPEG file, a JPEG file, a PNG file, an Intel 80386 native DLL, a UNICODE text file encoded in UTF-16, an XML file, a GNU tar archive, etc. What you probably first need is a way to figure out what type of file you are dealing with. And, if you already know that, then you'll probably need a way to figure out what the data in the file is. (This is file dependent though. GIOChannel is at a much lower level that this... so it wouldn't provide an API for this kind of thing.) Hope that helps. See ya -- Charles Iliya Krempeaux, BSc [EMAIL PROTECTED] Reptile Consulting & Services604-REPTILEhttp://www.reptile.ca/ ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
outdated wrong comment in gtkobject.h?
In gtkobject.h I read the following: /* The GtkObjectClass is the base of the Gtk+ objects classes hierarchy, * it ``inherits'' from the GtkTypeClass by mirroring its fields, which * must always be kept in sync completely. The GtkObjectClass defines * the basic necessities for the object inheritance mechanism to work. */ struct _GtkObjectClass { GObjectClass parent_class; /* Non overridable class methods to set and get per class arguments */ void (*set_arg) (GtkObject *object, GtkArg*arg, guint arg_id); void (*get_arg) (GtkObject *object, GtkArg*arg, guint arg_id); /* The function that will end an objects life time. In one way ore * another all three of them are defined for all objects. If an * object class overrides one of the methods in order to perform class * specific destruction then it must still invoke its superclass' * implementation of the method after it is finished with its * own cleanup. (See the destroy function for GtkWidget for * an example of how to do this). */ void (*destroy) (GtkObject *object); }; The thing is that GtkTypeClass seems to be typedef'd to GTypeClass, which seems to consist of a single GType, which in turn is something like a nsigned integer. So I don't see how it can be true that the fields are being kept in sync. Maybe this is an old comment and no longer correct? Thanks for any explanation you can offer, Britton Kerin __ GNU GPL: "The Source will be with you... always." ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: Newbie in over head -- Marshallers
On Wed, 2003-03-26 at 10:50, Dennie, Brooke wrote: > Hello, > > I need to add a signal to the GtkWidget so that the callback functions will > take two pointers instead of one. i.e. > foo(GtkWidget *widget, gpointer clientdata, gpointer > datastruct){} > > I realize that I need to use gtk_object_class_user_signal_new(), however, I > don't understand how to define a new marshaller for this. The FAQ simply > says "If you want your new signal to have more than the classical gpointer > parameter, you'll have to play with GTK+ marshallers." I'm guessing that I > need to use GtkCallbackMarshal() to define a function, but I can't seem to > find any documentation on what the marshaller functions actually need to do. > > Note: I don't have access to the gtk src code on the machine I'm using yet, > so I can't look there for an example > > Can anyone help me? http://developer.gnome.org/dotplan/porting/ar01s15.html Has information about using glib-genmarshal. Regards, Owen ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: outdated wrong comment in gtkobject.h?
On Fri, 2003-03-28 at 18:12, Britton wrote: > In gtkobject.h I read the following: > > /* The GtkObjectClass is the base of the Gtk+ objects classes hierarchy, > * it ``inherits'' from the GtkTypeClass by mirroring its fields, which > * must always be kept in sync completely. The GtkObjectClass defines > * the basic necessities for the object inheritance mechanism to work. > */ > struct _GtkObjectClass > { > GObjectClass parent_class; > > /* Non overridable class methods to set and get per class arguments */ > void (*set_arg) (GtkObject *object, > GtkArg*arg, > guint arg_id); > void (*get_arg) (GtkObject *object, > GtkArg*arg, > guint arg_id); > > /* The function that will end an objects life time. In one way ore >* another all three of them are defined for all objects. If an >* object class overrides one of the methods in order to perform class >* specific destruction then it must still invoke its superclass' >* implementation of the method after it is finished with its >* own cleanup. (See the destroy function for GtkWidget for >* an example of how to do this). >*/ > void (*destroy) (GtkObject *object); > }; > > The thing is that GtkTypeClass seems to be typedef'd to GTypeClass, which > seems to consist of a single GType, which in turn is something like a > nsigned integer. So I don't see how it can be true that the fields are > being kept in sync. Maybe this is an old comment and no longer correct? > > Thanks for any explanation you can offer, Yes, it's an outdated old comment. If it bothers you, you might want to file a bug in bugzilla.gnome.org (see the GTK+ README for for info about filing bugs) Regards, Owen ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: fork problem
Hi, i think that to work fork function, you need call some other functions of gtk lib. See more about this functions: g_spawn_async_with_pipes , g_thread_pool_new. See this links: http://www.gtk.org/faq/#AEN472 http://www.cryptnet.net/fdp/gtk/exec.html I hope that be very useful. Good luck, Adriano Bonat --- Chan Wai <[EMAIL PROTECTED]> wrote: > I have tried to write a program, which also act as a > server when I run it. > I use gtk/gnome to build an interface for it. > However, when I run it, there is > error on the child programme: > > Gdk-ERROR **: BadIDChoice (invalid resource ID > chosen for this connecion) > serial 30742 error_code 14 request_code 1 > minor_code 0 ___ Yahoo! Mail O melhor e-mail gratuito da internet: 6MB de espaço, antivírus, acesso POP3, filtro contra spam. http://br.mail.yahoo.com/ ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: How is GdkPixbuf pixel data stored?
On Thu, Mar 27, 2003 at 03:36:02PM +0800, Christopher Andrew Chenery wrote: > I then output the rowstride for the image which was 8 (bytes per row) > which prompted me to hack the code to loop 16 times and got: > > 255, 255, 255, 255, 255, 255, 80, 64, 255, 255, 255, 255, 255, 255, 0, 0, > rowstride: 8 > > My Question is simply why are there two extra bytes per image row, what do > they represent and what is a rowstride? - the documentation assumes this > knowledge! Rowstride is simply the width of a row - it's sometimes larger than the actual width for efficiency reasons (to 4-byte-align the rows for example). The extra padding bytes (rowstride - width) contain meaningless data that shouldn't be displayed. Havoc ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: question about encoding
Hi, Axel <[EMAIL PROTECTED]> writes: > Yes but imagine there are some people (me , by example) who have > locales set to "POSIX" and have though files with accentued > characters, this don' t solve problems. as I explained to you already, you can't solve this problem automatically. If all fails, you will have to present the user with a choice of encodings and have him choose the correct one. > so I found that :g_io_channel_set_encoding() > it take in argument the GIOChannel and an encoding, in a string > so passing "UTF8" set a GIOChannel to UTF8, I d like to pass another > encoding you can set the encoding to NULL which will allow you to read in the file. You still need to know the encoding if you want to do something with it later. > but first I need to know what encoding and string to pass to the > function I can use to set GIOChannel as I said, use NULL. If you later want to convert to UTF-8, you can use the GConv API. It is based on iconv and iconv can give you a list of encodings (which might differ on other systems!). Try this on the command-line: 'iconv -l'. Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: question about encoding
Now I understand we pass an encoding to Glib in order to read successfully a file. The encoding avalailable are in iconv -l I needed to understand the concept of locale/encoding and so... It s much clear in my mind after your answers. I will set ISO-8859-15. Thanks all for your help, it sure helps me Regards. Axel ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list