Re: Combobox Focus Challenge!!!

2005-09-01 Thread Jan-Marek Glogowski
Hi Maybe someone should extend the API docs or add a FAQ: gtk_widget_grab_focus( GTK_BIN(combo)-child ); Jan-Marek ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Getting workspace number?

2005-08-18 Thread Jan-Marek Glogowski
Hi I would like to write a command line application that outputs the current workspace (under GNOME, I had someting in WindowMaker, but this does not work in GNOME). I have tried the following: ... All workspace stuff depends on the window manager, so I guess for GNOME you have to check the

Re: Cannot hide dialog until signal handler exits

2005-08-18 Thread Jan-Marek Glogowski
Hi The signal handler for a button in my main window launches a file chooser dialog, then processes the selected files. I try to hide the dialog during processing with 'gtk_widget_hide (dialog);' but this does not take effect until the signal handler exits. Is there a way to hide the dialog

Re: [GtkMenu] Callback problem with popups submenus

2005-08-18 Thread Jan-Marek Glogowski
Hi Emmanuel For me it works as expected. I just added a gtk_main(), a gtk_init(...) and a print()-callback and it works (on Debian Sarge gtk+ 2.6.4) For gtk_menu_popup I used ..., 0, gtk_get_current_event_time()); Maybe something else is wrong in your code? Jan-Marek

Re: g_signal_emit_by_name

2005-08-18 Thread Jan-Marek Glogowski
Hi snip a lot of code You're misunderstanding the _emit_ functions. They are supposed to be used inside GObjects to run their attached signal handlers. So a soluting would be: gboolean your_old_code(...) { return FALSE; // destroy return TRUE; // do not destroy } gboolean

Re: Can a GtkHandleBox be made transient?

2005-07-21 Thread Jan-Marek Glogowski
Is there any reason that windows created by GtkHandleBox aren't transient by default? This is the behaviour I would expect. Different people expect different behaviour... Is there a simple way to make them transient? I think a GtkHandleBox has its own GdkWindow, so just use

Re: Discarding key pressed events.

2005-07-21 Thread Jan-Marek Glogowski
How to avoid this? maybe i could delete the keys' event from the events queue? Any help? Actually I did a workaround for this problem: ... The problem actually is that I cant call set_events on a widget which is already realized, and I am get a lot of warnings indeed. So, my problem is

Re: 100 Different Colors

2005-06-24 Thread Jan-Marek Glogowski
FYI - I just came up with the this example to illustrate a way to change the colors in a loop - it doesn't represent the solution! Algo is still: r = max, g = 0, b = 0 r = max , g = max, b = 0 r = 0, g = max, b = 0 r = 0, g = max, b = max r = 0, g = 0, b = max r = max, g = 0, b = max back to step

Re: GtkTreeView issues (porting from GtkCList)

2005-06-24 Thread Jan-Marek Glogowski
Please start a new thread next time. 1) There is a way to set the root of the tree? Maybe gtk_tree_store_append( store, new_row, NULL ); 2) There is a way to select when a node will be a leaf or a node? ? There are no leafs - a leaf is a node without children: gtk_tree_model_iter_has_child

Re: 100 Different Colors

2005-06-24 Thread Jan-Marek Glogowski
Thanks Jan-Marek and everyone else who replied. The suggestions have been really helpful. I'm making some progress. But I didn't know I had to deal with hue/saturation/intensity stuff for this. I searched but couldn't find any documentation for gtk_hsv_to_rgb()?? One website (pretty old

Re: GtkTreeView issues (porting from GtkCList)

2005-06-24 Thread Jan-Marek Glogowski
Ok ok! However it doesn't work on my situation. What I am trying to do is something similar a bookmark. Then it has a root folder: Bookmark (that cotain all the folders and url's); and it has the url's (that are the 'leafs'). One requirement is I may move the folders and url's. So I need a

Re: 100 Different Colors

2005-06-21 Thread Jan-Marek Glogowski
Hi I need to create 100 little squares and each of them has to be a different color. They can't just be a random color: they have to follow the colors of the standard color spectrum/palette. For example, the first one is dark blue, then lighter blue, ... , green, ... , red. Std. color

Re: GtkTreeView issues (porting from GtkCList)

