font rendering is different in gtk+ 3

2012-04-19 Thread Luka Napotnik
bold fonts are out of proportion, compared to fonts, rendered with Gtk+ 2. They feel too big and too stretched out. Any ideas how to fix the look of bold fonts or how to customize bold font rendering? Any help would be appreciated. -- Greets, Luka Napotnik, www: http://napotnik

Re: inter process communication

2009-07-10 Thread Luka Napotnik
If you need more advanced IPC, take a look at D-BUS. For basic IPC you could use unix local sockets or shared memory. Greets, Luka Dne 10.07.2009 (pet) ob 09:17 -0500 je Garth's KidStuff zapisal(a): > Hey All, > What's the best way to communicate between 2 applications? And can you > point me to

Re: Strange GHashTable behaviour

2009-04-21 Thread Luka Napotnik
The problem is in the returned value. It returns an invalid pointer instead of NULL. Greets, Luka Dne 21.04.2009 (tor) ob 17:19 +0200 je Vivien Malerba zapisal(a): > > > 2009/4/21 Luka Napotnik > Hello, > > I'm experiencing strange GHashTable

Strange GHashTable behaviour

2009-04-21 Thread Luka Napotnik
Hello, I'm experiencing strange GHashTable behaviours when looking up a value throught a string key. I pass the key as a stack-allocated string to the hash table. For most lookups it works flawlessly but sometimes I get an invalid pointer. It even looks normal but data can't be accessed at that ad

Strange GMutex behaviur

2009-04-09 Thread Luka Napotnik
Hello. I have a thread where the mutex for a GHashTable is locked/unlocked very intensely. It works for a short while but then the thread locks completely and if I profile my program I see that the programs resides in kernel for an unusual long period. Any ideas? Greets, Luka _

Using GIO/GVfs to implement a VFS

2009-03-19 Thread Luka Napotnik
Hello. I'm toying around with GIO/GVfs. I want to create a small VFS for Nautilus that would use my tiny file server. I was looking for a GVfs tutorial but I didn't find any usefull document. And when browsing the GIO API I found a GFileIface structure. It looks I must implement my vfs i/o functi

Re: Using GdkPixbuf buffers with GraphicsMagick

2009-01-07 Thread Luka Napotnik
e); gtk_widget_show_all(window); gtk_main(); return 0; } Hope this helps. Greets, Luka Dne 07.01.2009 (sre) ob 09:23 + je jcup...@gmail.com zapisal(a): > 2009/1/7 Luka Napotnik : > > I've converted the buffer to an RGBA array with 16-bits per channel. But > > load

Re: Using GdkPixbuf buffers with GraphicsMagick

2009-01-07 Thread Luka Napotnik
Hello again. I've converted the buffer to an RGBA array with 16-bits per channel. But loading the blob still fails. Any other ideas? Greets, Luka Dne 06.01.2009 (tor) ob 12:03 + je jcup...@gmail.com zapisal(a): > 2009/1/6 Luka Napotnik : > > I'm trying to use GraphicsMagi

Re: Using GdkPixbuf buffers with GraphicsMagick

2009-01-06 Thread Luka Napotnik
Hum could you please tell me more about gdkpixbuf dithering functions. I was unable to fund such a function. Greets, Luka Dne 06.01.2009 (tor) ob 12:06 + je jcup...@gmail.com zapisal(a): > 2009/1/6 Luka Napotnik : > > Well I need a dither filter for my image buffer. That's w

Re: Using GdkPixbuf buffers with GraphicsMagick

2009-01-06 Thread Luka Napotnik
acts the relevent info from > the pixbuf, it is impossible to say what went wrong. > > In any case you can use any library, e.g. cairo, agg, OpenCV, or > access the pixels straight in the GdkPixbuf. > > Regards, > Dov > > 2009/1/6 Luka Napotnik > Hello. >

Using GdkPixbuf buffers with GraphicsMagick

2009-01-06 Thread Luka Napotnik
Hello. I'm trying to use GraphicsMagic (the successor of ImageMagick) to manipulate a GdkPixbuf image buffer. The problem is that the program segfaults, probably due to the raw nature of the buffer which the Magick API doesn't handle very good. I'm opening the image buffer with MagickReadImageBlob

