I had an interesting (to me, anyway) situation:
I have a program which, if a user presses a button, opens a new window
containing various text entries, textviews, and radiobuttons. The new window
also contained a checkbutton. The state of the radiobuttons and checkbutton
were stored in flags (i
I've not seen a clear answer to this obvious question. Maybe I'm not searching
for the right terms.
What I want to do is create a dialog if an error occurs, and I want it to
appear atop the window that currently has focus. This seems like a standard
thing to do, so it's weird I can't find a cle
On Thu, Dec 5, 2013 at 2:00 AM, David Buchan wrote:
>
> Things I've learned yesterday are:
>
> 1. strdup() (I've never seen or used it before)
> 2. what the heck heap and stack mean (still more to learn there)
> 3. a more general and flexible solution is probably to
On Wed, Dec 4, 2013 at 2:59 PM, David Buchan wrote:
> // Allocate memory on the heap, not stack.
> msgdata = (msgdatas *) malloc (1 * sizeof (msgdatas));
> msgdata->textview = (int *) malloc (1 * sizeof (int));
> message = (char *) malloc (1024);
The only blocks of memo
On 4 December 2013 13:31, wrote:
> Here's a tiny, complete program that does almost what you want. It's
> gtk2, but should work fine with gtk3.
>
> http://pastebin.com/PsG2UDkY
>
> It just updates a status bar, but it'd be easy to make it do a textview
> instead.
>
> John
On Tue, 3 Dec 2013 19:59:22 -0800 (PST)
David Buchan wrote:
> ok, I may be getting somewhere. I did some reading on heap memory
> versus stack.
>
> Here's a vastly simplified example program which doesn't use GTK+,
> but I'm using to demonstrate my plan of attack
ok, I may be getting somewhere. I did some reading on heap memory versus stack.
Here's a vastly simplified example program which doesn't use GTK+, but I'm
using to demonstrate my plan of attack.
I use a function called packit() which allows me to still use strdup().
Comments?
Dave
Valgrind i
David Buchan wrote:
[snip]
> It is awkward, and probably unnecessary. Unless you have a very good
> reason, that is not the way to do it. Pass the idle function a string
> allocated on the heap, and free it in the idle function when finished
> with. Any other way creates thread
David Buchan wrote:
> These darn threads and idle functions still baffle me. I'm sorry to
> be such a pest.
>
> I want to periodically update a textview as new information comes
> available.
Sometimes this information can come in quickly (roughly
> every tenth of a
These darn threads and idle functions still baffle me. I'm sorry to be such a
pest.
I want to periodically update a textview as new information comes available.
Sometimes this information can come in quickly (roughly every tenth of a
second). Each update is a single line of text.
The observed
On Wed, 27 Nov 2013 19:32:26 -0800 (PST)
David Buchan wrote:
> I removed the call to g_thread_init() and it still works fine! Great
> catch there.
You can include it with glib >= 2.32 - it is a no-op then. You should
include it if you want your code to be able to run on earlier a
David Buchan wrote:
> Hi Michael,
>
> My 32-bit, GTK+2 version does
>
> // Secure glib
> if (!g_thread_supported ()) {
> g_thread_init (NULL);
> }
>
> at the beginning, and then the thread is spawned via:
>
>
on_button1_clicked (GtkButton *bu
David Buchan wrote:
> Hi Michael,
>
> My 32-bit, GTK+2 version does
>
> // Secure glib
> if (!g_thread_supported ()) {
> g_thread_init (NULL);
> }
>
> at the beginning, and then the thread is spawned via:
>
> on_button1_clicked (GtkButton *bu
ew threads?
On 11/27/2013 08:29 AM, David Buchan wrote:
> I have written a program which spawns a new thread when the user
> clicks a button. The new thread does something noticeable immediately
> after starting, so I know when the thread has begun. What I mean is,
> if I run that piece
Hi Andrew,
Yes, I've tried the printf thing. It takes about 1.5 sec. Very strange.
Dave
From: Andrew Potter
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Wednesday, November 27, 2013 1:24 PM
Subject: Re: Delay time to spawn new threads?
O
I have written a program which spawns a new thread when the user clicks a
button. The new thread does something noticeable immediately after starting, so
I know when the thread has begun. What I mean is, if I run that piece of code
that is executed as a new thread, but as a stand-alone program,
Great! Thanks!
Dave
From: "jcup...@gmail.com"
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Tuesday, November 5, 2013 4:56 PM
Subject: Re: Valgrind is grinding my gears
I have a valgrind file here I use for my large gtk2 prog
Aaaah. I see.
Thanks guys.
From: Bernhard Schuster
To: David Buchan
Cc: David Nečas ; gtk-app-devel-list list
Sent: Tuesday, November 5, 2013 3:59 PM
Subject: Re: Valgrind is grinding my gears
No, as soon as you use GObject derived types (or call
her that's essentially what using
G_SLICE=always-malloc would do.
I can't try this out until late tonight, unfortunately.
From: David Nečas
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Tuesday, November 5, 2013 2:51 PM
Subject: Re: Valgrind
lable when freeing" -
https://developer.gnome.org/glib/unstable/glib-Memory-Slices.html
I do indeed change dimensions of arrays declared within my struct (a lot, in
fact). Could this be the cause?
____
From: David Buchan
To: gtk-app-devel-list list
Sen
trouble with g-sliced memory?
From: David Buchan
To: gtk-app-devel-list list
Sent: Tuesday, November 5, 2013 12:47 PM
Subject: Valgrind is grinding my gears
I have a rather large program I've written in C language which uses GTK+2. My
Makefile has:
CC
I have a rather large program I've written in C language which uses GTK+2. My
Makefile has:
CCFLAGS = `pkg-config --cflags gtk+-2.0 gmodule-2.0`
LIBS = `pkg-config --libs gtk+-2.0 gmodule-2.0`
GCC compiles it without warnings using flags:
-Wall -O -Wuninitialized
My program has several us
might be able to
build GTK+3, but that's likely a lot of work. So had in mind producing two
binaries for the distribution tarball.
From: Emmanuele Bassi
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Thursday, May 16, 2013 10:50 PM
Subject: Re:
I am using Ubuntu 13.04.
Rumour on the street (I *think* I read it somewhere) is that I can install both
libgtk2.0-dev and libgtk-3-dev. Is that true? Can they both be installed
without interfering with each other, and without breaking Unity?
I'd like to be able to provide executables of my pr
Great! Thanks Tristan.
Dave
From: Tristan Van Berkom
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Monday, January 28, 2013 1:16 AM
Subject: Re: GTK tables
On Mon, Jan 28, 2013 at 4:42 AM, David Buchan wrote:
> I've created a table with G
I've created a table with Glade and put various widgets in some of the cells.
Ifin one particular rowI have: a label,a text entry, and finally a few cells
that I don't need to put anything into, should I place blank labels in those
last unused cells, or just leave them unspecified? Would there b
Based on recent discussion on threads/idles/timeouts, I wonder if I
could get confirmation that what I'm doing to remove deprecated stuff is
correct.
Current Situation:
Ubuntu 10.04
libgtk2.0-dev
3.7.0.is.3.6.7-0ubuntu1
Makefile contains:
CCFLAGS = `pkg-config --cflags gtk+-2.0 gmodule-2.0`
David Buchan
To: gtk-list list
Sent: Tuesday, September 18, 2012 9:51 PM
Subject: GTK window positioning
It just occurred to me that maybe I should be sending to the gtk-list mailing
list instead (more active).
Pls see below...
- Forwarded Message -
From: David Buchan
To: gtk-app-
devel-list@gnome.org
Sent: Wednesday, September 19, 2012 2:53 PM
Subject: Re: GTK window positioning
David Buchan wrote:
> gtk_window_set_position (GTK_WINDOW (window1), GTK_WIN_POS_NONE);
[snip]
>
> I find that the two windows are always placed right on top of each other. I
>
Hi,
I've made a program that creates two new windows when demanded:
GtkWidget *window1, *scrolled_win1, *textview1;
GtkTextBuffer *buffer1;
GtkWidget *window2, *scrolled_win2, *textview2;
GtkTextBuffer *buffer2;
PangoFontDescription *textview_font1;
PangoFontDescription *textview_font
Thanks!
From: Emmanuele Bassi
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Saturday, July 21, 2012 7:43 AM
Subject: Re: Unusual GTK error message
Hi;
This was a bug that was recently fixed in gtk+:
https://bugzilla.gnome.org/show_bug.cgi?id
Frank wrote:
"You don't have a .local directory in /root"
Should I?
From: Frank Cox
To: gtk-app-devel-list@gnome.org
Cc: David Buchan
Sent: Saturday, July 21, 2012 1:10 AM
Subject: Re: Unusual GTK error message
On Fri, 20 Jul 2012 18:3
Additional info:
The first two errors appear when I press the "Open" button in the file chooser
dialog.
The third error appears when I close my program completely.
Dave
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome
Background info: My program uses a file chooser dialog. I compiled it for the
first time today on a 64-bit machine with Ubuntu 12.04 64-bit with gtk-3-dev.
My program is run as root. I've been using it extensively on 32-bit machine
with libtgtk2.0-dev and Ubuntu 10.04 with no errors.
When I use
Well, that worked out fine!
It creates a smooth user interface experience.
Thanks again John.
Dave
From: "jcup...@gmail.com"
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Friday, July 6, 2012 10:16 AM
Subject: Re: yet another thread quest
Wow!
Absolutely fantastic.
Thanks again John.
Dave
From: "jcup...@gmail.com"
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Friday, July 6, 2012 10:16 AM
Subject: Re: yet another thread question
On 6 July 2012 14:49, David Buchan wro
into the textview.
Dave
From: "jcup...@gmail.com"
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Friday, July 6, 2012 3:56 AM
Subject: Re: yet another thread question
Hi again David,
On Friday, 6 July 2012, David Buchan wrote:
>
> When the user presses a button,
When the user presses a button, an idle function is begun to watch a flag which
will tell it a message has been left in a string for it by a worker thread. The
worker thread is then started. It will produce results to be displayed in a
textview by the idle function. When the worker thread has re
Aaaah.. I see.
Yes, that's exactly what I meant.
That's great! Thanks.
From: "jcup...@gmail.com"
To: David Buchan
Cc: gtk-app-devel-list list
Sent: Thursday, July 5, 2012 11:32 AM
Subject: Re: Another thread/idle/timeout question
easiest
solution.
From: David Buchan
To: gtk-app-devel-list list
Sent: Thursday, July 5, 2012 9:26 AM
Subject: Another thread/idle/timeout question
Is there a way to have a (non-main iteration) thread issue a signal when it
ends?
I start up a timeout and
Is there a way to have a (non-main iteration) thread issue a signal when it
ends?
I start up a timeout and an idle function when I spawn a new thread.
I want the main iteration to stop the timeout and idle function as soon as the
new thread is finished and disappears.
It seems to me that if tha
yep. Seems to be working.
Thanks!
Dave
From: James Morris
To: David Buchan
Sent: Monday, July 2, 2012 9:10 PM
Subject: Re: Threads and idle functions
On 3 July 2012 01:50, David Buchan wrote:
> My understanding is that child threads must never alter
My understanding is that child threads must never alter the UI in any way.
If I have a program which spawns a child thread to download some data and I
want to be able to have a dialog pop up should an error occur, is it correct to
say that I need an idle function to be running concurrently to mo
43 matches
Mail list logo