2005-06-14 Thread Jan-Marek Glogowski
Hi Yury Yury Aliaev wrote: 2) When pressing the left mouse button and moving the cursor vertically the selection in GtkCList follow the cursor. In GtkTreeView -- not. How can I obtain in GtkTreeView the same behavior as in GtkCList? Not the same problem, but you may be able to adapt my

Re: Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed?

2004-11-21 Thread Jan-Marek Glogowski
Hi Egon This is a hack, but I it should work: static void combo_toggle_func( GtkToggleButton *togglebutton, gpointer user_data ) { // Do your menu stuff } static void scan_children( GtkWidget *w, gpointer data ) { if( GTK_IS_TOGGLE_BUTTON( w ) ) {

Re: Accessing GtkComboBoxEntry's toggle button

2004-11-21 Thread Jan-Marek Glogowski
Hi Look for the subject Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed? (21. Nov) Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list

Re: Problem in displaying Dialog

2004-11-21 Thread Jan-Marek Glogowski
Hi GtkWindow *my_app ... GtkWindow *my_about ... gtk_window_set_transient_for( my_about, my_app ); gtk_window_set_position( my_about, GTK_WIN_POS_CENTER_ON_PARENT ); HTH Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED]

Re: Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed?

2004-11-21 Thread Jan-Marek Glogowski
Just checked the source for 2.4.13 and 2.5.5. Both use a GtkToggleButton... Check the following scan function - should print a list of found object types: static void scan_children( GtkWidget *w, gpointer data ) { g_print( %s\n, G_OBJECT_TYPE_NAME( w ) ); } For me it finds:

Re: columned list

2004-11-21 Thread Jan-Marek Glogowski
Hi The idea is to emulate the mouse behaviour. If you have a large list you can scroll with the mouse, without selecting an item. Same with the cursor: you scroll the list (change focus) and then select an item (press space). To move the selection with the focus: gtk_clist_set_selection_mode(

Re: Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed?

2004-11-21 Thread Jan-Marek Glogowski
I checked my program with 2.5.5. And had a look at the ComboBox code: the toggle button is created when setting the style, so I think the box must be (at least) realized, maybe even shown. HTH Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED]

Re: Which signal is emitted when the arrow in GtkComboBoxEntry() is pressed?

2004-11-21 Thread Jan-Marek Glogowski
Hi I added a patch for a popup event to my first reply. I wanted to file a bug report, but didn't really come up with a good case. There was a similar request a few days ago: Accessing GtkComboBoxEntry's toggle button. The patch is very simple - just two gtk_signal_emit, a return value to

Re: Xlib: unexpected async reply

2004-11-04 Thread Jan-Marek Glogowski
Hi Try gdk_threads_enter() // do your gdk / gtk calls // Process pending events of the main loop while( gtk_events_pending() ) gtk_main_iteration(); gdk_threads_leave() If you still get Xlib async errors, there are some more unprotected gtk / gdk calls or you found a real bug... If

Re: show/hide widgets

2004-10-14 Thread Jan-Marek Glogowski
Gtk isn't thread safe, but thread aware: See Gdk Docs - Threads. Basically you have to use gdk_threads_init() ... gdk_threads_enter() gtk_main() gdk_threads_leave() ... Before every call from a thread to Gdk / Gtk+ you have to get the Gdk lock via gdk_threads_enter() HTH Jan-Marek

Re: MS style combobox

2004-09-04 Thread Jan-Marek Glogowski
Hi GtkEntry *entry = GTK_BIN(my_gtk_combo_box_entry)-child; GtkEntryCompletition *completion = gtk_entry_completion_new (); gtk_entry_set_completion (GTK_ENTRY (entry), completion); See the GtkEntryCompletition API. HTH Jan-Marek ___ gtk-list mailing

Re: Problems with changed signal on GtkTextBuffer(Win32)

2004-08-24 Thread Jan-Marek Glogowski
There is a Win32 port of devhelp in cygnome2 - maybe worth looking at http://cygnome2.sourceforge.net/ HTH Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list

Re: cannot use clock() for realtime graphical simulations

2004-08-15 Thread Jan-Marek Glogowski
Hi From the Glib docs: Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given

Re: How to hide the window cross and force a window to be first displayed ?

