Re: [gtkmm] Problem with g_io_channel_read_chars
Martin Schulze wrote: Hi Andrew! I can't find any obvious problems in your code. It would be great if you could patch your program to not use the g_io_channel_* functions. (It should be no problem to use streams, e.g.) I'm asking for this because I initially wrote the signal_io() stuff and didn't test it with remote connections so I can't guarantee that there is no bug in gtkmm at this end. If your problems vanish with the g_io_channel_* functions it will be worth asking the gtk mailing list. g_io_channel_read_chars ( m_pChannel, buffer, sizeof(buffer), rsize, errcode) != G_IO_STATUS_NORMAL) { Yes, you're right, there is nothing wrong with gtkmm, glibmm stuff. Only one thing I would to ask about: show me an example, please, how to use streams to receive/send data from/to sockets, and is there glibmm wrapping for g_io_channel_ functions? I've replaced that with: rsize = recv (m_FileDescriptor, buffer, sizeof(buffer), 0); then got following error when tried to assign buffer to Glib::ustring: (testtcp:25914): glibmm-CRITICAL **: unhandled exception (type Glib::Error) in signal handler: domain: g_convert_error code : 1 what : Invalid byte sequence in conversion input Looks like glib couldn't convert some of received data (russian koi8-r symbols and control sequences) to internal Glib::ustring data format... What is the way to let g_io_channel_read_whatever to drop control sequences (that I am receiving when starting a telnet session) and convert International symbols properly? (g_io_channel_get_encoding() on my channel returns UTF-8 as should) Well, it will be a shame to parse received data myself to drop those symbols that made glib CRITICAL ;(. -Andrew ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
GTK help!!
hola Bueno la duda en este momento es la siguiente se puede crear un menu con barra de desplazamiento. Esto debido a que mi menu tiene muchas opciones y no las veo todas en pantalla. Si alguien me puede indicar como de antemano gracias. gracias por la atencion prestada. _ No olvides nada. Recuerda los cumpleaños, tus citas, tus cenas románticas y todo lo que quieras usando la Agenda personal de Wanadoo.es, desde cualquier lugar conectado a Internet. Visítala en http://www.wanadoo.es/agenda ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: blit'n
Billy Patton wrote: Now I need to speed up my data drawing. I have a configure_event that creates a pixmap and draws it black. I want a black background; It then calls my draw_cell which draws into the pixmap. Within this recursive routine I do gdk_rgb_gc_set_foreground(gc,white); gdk_draw_rectangle (pixmap,gc,FALSE,mcr.ll.x,mcr.ll.y,w,h); and some gdk_rgb_gc_set_foreground(gc,white); gdk_draw_polygon(pixmap,gc,FALSE,gpts,npts); At the end of this function I do a gdk_draw_pixmap(drawing_area-window,gc,pixmap,0,0,0,0,canvas_x,canvas_y); I take it that this is my blitting. Problem is I may call this draw_cell several hundred thousand times. SO this is ver slow. Should this draw_pixmap be placed after the call to draw_cell so that blitting is done only once? My code was originally written for gtk1.??? Hi Billy, I'm not sure, but it sounds like you need to move your drawing to the expose event. - in configure - build your off-screen pixmap - paint your static data into it - in expose - copy the right section of your offscreen pixmap to the display gtk guarantees that you get configure before expose, so everything will be set up by the time you need to paint the screen setting things up like this will make window resize slow, but paints will be very fast. As an alternative, you can do all the painting in expose (ie. no backing pixmap), it won't be much quicker overall, but at least the user will see something happening on the screen while they wait :-) John == Coming soon: Fabric of Vision Dress and Drapery in Painting 19 June - 8 September 2002 For information and tickets: http://www.nationalgallery.org.uk/exhibitions/fabric/ ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: allocation returns -1, -1, 1, 1
Jason Bodnar wrote: On Thu, 6 Jun 2002 20:21:13 -0500 Jason Bodnar [EMAIL PROTECTED] wrote: I'm adding hboxes as needed in a signal handler to hold rows of photo thumbnails. The first hbox which is created before the main loop even starts returns proper numbers from $widget-allocation but hboxes that are added during the signal handler return -1, -1, 1, 1 for x, y, height and width. I'm calling show_all on the hboxes parents to make sure everything gets shown so I guess I need to some how force space to be allocated for the hboxes since that doesn't seem to happen inside the signal handler? $widget-realize() might help you. Unfortunately, that didn't seem to help. If I called realize on the widget before it was packed I got an error about a NULL window which makes sense. If I called realize after it's packed I still got -1, -1, 1, 1. Thanks for your help, Gtk needs to go through the idle loop as well before all the resizing happens. If you connect to configure you'll see the widget receiving it's true size (eventually). John == Coming soon: Fabric of Vision Dress and Drapery in Painting 19 June - 8 September 2002 For information and tickets: http://www.nationalgallery.org.uk/exhibitions/fabric/ ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: More info about signals
Philippe FREMY wrote: 1. All the arguments that are received by the function the signal is connected to are set when connecting the signal, right ? I'm asking this because I am more familiar with Qt where you define the info that your signal is carrying when emitting the signal. Hi Philippe, it's just like Qt (as I understand it). - when a signal is created (ie. the class init function for widgets of type bar tells gtk that instances of bar will be emmitting a signal foo) the widget specifies the number and type of each signal argument. The marshallers do the argument processing for you. All signals have a final client argument which is always a void* and which widget bar has no control over. - when a client connects to a signal, it gives a value for the client pointer, plus a function to connect to - when a signal is emmitted (eg. an instance of widget bar decides that event foo has occurred), bar gives values to gtk_signal_emit() for each of the arguments ... except the client pointer - when a signal is recieved, the client function sees the arguments given by the widget, plus the client value that it specified when it connected. 2. Is it possible to pass more info in the signals than just a pointer ? All the signals I have seen are either signals linked to events or signal without much info embedded in them. What if I want to pass three int and a custom struct in my signal ? Is it what the marshaller are for ? A signal can have any numbner of args of any type, but only one client value. John == Coming soon: Fabric of Vision Dress and Drapery in Painting 19 June - 8 September 2002 For information and tickets: http://www.nationalgallery.org.uk/exhibitions/fabric/ ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Unable to load GTK_MODULES - Applets
Hi, I am involved enhancing the GERD tool ( GUI Regression testing tool ).The GNOME Applets are not loading the GTK_MODULES.I want to attach the GERD module ( GTK_MODULE) with applets.Is there any other way to add a small-modules dynamically with applets?.Any help would be appreciated. Thanks in advance, Santhana **Disclaimer** Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited.
Re: gtk_adjustment_get_value()
Hi, David J. Singer [EMAIL PROTECTED] writes: I've been playing around with Gtk Adjustments and have found some useful examples My problem is, everything works just fine until I try and call gtk_adjustment_get_value(), then it gets weird...! My compilation fails with: undefined reference to `gtk_adjustment_get_value' Why is this!? The call is documented in the Gtk tutorial. I've even seen it mentioned on this list! I'm using Gtk 1.2. Have I missed something *really* obvious...!? yes, you read the tutorial for GTK+-2.0. gtk_adjustment_get_value() is not available in GTK+-1.2. There you need to access the struct member directly, i.e. use GTK_ADJUSTMENT (adj)-value. Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
I18N text (Input methods?)
Hi all, I was wondering if anyone had a basic FAQ/HOWTO/etc on how a program deals with entering i18n text (Asian, non-ASCII, etc, etc). Or perhaps, can you refer me to a program that I could look at/try as an example? As I see it, there are two parts: 1) The program implementation must be prepared for it (Unicode data structures, gdk_im_* calls, etc, etc) 2) The user has to get their text into the program (compose sequences, character selector tools, etc) We're developing mapping software, and already have our own text-rendering mechanisms in place, using a combination of ICU, Freetype, GTK, and a bunch of our own stuff. This works well, once we have the Unicode characters to process. We also have the basic input mechanism in place, whereby be pick up the key presses in the drawing area, get the byte (Should that be bytes?) out (from the GdkEventKey.string), and process it from there. We render it right on the screen in real-time, according to our layout mechanisms (curved, rotated, irregular, etc) Unfortunately, I'm kindof unsure how to proceed from here... I look down at my latin keyboard, knowing that my program will display Chinese (for example), if I only knew how to get the Unicode bytes into it... :-( I've been looking at the GTK Input Methods/Input Context stuff, and a couple of thoughts come to mind: - First, a lot of it seems to be for handling presentation/rendering (especially stuff like GdkICAttr), which I don't think(?) I need, since we're rendering it ourselves. I think I just need to get the Unicode text out of it. - I'm still not sure what the user does to enter their text... (ie What they see/do, can they enter any Unicode text, or only data from their current locale, etc). I know that I can pop-up a dialog, and let the user type their Unicode string into that, and then feed it into the lower-level stuff. However, it'd be nice (if possible) to let them type directly on the screen, as we do with the ASCII/Latin text... Anyways, sorry for the long-windedness of this (This is so long because I don't have the time to make it shorter ;-), but I'm just not sure how to proceed. (It probably doesn't help that I've never worked in foreign language on a computer, so I'm not sure what a user typically does or expects) Thanks for any/all info! Ian [ PS - Ideally, I'd like to be doing this in GTK 1.2, if possible... ] ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: I18N text (Input methods?)
Hi, Ian Britten [EMAIL PROTECTED] writes: [ PS - Ideally, I'd like to be doing this in GTK 1.2, if possible... ] you'd do yourself a favor by using GTK+-2.0 since improving the i18n support has been one of the main design goals of GTK+-2.0. It uses UTF-8 and Unicode all over the place and all text entry fields have a right-click menu that allows the user to choose from the list of available input methods. Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: [gtkmm] Problem with g_io_channel_read_chars
Am Fre, 2002-06-07 um 10.41 schrieb Andrew E. Makeev: Yes, you're right, there is nothing wrong with gtkmm, glibmm stuff. Only one thing I would to ask about: show me an example, please, how to use streams to receive/send data from/to sockets, There is no standardized UNIX file I/O support in the STL, but's fairly easy to implement your own stream buffer for that. Josuttis even has an example in his book The C++ Standard Library. and is there glibmm wrapping for g_io_channel_ functions? No, at least not yet. I'm unsure whether they should be wrapped. If at all, I'll wrap them as STL stream buffer. I've replaced that with: rsize = recv (m_FileDescriptor, buffer, sizeof(buffer), 0); then got following error when tried to assign buffer to Glib::ustring: (testtcp:25914): glibmm-CRITICAL **: unhandled exception (type Glib::Error) in signal handler: domain: g_convert_error code : 1 what : Invalid byte sequence in conversion input This message means a Glib::ConvertError was thrown but never caught in the current signal handler (you can't propagate exceptions through C callbacks). You can catch Glib::ConvertError -- the critical warning just tells you what to catch. However, I doubt this exception occurred because you assigned something to a Glib::ustring. The data you assign to Glib::ustring is assumed to be UTF-8 encoded, so no checking is performed. You aren't using operator() or Glib::convert(), by any chance? What you have to do is something like: Glib::ustring foo = Glib::convert(bar, UTF-8, KOI8-R); Looks like glib couldn't convert some of received data (russian koi8-r symbols and control sequences) to internal Glib::ustring data format... What is the way to let g_io_channel_read_whatever to drop control sequences (that I am receiving when starting a telnet session) and convert International symbols properly? I don't think the control sequences are your problem, since they're ASCII compatible, IIRC. (g_io_channel_get_encoding() on my channel returns UTF-8 as should) It should not. It should rather be koi8-r. Glib cannot guess the encoding to read. Well, it will be a shame to parse received data myself to drop those symbols that made glib CRITICAL ;(. There was nothing critical in glib or glibmm. The critical thing is that you didn't catch an exception, as you should. Anyway, the exception probably occurred because you're doing something wrong in your code. --Daniel ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
gtk help!!!
Bueno la duda en este momento es la siguiente se puede crear un menu con barra de desplazamiento. Esto debido a que mi menu tiene muchas opciones y no las veo todas en pantalla. Si alguien me puede indicar como de antemano gracias. _ No olvides nada. Recuerda los cumpleaños, tus citas, tus cenas románticas y todo lo que quieras usando la Agenda personal de Wanadoo.es, desde cualquier lugar conectado a Internet. Visítala en http://www.wanadoo.es/agenda ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: [gtkmm] Problem with g_io_channel_read_chars
Daniel Elstner wrote: What you have to do is something like: Glib::ustring foo = Glib::convert(bar, UTF-8, KOI8-R); yes, yes, my connection wasn't UTF-8 encoded. I 've tried gchar *ptr = g_locale_to_utf8(in_buff, size, rsize, wsize, error); for my data, and it works well then. I have few questions, though: 1. where is described which encodings are legal to use in Glib::convert? 2. how to determine what is current encoding for your connection, or where it's derived from? 3. if I used g_locale_to_utf8(), should I remove ptr, that it has returned, with g_free()? thanks for all responses -Andrew ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: I18N text (Input methods?)
On 07 Jun 2002 15:24:09 +0200 Sven Neumann [EMAIL PROTECTED] wrote: Ian Britten [EMAIL PROTECTED] writes: [ PS - Ideally, I'd like to be doing this in GTK 1.2, if possible... ] you'd do yourself a favor by using GTK+-2.0 since improving the i18n support has been one of the main design goals of GTK+-2.0. (sigh)... I started to look at porting, but there were so many problems that I've had to delay it until later... :-( It uses UTF-8 and Unicode all over the place and all text entry fields have a right-click menu that allows the user to choose from the list of available input methods. Sorry, but somehow I guess I wasn't clear enough - I'm not using text entry fields (Thus, that benefit would be moot...) Think of a drawing program (like dia, etc), where the text is collected and rendered right in the drawing area/canvas - That's what we're doing. I'm trying to determine if those same techniques can be used to enter Unicode text, and if so, how? Thanks for the suggestion - Any other thoughts? Ian ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: [gtkmm] Problem with g_io_channel_read_chars
Hi, Andrew E. Makeev [EMAIL PROTECTED] writes: 1. where is described which encodings are legal to use in Glib::convert? iconv --list gives you a list of known encodings. Note that this list is not guaranteed to be the same everywhere (depends on the version of iconv). The common encodings should however be available everywhere. 2. how to determine what is current encoding for your connection, or where it's derived from? read the GLib API reference. 3. if I used g_locale_to_utf8(), should I remove ptr, that it has returned, with g_free()? read the GLib API reference. Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: [gtkmm] Problem with g_io_channel_read_chars
Am Fre, 2002-06-07 um 17.23 schrieb Sven Neumann: Andrew E. Makeev [EMAIL PROTECTED] writes: 1. where is described which encodings are legal to use in Glib::convert? iconv --list gives you a list of known encodings. Note that this list is not guaranteed to be the same everywhere (depends on the version of iconv). The common encodings should however be available everywhere. 2. how to determine what is current encoding for your connection, or where it's derived from? read the GLib API reference. I doubt this is mentioned in the GLib API reference. Without explicit charset handling the protocol, you're basically fucked. Hmm. I might be missing something, dunno. 3. if I used g_locale_to_utf8(), should I remove ptr, that it has returned, with g_free()? read the GLib API reference. Or just use Glib::locale_to_utf8() instead. --Daniel ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
GTK, menu
hi, i have a problem, I can create a menu with displacement bar? This because my menu has many options and don't see all them in screen. thanks for the lent attention. _ No olvides nada. Recuerda los cumpleaños, tus citas, tus cenas románticas y todo lo que quieras usando la Agenda personal de Wanadoo.es, desde cualquier lugar conectado a Internet. Visítala en http://www.wanadoo.es/agenda ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Disabling TAB/Arrow key navigation
In Gtk 1.2 the arrow/tab (only the tab key in 2.0) keys are used for global navigation within a container. Is there any way of disabling the use of, especially the arrow keys, for navigation, in a conatiner ? Thanks -Venky ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Re: [gtkmm] Problem with g_io_channel_read_chars
Hi, Daniel Elstner [EMAIL PROTECTED] writes: 2. how to determine what is current encoding for your connection, or where it's derived from? read the GLib API reference. g_io_channel_get_encoding() returns the current encoding of the GIOChannel. Or was the question how to determine what encoding the incoming data has? Salut, Sven ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
tooltips interferes with menu popup
Hi; anyone notice this problem before? The menu.c sample program gives code to pop up a window from the button press callback. If you attach a tooltip to the button, the menu no longer works correctly. Sample code follows: /* example-start menu menu.c */ #include stdio.h #include gtk/gtk.h static gint button_press (GtkWidget *, GdkEvent *); int main( int argc, char *argv[] ) { GtkWidget *window; GtkWidget *menu; GtkWidget *menu_items; GtkWidget *vbox; GtkWidget *button; GtkTooltips *tips ; char buf[128]; int i; gtk_init (argc, argv); tips = gtk_tooltips_new() ; /* create a new window */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_usize (GTK_WIDGET (window), 200, 100); gtk_window_set_title (GTK_WINDOW (window), GTK Menu Test); gtk_signal_connect (GTK_OBJECT (window), delete_event, (GtkSignalFunc) gtk_main_quit, NULL); menu = gtk_menu_new (); for (i = 0; i 3; i++) { sprintf (buf, Test-undermenu - %d, i); menu_items = gtk_menu_item_new_with_label (buf); gtk_menu_append (GTK_MENU (menu), menu_items); gtk_widget_show (menu_items); } /* A vbox to put a menu and a button in: */ vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_widget_show (vbox); /* Create a button to which to attach menu as a popup */ button = gtk_button_new_with_label (press me); gtk_signal_connect_object (GTK_OBJECT (button), event, GTK_SIGNAL_FUNC (button_press), GTK_OBJECT (menu)); gtk_box_pack_end (GTK_BOX (vbox), button, TRUE, TRUE, 2); /* This line breaks the popup menu */ gtk_tooltips_set_tip(tips, button, press this button, NULL) ; gtk_widget_show (button); /* always display the window as the last step so it all splashes on * the screen at once. */ gtk_widget_show (window); gtk_main (); return(0); } /* Respond to a button-press by posting a menu passed in as widget. * * Note that the widget argument is the menu being posted, NOT * the button that was pressed. */ static gint button_press( GtkWidget *widget, GdkEvent *event ) { if (event-type == GDK_BUTTON_PRESS) { GdkEventButton *bevent = (GdkEventButton *) event; gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, bevent-button, bevent-time); /* Tell calling code that we have handled this event; the buck * stops here. */ return TRUE; } /* Tell calling code that we have not handled this event; pass it on. */ return FALSE; } ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
Example complie problem in dev-c++
Hi, I'm trying to compiletheTictactoe example listed at:http://www.gtk.org/tutorial/app-codeexamples.html in Dev-C++ IDE V4.9.3.0, with g++.exe, but got type conversion error always: Building Makefile: "d:tmpMakefile.win"Executing make...make.exe all -f "d:tmpMakefile.win"g++.exe -c test.cpp -o test.o -I"C:Dev-C++include" -I"C:Dev-C++includeg++-3" -I"C:Dev-C++include" -fnative-struct -fsave-memoized -g3 -mwindows test.cpp: In function `long unsigned int tictactoe_get_type()':test.cpp:120: conversion from `int' to `enum GTypeFlags' make.exe: *** [test.o] Error 1 Execution terminated- What's wrong on this conversion? Line 120 is: ttt_type = g_type_register_static (GTK_TYPE_VBOX, "Tictactoe", ttt_info, 0); Thanks in advance! Guidance ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list
ANNOUNCE: GtkGLExt 0.1.1
Hello everyone, GtkGLExt, OpenGL extention to GTK, version 0.1.1 is released. http://sourceforge.net/projects/gtkglext/ This is a minor bug fix release. The following bugs have been fixed. * SIGSEGV was arised with applications uses modal window. * Win32 GLPixmap problem that the displayed image was mirrored about y-axis. Now, Win32 GLPixmap works correctly. Could you please try it and tell me your comments? General Information === GtkGLExt is an OpenGL extention to GTK 2.0 or later. This package is composed of GdkGLExt library and GtkGLExt library. GdkGLExt library includes low-level OpenGL related objects, GdkGLConfig, GdkGLContext, GdkGLDrawable, GdkGLWindow, and so on, which has GLX like interface. GtkGLExt library includes high-level gtk_widget API extentions using GdkGLExt, which extends *ANY* GTK+ widget to an OpenGL-capable widget. The objects included in these libraries are implemented using C and fully compliant with GLib's GObject and it's latest features. The official web site is: http://gtkglext.sourceforge.net/ The official download development information site is: http://sourceforge.net/projects/gtkglext/ Supported Platforms === Currently GtkGLExt supports * UNIX platforms Tested on Linux (RedHat 7.2) and IRIX (6.5). * Win32 platforms Tested on Windows XP 2000 Professional using MinGW + Cygwin environment. Thank you, -- Naofumi Yasufuku [EMAIL PROTECTED] The best way to predict the future is to invent it. -- Alan Kay ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list