dialog window resize

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

dialog window resize

Attila bardi
Hey,

my problem is I try to set the default window size for a dialog window and I don't want the user resize it.
But it is not working for me. If I set the resizable to false the default window size is not working anymore.
 
-------------------------
#!/usr/bin/perl -w
use Gtk2 qw/-init/;

my $window = Gtk2::Dialog->new;
$window->set_position('GTK_WIN_POS_CENTER');
$window->set_default_size(610, 450);
# $window->set_resizable(0);


$window->show_all;

Gtk2->main;

0;


_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: dialog window resize

Attila bardi
hmm, the C version has the same behavior:

#include <gtk/gtk.h>

int main( int argc, char *argv[] )
{
        GtkWidget *dialog;

        gtk_init (&argc, &argv);

        dialog = gtk_dialog_new ();
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
        gtk_window_set_default_size(GTK_WINDOW(dialog), 610, 400);
/*      gtk_window_set_resizable(GTK_WINDOW(dialog),0);*/
        gtk_widget_show  (dialog);

        gtk_main ();

        return 0;
}


Then how can I set the window size and remove the right from the UI user to resize it?
 

On Sun, Mar 6, 2011 at 9:26 AM, Attila bardi <[hidden email]> wrote:
Hey,

my problem is I try to set the default window size for a dialog window and I don't want the user resize it.
But it is not working for me. If I set the resizable to false the default window size is not working anymore.
 
-------------------------
#!/usr/bin/perl -w
use Gtk2 qw/-init/;

my $window = Gtk2::Dialog->new;
$window->set_position('GTK_WIN_POS_CENTER');
$window->set_default_size(610, 450);
# $window->set_resizable(0);


$window->show_all;

Gtk2->main;

0;



_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: dialog window resize

Grant McLean
On Wed, 2011-03-09 at 13:15 +0100, Attila bardi wrote:
> hmm, the C version has the same behavior:
> ...
> Then how can I set the window size and remove the right from the UI
> user to resize it?

The window size is calculated automatically from the size of the widgets
it contains.  Try increasing the size of one or more of those widgets.

Regards
Grant

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: dialog window resize

Kevin Ryde
In reply to this post by Attila bardi
Attila bardi <[hidden email]> writes:
>
> Then how can I set the window size and remove the right from the UI user to
> resize it?

Maybe Gtk2::Window set_geometry_hints() saying the minimum and maximum
sizes the same value.

Or Gtk2::Gdk::Window set_functions() to take away the resize handles,
wherever that hides on the Gtk2::Window (or apply it after "realize").

Of course both depend on the window manager obeying those hints
settings.

I'd think forcibly disallowing resize is probably not a good idea
though.  Make the default size something sensible, and if the user makes
a mess later too bad.  Generally all widgets and windows are meant to do
at least something in any size, even if not very well, etc.  Resize
might even be important if you've botched a size calculation and the
user has to expand to see the full content.



--
The sigfile finance for the layman series:
In an annual report screaming unrealistic optimism is the normal tone
for the chairman's letter.  If it's anything less then expect to lose
money.
_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list