2004-08-12 Thread Jan-Marek Glogowski
Hi I don't think it's possible to hide just the close button. At the end all depends on the window manager. Anyway connecting to the delete-event is the right way. There is however: gtk_window_set_decorated () and gdk_window_set_decorations () HTH Jan-Marek

Re: Split gtk program into separate C files?

2004-08-12 Thread Jan-Marek Glogowski
Yes My normal template looks like this: /* This is my licence text (GPL / LGPL / whatever) **/ #ifndef __MY_HEADER_H__ #define __MY_HEADER_H__ #include glib.h // To allow usage of c by c++ G_BEGIN_DECLS void CloseTheApp (); G_END_DECLS #endif // __MY_HEADER_H__ HTH Jan-Marek

Re: Sizing Combo Box

2004-08-11 Thread Jan-Marek Glogowski
Hi There is neither a way in the deprecated GtkCombo nor a way in the current GtkComboBox - if you meant to set the the maximum allowed length of the contents of the widget use: gtk_entry_set_max_length via GTK_COMBO(widget)-entry or GTK_BIN(GTK_COMBO_BOX(widget))-child Jan-Marek

Re: Getting correct size after placing widget in parent

2004-08-06 Thread Jan-Marek Glogowski
Does gtk_widget_realize() help? Jan-Marek k ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list

Re: Getting correct size after placing widget in parent

2004-08-06 Thread Jan-Marek Glogowski
Any reason not to g_signal_connect_after the childs size-allocate signal and continue your stuff? Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list

Re: g_signal_connect question

2004-08-04 Thread Jan-Marek Glogowski
Hi 1. clicked callback: void user_function( GtkButton *button, gpointer user_data ); for yor example: void user_function( GtkButton *button, struct args *p ); 2. You can't pass local variables: struct args *p = g_malloc( sizeof( *p ) ); p-numdice = 1; p-sides = 10;

Re: problem due to clash between signals and events

2004-08-02 Thread Jan-Marek Glogowski
Hi Most event handlers return a gboolean. From the Docs: Returns : TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further. HTH Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED]

Re: GtkIconTheme in gtk2-2.2.4

2004-07-24 Thread Jan-Marek Glogowski
GtkIconTheme was introduced in Gtk+ 2.4 (if you look at the function descriptions of the Gtk+ docs, you can find a 'Since 2.4'). New features are introduced in new minor versions, revisions (micro versions) are for bug fixes. Maybe it's possible to substitute GtkIconTheme by creating new stock

Re: gtk++ 2.4.4 install: I can not configure for gtk+2.4.4

2004-07-24 Thread Jan-Marek Glogowski
These errors normally come from old X versions (usually also missing xrender). Seems that the Xft backend wasn't build by Pango, so check your Pango config / install. Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED]

Re: TreeViewColumn and right-click

2004-07-23 Thread Jan-Marek Glogowski
Hi Just two ideas: Have you tried to connect a handler to the clicked / button-press-event of my_column-button or replace the header using gtk_tree_view_column_set_widget()? HTH Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED]

Re: gdk_draw_drawable

2004-07-05 Thread Jan-Marek Glogowski
Quoting the GDK Docs: gdk_draw_drawable (GdkDrawable *drawable, GdkGC *gc, GdkDrawable *src, ...) src : the source GdkDrawable, which may be the same as drawable Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED]

Re: Newbie Q: What to use ...

2004-07-03 Thread Jan-Marek Glogowski
Hi From my first impression I think you can simply use a GtkDrawingArea and GdkPixmap(s). Look at GDK Docs - Drawing Primitives, if you want to move from X to GDK. 1) Stick with Xlib primitives for displaying ants ? OK, but I can't see which kind of widget that will allow me to use XLib

Re: GTKDrawingArea and GtkLabel

2004-07-03 Thread Jan-Marek Glogowski
Hi Putting a GtkLabel inside a GtkDrawingArea doesn't make sense to me... If you want to draw text look at pango: Pango docs - Basic Pango Interfaces - Layout Objects - PangoLayout. GDK docs - Drawing Primitives - gdk_draw_layout HTH Jan-Marek ___

Re: Windows, shareware and GTK

2004-06-26 Thread Jan-Marek Glogowski
There has been a thread like this just a few days ago in gtk-app-devel (Releasing software with a GTK front end) Search the archive Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list

