Fwd: question about gtk_dialog (gtk2)
- From: Joël Krähemann <jkraehemann gmail com>
- To: "gtk-app-devel-." <gtk-app-devel-list gnome org>
- Subject: Fwd: question about gtk_dialog (gtk2)
- Date: Fri, 22 Jun 2018 14:08:44 +0200
---------- Forwarded message ---------
From: Joël Krähemann <jkraehemann gmail com>
Date: Thu, Jun 21, 2018 at 1:31 PM
Subject: Re: question about gtk_dialog (gtk2)
To: Wojciech Puchar <w puchar digitalsystems pl>
Hi,
Alternatively, you could inherit GTK_TYPE_DIALOG and do your very own
object. During ::map() and ::realize() you are able to modify the
GdkWindow. Just query parent and child elements for their dimensions.
Just implement:
GtkWidget::map()
GtkWidget::realize()
GtkWidget::size-allocate()
GtkWidget::size-request()
Bests,
Joël
On Thu, Jun 21, 2018 at 1:21 PM, Joël Krähemann <jkraehemann gmail com> wrote:
Hi,
FYI some properties are only valid as constructor.
cheers,
Joël
On Thu, Jun 21, 2018 at 1:11 PM, Joël Krähemann <jkraehemann gmail com> wrote:
Hi Wojciech,
What about:
dialog = g_object_new(GTK_TYPE_DIALOG,
"window-position", GTK_WIN_POS_CENTER,
NULL);
bests,
Joël
On Fri, Jun 15, 2018 at 1:43 PM, Wojciech Puchar
<w puchar digitalsystems pl> wrote:
how to make dialogs appear on center of screen not on left corner. tried
multiple things no results. For normal windows gtk_window_set_position works
for dialog it doesn't
below is example routine to ask a yes/no question from my program.
i've tried
gtk_window_set_position(GTK_WINDOW(dialog),GTK_WIN_POS_CENTER_ALWAYS);
but it doesn't work
nt pytanie(const char *txt) {
GtkWidget *dialog,*lab;
int odpowiedz;
dialog=gtk_dialog_new_with_buttons(TEXT_QUESTION,NULL,GTK_DIALOG_DESTROY_WITH_PARENT,
TEXT_TAK,GTK_RESPONSE_ACCEPT,TEXT_NIE,GTK_RESPONSE_NONE,NULL);
lab=new_label(txt);
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG
(dialog))), lab);
odpowiedz=gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
return (odpowiedz==GTK_RESPONSE_ACCEPT);
}
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]