XInitThreads() locking up my GTK app !?!?!

2003-02-11 Thread David J. Topper
Well, I hope this isn't a show stopper. I need XInitThreads() to be able to fire off a separate video (v4l) object to monitor video input. But when I put it in my GTk application, it freezes up any time I try to enter text into a text box. I'm also using g_threads_init and gdk_threads_enter ..

How to pass data to GtkItemFactory callback function?

2002-11-06 Thread David J. Topper
Hello, I'm using the simple method for the GtkItemFactory. Namely: GtkItemFactoryEntry menu_items[] = { { "/_File", NULL, NULL, 0, "" }, { "/File/_Open","O", open_file, 0, NULL }, and so on. But I don't see how I can place a data pointer into this structure as I c

How to draw a vertical line on a gtk_curve?

2002-08-09 Thread David J. Topper
I'd like to have a vertical line scroll from Left to Right on a gtk_curve. I can probably figure out how to do the movement, but I don't see exactly how to draw the line. Thanks, DT ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/ma

NULL text entries?

2001-11-14 Thread David J. Topper
Hi folks, I'm trying to set up text entry boxes that are empty. Unfortunately, when I create one as such, I get the following error: Gtk-CRITICAL **: file gtkentry.c: line 398 (gtk_entry_set_text): assertion `text != NULL' failed. It's not a show stopper, but I'd rather avoid it. Isn't there

gtk_timeout_change() solution

2001-10-29 Thread David J. Topper
Hi folks, Ok, this works. It doesn't solve problems with using the GUI event scheulder, but I'll take it for now. Basically, I have my function return FALSE, which terminates the current "timer." But before doing that, I have it set a timer with the current interval value. Makes nice smooth t

Re: gtk_timeout_change()?

2001-10-29 Thread David J. Topper
Paul Davis wrote: > yes, this makes sense, but its still a bad practice to use the GUI > event loop to deliver precisely timed events. you'd be much better off > using sigitimer(), although alas the obvious method is to use > sigitimer and threads, and thats a problematic area (pthreads + POSIX >

Re: gtk_timeout_change()?

2001-10-29 Thread David J. Topper
Hi folks, Well, at least I know what's possible. The problem I'm having isn't because of GUI latency or anything like that. It's due to the nature of gtk_timeout_add() and gtk_timeout_remove(). It's a different paradigm. If I have a timeout pulsing every 0.3 seconds, then change that to somet

Re: gtk_timeout_change()?

2001-10-29 Thread David J. Topper
Havoc Pennington wrote: > There isn't a way to change it, other than add/remove. The add/remove > should work fine though, it's only a couple more lines of code to > type. It does "work" just not smoothly. Basically, I'm working on a simple audio app. where I use gtk_timeout_add() to trigger a

gtk_timeout_change()?

2001-10-28 Thread David J. Topper
Is there something like this? I tried but don't see it. It would come in a lot more handy than having to remove the timeout, then set it again. A good example is a timer linked to a slider. The timer doesn't get updated until the slider motion stops. Imagine an app that simply had a flashing

Clist auto-scroll solved

2001-07-22 Thread David J. Topper
Sorry folks. I didn't notice clist_moveto. Works great. Bravi. DT -- Technical Director - Virginia Center for Computer Music http://www.virginia.edu/music/vccm.html ___ gtk-list mailing list [EMAIL PROTECTED] http://mail.gnome.org/mailman/listinfo

How to "auto-select" in CList

2001-07-22 Thread David J. Topper
I'm trying to automatically scroll down a CList. Simply moving the selection with: gtk_clist_select_row() doesn't do it. I've also tried linking with: gtk_scrolled_window_set_vadjustment() but have had no luck. Is it possible? Are there some examples? What would be great is if I

Re: How to move to next GTK_ENTRY