Re: GtkTextBuffer:Compare text with those from GtkEntry

2004-06-26 Thread Jan-Marek Glogowski
Hi xiangbing I'm not sure what your problem is. UTF-8 is the encoding, so you don't need to look for it - str(n)cmp should be sufficient to compare them (that's why it's called Unicode ;-). If you want to convert text from / to any encoding -- UTF-8 you have store the previous encoding. If you

Re: How to create a scrolled text window with GTK 2.x?

2004-06-21 Thread Jan-Marek Glogowski
Untested, but an other idea: // Maybe not needed gtk_text_buffer_get_end_iter( buffer, iter ); gtk_text_buffer_place_cursor( buffer, iter ); // Ok - get insert mark mark = gtk_text_buffer_get_insert( buffer ); // Move insert into the bottom right gtk_text_view_scroll_to_mark( view, mark, 0.0,

Re: Writing science application to visualisate physical process. Need help.

2004-06-21 Thread Jan-Marek Glogowski
Well. I understand. But is the return value of my_idle function the only mechanism to stop calling it? Can I set some timer to call idle function one time per call_period? g_timeout_add Just to understand what I am doing: The gdk_draw function used instead of gtk_* because the drawing area

Re: Writing science application to visualisate physical process. Need help.

2004-06-20 Thread Jan-Marek Glogowski
Hi If you want to use static images and want to move them, look at the gdk-pixbuf API. For an examples see the gtk+ source (demos/gtk-demo). GtkImage should be used for static images, GtkDrawingArea for dynamic ones (like your movie). There isn't enought code to say what's wrong. If you code is

Re: How to create a scrolled text window with GTK 2.x?

2004-06-19 Thread Jan-Marek Glogowski
Hi I have also tried this: GtkWidget* textWindow = gtk_text_view_new(); GtkWidget* scrolledTextWindow = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledTextWindow), GTK_POLICY_NEVER,

Re: how to put image as background of window

2004-06-19 Thread Jan-Marek Glogowski
Hi To set a background image use: gdk_window_set_back_pixmap At ftp://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf you can find the old pixbuf code for gtk+ v1.2. This can handle image loading, drawing, scaling etc. Take a look at the API at http://developer.gnome.org/doc/API/gdk-pixbuf/

Re: dependecies

2004-06-15 Thread Jan-Marek Glogowski
Hi Normally render and xft are included in the XFree distribution. I'm not sure but I think you need at least XFree / Xorg = 4.3. So look for an X update, which should solve your problems (at least when you use Gtk+ on Linux). And remember to install the corresponding development packages. HTH

Re: Errors using option menus

2004-06-15 Thread Jan-Marek Glogowski
Hi GtkItemFactory has been deprecated in favour of GtkUIManager. Seems to be a Gtk+ error. I'm not sure how to fix it properly. In gtk_item_factory.c:329 we add the menu root, without a path, which fails as an accel path, when we have a menu with an activate signal. Please file a bug report.

Re: installing gtk

