The user can drag and drop icons or labels from the right side to the left, move them, resize them, change their size or colour, etc. When happy, he can press the generate button and generate a conkyrc file.

The screen is a top,non resizable window with a table. The 2 sides of the table are frames in which fixed containers have been put. Whenever someones tries to place an icon or a label at the right or bottom border of the left frame/fixed container, the widget goes off bounds, as you can see from the screen shot above.

I'm now trying to port the app to Gtk3 and I'm facing a bizarre problem. Whenever a user tries to place or move an object to the right or bottom border of the left frame/fixed container, it resizes itself to accommodate the newly placed widget.

I've tried the following things: 1)Fiddling with GTK_EXPAND and GTK_FILL for the placement of the frame. No change. 2)gtk_window_set_geometry_hints for the window, table, frame and fixed container. No change. 3)Replacing gtk_table with gtk_grid. No change.

After posting on StackOverflow, I was advised to consult the following page

Post subject: Re: Gtk3's Height-for-width new method: How do I implement i

Posted: Thu Aug 23, 2012 5:41 pm

Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 amPosts: 2406Location: Slovenia

Hello and welcome to the GTK+ forums!

It seems to me that your problem stems from the fact that GtkFixed allowed children to "overflow" in 2.x series and in 3.x this is not allowed anymore.

Your problem can be fixed in numerous ways, but none of the is completely trivial. I would recommend using GtkDrawingArea as a canvas. This will take some learning if you never used cairo drawing library before, but will enable you to add some nice effects to your application (exact positioning, preview while dragging, mark currently selected item, resizing using mouse - like in inkscape for example, ...). I'm wiling to provide you some assistance with this endeavor if you decide to implement it.

Another way of dealing with this would be to pack GtkFixed inside GtkViewport and manually fix the position, but this has a potential to become really messy really quick.

Post subject: Re: Gtk3's Height-for-width new method: How do I implement i

Posted: Thu Aug 23, 2012 7:25 pm

Joined: Thu Aug 23, 2012 2:19 pmPosts: 2

A 1000 thanks for your reply tadeboro.I was getting really desperate about this.Will google and read about gtkdrawingarea.Does the latter allow to list all the widgets I've placed on it?I need this, as well as knowing their places and sizes, in order to generate the conkyrc file.

I guess using a gtkfixed widget for this job was just a hack from my part; I'll have to adjust.

Thanks again.

EDIT: Also, while you're on it, do you have any idea about how one should apply the new height for width geometry method?

Who is online

Users browsing this forum: Google [Bot] and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum