[Glade-users] {Glade-Users] Adding a Dialog window to the top-level window
- From: pauld gnp com (Paul Danielson)
- Subject: [Glade-users] {Glade-Users] Adding a Dialog window to the top-level window
- Date: Mon, 13 Aug 2001 15:04:02 -0700
<html>
<head>
</head>
<body>
Okee-Dokee...did that...but I think now that the thread that throws up the
dialog tries to do so before the main window is brought up...I assume that
is a no-no, since the widget pointer I use in the gtk_window_set_transient_for()
call for the parent window will not have been "shown" yet...<br>
<br>
This seems to be borne out in my testing...my code snippet is:<br>
<br>
<small><tt> /*----- Open a log
file
*/</tt></small><small><tt><br>
</tt></small><small><tt> if ((LogFile = fopen("./guisyslog", "r")) != NULL)</tt></small><small><tt><br>
</tt></small><small><tt> {</tt></small><small><tt><br>
</tt></small><small><tt> /* COMPLAIN (open dialog) about existing file
*/</tt></small><small><tt><br>
</tt></small><small><tt>
printf("<<<<<<<<<<<<<<<
LOGGING file already exists >>>>>>>>>>>>>>
");</tt></small><small><tt><br>
</tt></small><small><tt> LoggerErrorDialog =
create_Logger_Dialog();</tt></small><small><tt><br>
</tt></small><small><tt>
gtk_window_set_transient_for(GTK_WINDOW(LoggerErrorDialog),</tt></small><small><tt><br>
</tt></small><small><tt>
GTK_WINDOW(HardwareControl));</tt></small><small><tt><br>
</tt></small><small><tt> /* gtk_widget_show(LoggerErrorDialog);
*/</tt></small><small><tt><br>
</tt></small><small><tt> }</tt></small><br>
<br>
Before I commented out the gtk_widget_show for the logger dialog window,
I got a core dump trying to execute that command....but now the dialog won't
display at all...<br>
<br>
I'm going to try to put the widget show for the dialog in the main thread
after the main HardwareControl widget_show...but that bothers me on some
unknown object-orientation level *L* Is there a better way to handle this?
Must I set some kind of *shudder* global flag in my thread so the dialog
can be opened later on in the main thread?<br>
<br>
Thanks.<br>
Paul<br>
<br>
<br>
Damon Chaplin wrote:<br>
<blockquote type="cite" cite="mid:997736471 19409 2 camel karuna ximian com"><pre wrap="">On 13 Aug 2001
13:37:01 -0700, Paul Danielson wrote:<br></pre>
<blockquote type="cite"><pre wrap="">Hi,<br><br><<< Newbie alert >>><br><br>I have a
top-level window created in Glade that starts a variable number <br>of pthreads...<br><br>One of those
threads creates a dialog window (created as a "Dialog" type <br>in Glade, rather than a top-level dialog)
when a certain file is found <br>to be missing on my system. <br><br>The problem is that when my dialog
thread opens the dialog, it happens <br>to open the dialog window BEHIND (and before?) the main window. I
<br>assume there is a timing issue here, probably that the dialog is <br>realized (mapped?) before the main
(top-level) window is, but I am <br>unsure about how to proceed...<br><br>I thought I could create the dialog
as a child of the main window, but <br>apparently there is no way I can do that in Glade (IS there????)
.<br><br>Any help, or a pointer in the right direction to do my own footwork <br>would be GREATLY
appreciated!!!<br></pre>
</blockquote>
<pre wrap=""><!----><br>Glade can't help here.<br><br>But you can call gtk_window_set_transient_for() to
make sure the dialog<br>stays in from of the main window.<br><br>Damon<br><br><br></pre>
</blockquote>
<br>
</body>
</html>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]