Re: Howto set maximum window size ?



I think this should do it.

One more problem..
I have created window in file sysinfo.h like this:

//Filename: sysinfo.h
class Sysinfo : public Gtk::Window
{

    public:
        Sysinfo();
    virtual ~Sysinfo();
.
.
.

And then sysinfo.cc file looks like this:

//Filename: sysinfo.cc
Sysinfo::Sysinfo()
{
    //main window
    set_title("title");
    set_resizable(true)
    set_default_size(200,300);

    Gdk::Geometry geometry;
    geometry.max_height = 800;
    geometry.max_width = 600;
   
    set_geometry_hints(???, geometry, Gdk::HINT_MAX_SIZE);
.
.
.

Now I don't know what to use here, the  "window.gobj()" is clearly not working.

Thanks again


On 6/1/05, Bob Caryl <bob fis-cal com> wrote:
Nil Gradisnik wrote:

>I found this windows function:
>
>Gtk::Window::set_geometry_hints  (Widget& geometry_widget, const
>Gdk::Geometry&         geometry, Gdk::WindowHints geom_mask)
>
>I could use this to set the window maximum size, right ?
>Beacause I see that Gdk::WindowHints has HINT_MAX_SIZE enumeration.
>
>Now I have no idea how to use this in practise...
>
>Gtk::Window window;
>window.set_geometry_hints(window, ????, HINT_MAX_SIZE); maybe ?
>
>
>Thanks
>_______________________________________________
>gtkmm-list mailing list
> gtkmm-list gnome org
>http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
>
>
Check this out:
http://gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1Window.html#a53

The syntax of your resulting call will be like this:

Gtk::Window window;
Gdk::Geometry geometry;

geometry.max_height = 600;  // or whatever value you wish
geometry.max_width = 800;  // or whatever value you wish

window.set_geometry_hints(
                                            window.gobj(),
        // g_obj returns the widget that Gdk wants to see
                                            geometry,
           // the desired geometry description
                                            Gdk::HINT_MAX_SIZE     //
indicates the geometry structure field to use
                                            );

Hopes this helps.

Sincerely,
Bob Caryl



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]