2004-06-15 Thread Jan-Marek Glogowski
Hi Please post the error message... Where did you install glib to? Is there an old version installed? Maybe you need to set the PKG_CONFIG_PATH, like export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig? Jan-Marek ___ gtk-list mailing list [EMAIL

Re: gtk_timeout_add

2004-05-25 Thread Jan-Marek Glogowski
Hi Zbigniew It's not clear, what you want to do. I guess it's the common problem to keep the GUI up to date from a complex callback. 1. If you are using Gtk+ = 2.x use g_idle_* or g_timeout_*. 2. Neither idle nor timeout uses threads. They attach their funtions to the main loop. When

Re: Calculating bounding boxes for rendered fonts

2004-05-25 Thread Jan-Marek Glogowski
Hi Ian Have you really rendered the font? I just checked with my application and everything works as expected when changing the font via font name. (Gtk+ 2.4.1 et al). I'm using the following code: desc = pango_font_description_from_string(font_str); if (desc != NULL) { old_desc =

Re: SCALE Pixmap

2004-05-21 Thread Jan-Marek Glogowski
Hi I'm not sure, what you intend to do. Scaling can be done via pixbufs i.e. gdk_pixbuf_new_from_file - gdk_pixbuf_scale - gtk_image_new_from_pixbuf HTH Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED]

Re: Help removing GtkListStore rows

2004-05-04 Thread Jan-Marek Glogowski
On Sun, 2004-05-02 at 05:09, Jan-Marek Glogowski wrote: Hi 1. You have a memory leak: The string from gtk_tree_path_to_string must be g_free()'d. No, he did that with: gtk_tree_path_free (path); From the GTK+ docs: gchar* gtk_tree_path_to_string (GtkTreePath *path); Generates

Re: (no subject)

2004-05-01 Thread Jan-Marek Glogowski
Hi For some reason you don't seem to have a valid libgdk-x11, which should have been installed with gtk. objdump -T /usr/lib/libgdk-*.so | grep gdk_threads_lock should show a Base entry for gdk_threads_lock like: 0006655c gDO .bss 0004 Basegdk_threads_lock It's also

Re: shell in GTk+ programing

2004-04-15 Thread Jan-Marek Glogowski
Hi If you just want to start processes, and are using glib 2.x look at g_spawn_* (docs: GLib Utilities - Spawning Processes) HTH Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list

Re: Reading from a GtkComboBox created with ..._new_text()

2004-04-04 Thread Jan-Marek Glogowski
Hi Internally the GtkComboBox created with gtk_combo_box_new_text() uses a GtkListStore as it's TreeModel. Just call gtk_combo_box_get_model() to get it. I would like to loop around all items in the combo. model = gtk_combo_box_get_model( combo ); if( ! gtk_tree_model_get_iter_first( model,

How to create a bitmap mask from a pixmap?

2003-09-30 Thread Jan-Marek Glogowski
Hi I want to create a shaped window from a pango rendered text line. How can I create a bitmap for this line from the pixmap, which I can pass to gdk_window_shape_combine_mask ? Thanks Jan-Marek ___ gtk-list mailing list [EMAIL PROTECTED]

Re: GtkText GtkTextView

2001-07-25 Thread Jan-Marek Glogowski
Hi Filipe What is the best (i.e. fastest) way to clear GtkText? For the moment I am using gtk_text_set_point(GTK_TEXT(widget), 0); gtk_text_forward_delete(GTK_TEXT(widget), (guint) gtk_text_get_length(GTK_TEXT(widget))); This seems to be ok (I don't know an

Re: updating gtk_progress_bar

2001-07-22 Thread Jan-Marek Glogowski
Hi Jordi I don't see how the progress bar grows. Only I see, first an empty value and then the full value. What I must do to update the value of the progress bar and see how it grows with every record ?? The code is ok I think. The question is how did you create your progress bar ? There

Re: A struct crazy

2001-07-20 Thread Jan-Marek Glogowski
Hi Miguel typedef struct{ GtkWidget *item_code; gchar *query; } data_gtk; gint intro_data_1(GtkWidget *box, gchar *query , gchar *item){ GtkWidget *botton; GtkTooltips *label; data_gtk_1 enters; enters is freed at the end of the funtion (local var). Use something like

Re: clist text entry

2001-07-18 Thread Jan-Marek Glogowski
Hi Castelo How I want to grab data from clist(when clicked on it) and display it into gtkentry.. anyone.. any idea? Do you want to display data, which is connected to the cell objects or the text of the item? Here comes the code for the text: Somewhere where you construct your dialog

Re: help

2001-07-10 Thread Jan-Marek Glogowski
Hi Rolf [schnipp] anywhere on the net, as to how to solve it I would like to be able to read and write individual pixel colour values to and from an image file on linux. [schnapp] I'm not sure what / how you want to manipulate an image. Do you want to use a script to automate things? Do you

Re: Problems with window position, virtual desktops and fonts

2001-07-02 Thread Jan-Marek Glogowski
Hi John 1. Positioning of windows I use gdk_window_get_root_origin() and gtk_widget_set_uposition(). Works 2. Show / Hide a window on the same virtual desktop Good question, but I can't help :-( I started to connect nearly every signal to a funtion to gain knowledge about the order

Problems with window position, virtual desktops and fonts

2001-07-01 Thread Jan-Marek Glogowski
50 fonts. Thanks Jan-Marek Glogowski ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo/gtk-list