2001-07-19 Thread David J. Topper
Hey Havoc, I tried the gtk_grab_focus and still no dice. It really *should* work. The object in question is actually a large gtk_box, with a row of frames, inside each of which is a gtk_entry. Just doesn't work ... DT -- Technical Director - Virginia Center for Computer Music http://www.virgin

How to move to next GTK_ENTRY

2001-07-18 Thread David J. Topper
I've got a chain of gtk_entrys that I want to advance between when I hit tab. I've almost got it working, but all the following does is select text ... it does not allow me to edit. I have to manually click the mouse. ? void cb_move_next (GtkWidget *text, GdkEventKey *event, signal_object *s_o

IT'S ALL GOOD!!!!

2001-07-05 Thread David J. Topper
I've said it before, and I'll say it again. This list rocks! So do all like it, and all things remotely resembling it. The net ... in its best, truest, most noble, free, open, ass kicking, bug crunching form! Specifically, I have to thank Havoc and Owen for some recent (good) advice. Their in

Re: questions on gtk

2001-07-05 Thread David J. Topper
sumith chitanand wrote: > 1.i have the mouse pointer position. how do I draw a widget at this position or how >can I insert text at that point? You need to look into the Gnome or Gtk Canvas. The latter is a "hack" of the former which I actually have had better luck with. It gets a bit compli

Re: Transmit an array to a function

2001-07-05 Thread David J. Topper
Hey folks, Since I've been getting so much from this list I thought I'd try and give back. My observations on signal_connect have been: 1. It doesn't like large pointers. I've had trouble passing in (double *) from time to time. 2. It is very sensitive to typecasting. Make sure you've got

Re: Window destroy = program crash? (aside)

2001-07-05 Thread David J. Topper
So I just took out my gtk_widget_destroy() of the dialog window when "ok" is pressed. Things seem to work fine until I actually hit "cancel" which deletes the window. Then the malloc hooks kick in. I get an additional message of an invalid pointer to free() when setting MALLOC_CHECK_=3. But th

Re: Window destroy = program crash?

2001-07-05 Thread David J. Topper
Owen Taylor wrote: > When set, GNU libc writes some extra information around memory blocks and > checks it on free() so that it can detect double frees and some other forms of > memory corruption. > > Now, this might be coincidental memory corruption elsewhere in > your app (in which case you mig

Re: Window destroy = program crash?

2001-07-05 Thread David J. Topper
Owen Taylor wrote: > Segfault in free == memory corruption somewhere else in > your app. It's most likely a double free - to catch that > on Linux, try: > > $ gdb myprog > (gdb) set env MALLOC_CHECK_=2 > (gdb) r Hey, thanks a bunch. That seems useful. I at least get a halt right away, but n

Window destroy = program crash?

2001-07-05 Thread David J. Topper
Hi folks, I seem to be getting strange crashes in my app, back tracing shows a long list of gtk function calls ... which do not help me debug. Here's a brief snippet: #0 0x40318c00 in free () from /lib/libc.so.6 #1 0x40318a9b in free () from /lib/libc.so.6 #2 0x40174855 in g_free (mem=0x809a

Re: GtkWidget allocation/requisition width/height broken?

2001-07-05 Thread David J. Topper
Havoc Pennington wrote: > They're in pixels. However widget->allocation is only filled in when > the widget actually goes through the request/allocate process, it > isn't magically kept up-to-date at all times. It would seem to make sense to have this happen when gtk_widget_show() is called, no?

GtkWidget allocation/requisition width/height broken?

2001-07-05 Thread David J. Topper
Hi folks, I'm trying to get size data on widgets to pass along to canvas routines. But when I print out GtkWidget->allocation.width, etc ... I get numbers like 0 and 1 only. What units are these? Or is this broken in GTK 1.2.8? DT -- Technical Director - Virginia Center for Computer Music htt

How to set gtk_entry size?

2001-06-28 Thread David J. Topper
Hi folks, I'm creating a small window that takes in parameters for the creation of objects on the fly. So I'm using a bunch of gtk_entrys to grab those settings. But I seem unable to control the actual (physical) width of these entries. Using gtk_entry_max_length() has no effect on that. I *g

Signal help needed (gtk_signal_new?)

2001-06-21 Thread David J. Topper
Hi all, I've gotten some feedback on this, but still need help. From what I gather, signals are specific to types. So a gtk adjustment, for example, has two signals associated with it: "changed" and "value changed". Fine. I've been looking for another kind of signal, perhaps rarely used, or

Re: How to keep (force) window focus?

2001-06-21 Thread David J. Topper
Havoc Pennington wrote: > "David J. Topper" <[EMAIL PROTECTED]> writes: > > > > I mean a window, they are GtkWindows, not popups. I'm using them to get > > parameters for items created on the fly (eg., length, width, height) and > > I don't w

Re: Creating GdkEvents?

2001-06-11 Thread David J. Topper
Jeroen Benckhuijsen wrote: > > I don't think you want GdkEvents. Most (or all) of them are translations > of X Window Events, like an event to redraw a window, resize it, move a > mouse, etc, etc. You're correct. Signals are what I really want. But I'm unable to find a list on the Gnome pages.

Re: How to keep (force) window focus?

2001-06-11 Thread David J. Topper
Havoc Pennington wrote: > > "David J. Topper" <[EMAIL PROTECTED]> writes: > > > > Is there a way for me to force a window to remain in focus? I've got > > some popup windows on a canvas, that of course drop to back when focus > > moves off

Creating GdkEvents?

2001-06-11 Thread David J. Topper
Hi folks, I'm having some trouble sending events around CanvasItems and GtkAdjustments. I'm thinking I need to create a new event type, something like "activate" or "trigger_my_event." But the functions listed to do that seem a bit heavy for my used (eg., # of bytes for function() pointer?). W

How to keep (force) window focus?

2001-06-08 Thread David J. Topper
Hi folks, Is there a way for me to force a window to remain in focus? I've got some popup windows on a canvas, that of course drop to back when focus moves off them. I'm looking for an easy way to force them to remain on top. Thanks, Dave Topper -- Technical Director - Virginia Center for Com

How to get widget size?

2001-05-22 Thread David J. Topper
I'm packing widgets into GnomeCanvasItems ... but need a nice way to get the underlying widget's size so that the parent GnomeCanvasItem can be drawn accordingly. Primary example is a slider (range widget) with an adjacent scale. If I draw the GnomeCanvasItem to small, I won't get all my scale i

Item factory args

2001-05-22 Thread David J. Topper
Hi folks, Can anyone explain arg 2? gtk_item_factory_new (GtkType container_type, const gchar *path, GtkAccelGroup *accel_group); What is the "path" all about? The examples / docs reference but that has l

How to have multi-level menus?

2001-05-18 Thread David J. Topper
Hi folks, Let's say I want a menu to pop up at current mouse x/y cordinates when I press mouse button 3. I see an easy way to do it with the older gtk_menu() functions and whatnot. But they seem to fall sort on a couple of areas: 1. Separators? Everything is a menu item? 2. How to make sub

Re: thread and gtk pb

2001-03-29 Thread David J. Topper
Sylvain Trias wrote: > > Hi > We are coding a chat program under linux and we use gtk and pthreads... > > When we run our soft, the window get updated only when the mouse is upper the window. > We run 1 thread for gtk, 1 for the server and 1 by extra client. Perhaps make sure both threads are i

Canvas resize bug?

2001-03-14 Thread David J. Topper
Hi folks, I notice that when you resize a Gtk or Gnome canvas, any regular GtkWidget contained therein DOES NOT get moved or resized properly. Instead, it remains in it's exact original location. This messes things up majorly. Anyone have a workaround? Like, is there a way to get the message b

How to set widget colors?

2001-03-13 Thread David J. Topper
Hi all, Can someone point me to an example that illustrates how to change basic widget colors? I mean things like boxes, range widget controls (different colors for actually slider or button) and so on. Similarly, how do I set the default background color for the gtk_canvas? Thanks, DT -- Tec

How to move widgets around a window?

2001-02-21 Thread David J. Topper
Hi folks, Does anyone know / or have a good example of how to move (drag w/ mouse) widgets (eg., range widgets, buttons, boxes, etc ...) around a window? I've tried using the gnome canvas, but it doesn't work properly (ie., event signals don't always make it to the widget). Thanks, Dave Topper

Problem moving widgets in GNOME canvas

2001-02-17 Thread David J. Topper
Hi folks, I've been trying to find a nice way to pack widgets into a canvas, and then move them around. I've hacked up some code from the gnome_canvas example. It works for the most part. But I am limited to what seems like the widget's original area ... as far as "dragging range" is concerned

Gnome canvas example?

2000-09-26 Thread David J. Topper
Hi all, 1. Are there gnome mailing lists? I didn't see any reference on developer.gnome.org. 2. Are there some better examples than those on developer.gnome.org? I'm parsing through the gnome-canvas example included with the library ... the arrowhead one to be specific. Can someone fill me o

GTK vs GNOME?

2000-09-22 Thread David J. Topper
I'm NOT trying to spark a flame war here. Rather, I've been happily using GTK for a while. Now it seems I need to extend things a bit with GNOMEcanvas. I know there's also a GTKcanvas, but the consensus seems to be "use GNOME." So I've been checking out the GNOME pages, but unfortunately haven

Can I pack GTKWidgets in CList?

2000-09-21 Thread David J. Topper
Can I pack widgets into slots in a Clist? I'm just mucking with the code from testgtk.c now and can't tell offhand if it would work. Basically I'd like to be able to move sliders (range widgets) around the window. Not necessarily with complete range of motion, but perhaps at least in a fashion

Widget question (does it exist?)

2000-09-19 Thread David J. Topper
Hi folks, I've looked through the testgtk script and the examples. Unfortunately I don't see what I'm looking for. Here's a brief description: 1. Insert little boxes, and be able to connect them like a graph 2. Be able to click on connections and cut/paste them Even better: 1. Insert GTK

Re: How to create scales for range widgets?

2000-08-22 Thread David J. Topper
Vlad Harchev wrote: > Could you post your stripped-down source (probably with main function) to > help us helping you? It's a bit hard to strip down but I'll try. The following compiles with: gcc -g slider_stuff.c `gtk-config --cflags` `gtk-config --libs` Just start moving the sliders and yo

Re: How to create scales for range widgets?

2000-08-22 Thread David J. Topper
Vlad Harchev wrote: > Could you post your stripped-down source (probably with main function) to > help us helping you? A bit hard to strip down but I'll try. > I addressed this about half a year ago without any problems. A key issue for me is to be able to do non standard mappings. Regardle

How to create scales for range widgets?

2000-08-21 Thread David J. Topper
Hi all, I've been going nuts over this and can't believe there isn't a built in mechanism in GTK to do it. Bascially, I'm trying to attach a numeric scale onto a range widget. I've attached a (very small) gif. It consists of a gtk table (the scale) that sits next to a range widget, which lies

How to "grey out" items?

2000-08-07 Thread David J. Topper
Hi all, Getting back into GTK again. Trying to expand my little application into different windows and such. I'm trying to create a "main" window which, among other things, establishes a connection to a server process. But once the user clicks on "connect" I want all the other widgets (eg., te

gtk_signal_connect vs. connect_object?

2000-07-29 Thread David J. Topper
Hi folks, What's the difference between the gtk_signal_connect and gtk_signal_conect_object (and related) functions? I recall an earlier tutorial had early example with both. I can't find any info on the difference. Examples? Thanks, Dave Topper -- Technical Director - Virginia Center for Co