Accessing PixBuf pixels

2008-12-18 Thread Luka Napotnik
Hello. I have some difficulties with manipulation of pixels in the GdkPixbuf data buffer. I use the following loop to iterate thought each pixel: --- n_channels = gdk_pixbuf_get_n_channels(pixbuf); guchar *pixel; guchar *data = gdk_pixbuf_get_pixels(pixbuf); for (i

program leak because creating new mutexes?

2008-11-26 Thread Luka Napotnik
Hello. I'm having a strange problem with my multi-threaded application. It leaks memory. I've executed it under valgrind and valgrind reports that calls to g_mutex_new_posix_impl() allocates around 22 MB of memory. The thing is that I create around 4 mutexes max. And the longer the program runs,

removing element from GHashTable returns FALSE

2008-11-10 Thread Luka Napotnik
Hello. I'm using a GHashTable to store some structures. The keys are unsigned integers. I create my hash table with: g_hash_table_new(g_direct_hash, NULL); Then I store same values with keys with: g_hash_table_insert(my_hash_table, GUINT_TO_POINTER(3), mystruct); But when I try to remove the v

profiler results don't match

2008-10-22 Thread Luka Napotnik
Hello. I have two systems. One has Ubuntu Hardy installed (gtk+ 2.12.9) and the other Ubuntu Intrepid (gtk+ 2.14.4). I profile my program using oprofile and when I compare results from both systems, I see a big difference that (I think) shouldn't be there. For example, the most consuming function

using gtk+ in a child process

2008-10-13 Thread Luka Napotnik
Hello. I have a GTK+ program that fork()-s and then in the child process initializes a GTK+ widget and uses it. Is that a good thing to do or should I init the GDK subsystem in the fork as well? Greets, Luka ___ gtk-app-devel-list mailing list gtk-app-d

shared memory queue

2008-10-06 Thread Luka Napotnik
Hello. I have a problem that I need an GAsyncQueue shared among multiple processes. If I allocate a structure with shared memory and then allocate the GAsyncQueue with g_async_queue_new() to a structure member, is the queue shared or not? And if not, is there a way to do this? Greets, Luka __

GChecksum assertion failed

2008-08-07 Thread Luka Napotnik
Hello. I have this small example where I create a GChecksum and apply some data. The problem is when I request the digest, the program prints out the following error: (process:8422): GLib-CRITICAL **: g_checksum_get_digest: assertion `*digest_len >= len' failed My GChecksum code is:

returning a string to d-bus

2008-08-04 Thread Luka Napotnik
Hello. I have a D-BUS listener with a GObject method which should send a string back to D-BUS. My d-bus listener method is: gboolean some_object_get_name(GObject *object, gchar *str, GError **error) { str = g_strdup("Hello"); return TRUE; } But when the client connect to this d-b

Problem writing pixels to GdkPixbuf data buffer

2008-07-15 Thread Luka Napotnik
Hello. I encounter a strange problem when I'm writing image data to the GdkPixbuf data buffer. I create an empty pixbuf and get the data buffer. Then I use: pixel = pixbuf_data + i * n_channels , where pixel is a pointer to the pixel, pixbuf_data is the pixbuf data buffer, i is a counter in a f

conversion from RGBA to grayscale

2008-07-04 Thread Luka Napotnik
Hello. I have a RGB pixbuf with 8 bits per color sample with alpha channel. I load an image and now want to convert this RGBA image to grayscale. Is there a gdk function to do that or some other instructions to do that? Please help. Greets, Luka ___ gtk

Drawing data from cairo surface to a pixbuf

2008-06-17 Thread Luka Napotnik
Hello. I have a problem with loading data that I got from an cairo image surface with cairo_image_surface_get_data(). I got the data with: --- long width, height, len; char *data, *data_tmp; data_tmp = cairo_image_surface_get_data(surface); width = cairo_image_surface_

problems saving gdkpixbuf to png image

2008-03-31 Thread Luka Napotnik
Hello. I have a custom widget from GtkDrawingArea and done some cairo drawing. The custom widget is inside a ScrolledWindow because sometimes the whole custom widget is not visible Now I tried to save the contents of that widget to a PNG file. Here's the code: -- private = GTK_

app segfaults when appending text

2007-08-04 Thread Luka Napotnik
Hello In my program I have a TextView which I would like to append some text. When I append 2- to 3-times all is ok but when appending more the program segfaults. Please help. Code: char *msg, *tmp; Glib::ustring chatter; ... std::cout << "Chatting: " << msg << "\n"; cha

Re: drawing to textview's gdk_window

2007-06-08 Thread Luka Napotnik
Jonathan > > On 6/8/07, Luka Napotnik <[EMAIL PROTECTED]> wrote: > I now connected the expose-event signal to a callback function > that > draws a rectangle to the widget. The problem is that the font > is under > the rect

Re: drawing to textview's gdk_window

2007-06-08 Thread Luka Napotnik
I now connected the expose-event signal to a callback function that draws a rectangle to the widget. The problem is that the font is under the rect. if I call g_signal_connect_after() and no text appears if I call g_signal_connect() but the rect is visible. I get the GdkWindow of the textview using

drawing to textview's gdk_window

2007-06-08 Thread Luka Napotnik
Hello. I'm trying to draw a rectangle of a textview's background GdkWindow. First I get the gdk_window of the textview and and then try ot draw on it. But it doesn't work. Why? - #include int main(int argc, char **argv) { GtkWidget *window; GtkWidget *text;

Re: strange segfault in threading

2007-03-14 Thread Luka Napotnik
I fixed this issue by making g_timeout() calls to a function that checks a queue for requests to change the UI. Greets, Luka On sre, 2007-03-14 at 08:40 -0500, Michael Ekstrand wrote: > On Wed, 2007-03-14 at 11:49 +0100, Luka Napotnik wrote: > > while (gtk_event

strange segfault in threading

2007-03-14 Thread Luka Napotnik
Hello. I have a program that has besides the main GUI thread another thread that creates some labels and pack them into a vbox. Before I do GUI stuff in the thread I call gdk_threads_enter() and when I'm done I have while (gtk_events_pending()) gtk_main_iteration(); gdk_threads_leave(); Ther

Re: gtk+ display image

2007-02-24 Thread Luka Napotnik
You have to pack the image widget to a box with gtk_box_pack_* or a container with gtk_container_add(). On pet, 2007-02-23 at 09:08 -0800, lucks wrote: > hi...am a student and am building an interface using gtk for my project...but > am having a problem in displaying an image...if someone could he

seeking in GAsyncQueue

2007-01-30 Thread Luka Napotnik
Is it possible to lock an GAsyncQueue and then go through the elements with g_queue_foreach() for GQueues? If not, how could I seek through the elements in the async queue without popping them out? -- email: [EMAIL PROTECTED] w3:http://luka-napotnik.net __

GtkPlot

2007-01-08 Thread Luka Napotnik
Where can I get a decent example of GtkPlot usage? greets, Luka -- email: [EMAIL PROTECTED] w3:http://luka-napotnik.net ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

moving a window with an event

2006-11-04 Thread Luka Napotnik
Hello. I'm writing a function for the motion-notify-event event for my window (the event is actually emited by the event box). But it simply doesn't work. What's wrong? gboolean window_move_event(GtkWidget *widget, GdkEventMotion *event, gpointer data) { gint cur_x, cur_y, mouse_x, m

window background image problem

2006-11-03 Thread Luka Napotnik
Hello. I have a program which should load a xpm image and put it as the background image of the window. Instead of that, the image blinks for a second and then dissapears when the program is started. What is wrong? The image is just a blue-filled rect. The program: ---

Re: using pipes with g_spawn_command_line_sync

2006-08-23 Thread Luka Napotnik
I expected "1" but got the command itself. And when appending /bin/sh at start, the returned status is != 0 and the output is blank (empty string). On sre, 2006-08-23 at 16:08 -0400, Tristan Van Berkom wrote: > Luka Napotnik wrote: > > Hello. > > > > I

using pipes with g_spawn_command_line_sync

2006-08-23 Thread Luka Napotnik
Hello. I am unable to run a command with g_spawn_command_line_sync() that uses pipes. For example "echo \"bla\" | wc -l" gives the exact output as the command insted "1". Other commands without the pipe execute with no problem. What's the problem? Greets, Luka ___

Re: Sockets in GTK+?

2006-08-20 Thread Luka Napotnik
GTK+ is a graphical library for creating UI's. For socket programming you have to use the Unix socket API. Greets, Luka On ned, 2006-08-20 at 10:18 -0500, n3ck wrote: > Hi every1! > Im was delphi (win) coder for a while but now i use linux as OS. > I really like to code so i choose GTK for build

pthread_t through pthread_self?

2006-08-13 Thread Luka Napotnik
Hello. I'm interested if the function pthread_self() returns a valid pthread_t structure for threads, created with g_thread_new() so the pthread_t can be used with pthread_kill() ? Greets, Luka ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnom

GThread pid_t?

2006-08-10 Thread Luka Napotnik
Hello, I'm trying to use pthread_kill on a GThread but I don't have the pid_t for that thread. How can I get it? Greets, Luka ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: problems with threads in a shared object

2006-08-10 Thread Luka Napotnik
Now there's a simular problem with the shared library. I have a function in the main program that uses mutextes. I call that function in the .so and compile the .so. But when I run the program it quits with an dlopen() error, that was not there before calling the mutex function. So the .so is not

Re: problems with threads in a shared object

2006-08-08 Thread Luka Napotnik
Ok it works now. Seems there was a problem with the functions. On 8/8/06, Luka Napotnik <[EMAIL PROTECTED]> wrote: > > gdb: > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread -1218409552 (LWP 25125)] > 0xb7979e84 in pthread_mutex_lock () from

Re: problems with threads in a shared object

2006-08-08 Thread Luka Napotnik
e mutex is also allocated before used. On 8/8/06, Tristan Van Berkom <[EMAIL PROTECTED]> wrote: > > Luka Napotnik wrote: > > I have a program that imports plugins via dlopen and dlsym(). In those > > plugins I use functions like g_mutex_lock to lock a variable, declared &

problems with threads in a shared object

2006-08-08 Thread Luka Napotnik
I have a program that imports plugins via dlopen and dlsym(). In those plugins I use functions like g_mutex_lock to lock a variable, declared in the main program. But when getting to the mutex function the whole program crashes. The .so library is compiled with: gcc -g -O0 -shared `pkg-config --li

unresponsive when getting stdout via popen

2006-02-25 Thread Luka Napotnik
Hi. I'm writing an app that executes a program with popen(). In a function I'm trying to read the programs output with the following loop: while (!feof(_stdout_)) { /* Get the string*/ } /* set the string to a gtktextview */ I add the function to the main loop with g_idle_add(). But when

Re: some questions, please help

2005-12-10 Thread Luka Napotnik
Another question. Does GTK+ have functions to get the file type via MIME? If not, how can I get that? Greets, Luka ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

some questions, please help

2005-12-10 Thread Luka Napotnik
Hi. I have two questions: 1. How can I determine a treeview column which will GTK+'s search feature (that box that appears when starting to type) search for. 2. In the treeview tutorial (http://scentric.net/tutorial/sec-treeview-col-whole-row.html), there's a way to color a row by making a column

GTK+ threaded program segfaults

2005-11-10 Thread Luka Napotnik
Hi. I'm writing a multithreaded GTK+ program and have a problem. The program segfaults at line: window_main->this = gtk_window_new(GTK_WINDOW_TOPLEVEL); What's wrong here? Greets, Luka The code: #include #include /* The main window's menu i

changing the bg of a widget

2005-08-21 Thread Luka Napotnik
Hello. I'm trying to change the background of a vbox but it doesn't change. I call gtk_widget_modify_bg(window_main->box_main, GTK_STATE_NORMAL, &bgColor) where bgColor is set to white. Why does this not work? I have a GtkImage with an image in the vbox and that's all. If I resize the window, the c

datadir variable

2005-06-22 Thread Luka Napotnik
reets, Luka Napotnik ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

update a row in GtkListStore

2005-06-13 Thread Luka Napotnik
Hello! I get my list selection by: selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); ... The I get the row by: gtk_tree_model_get (model, &iter, 0, &task_id, -1); I have intentions to change the task_id. Is there an update function to store the new value of task_id to the selected ro