Re: flow layout container possible?
Hi Havoc, Rob - thanks for the heads up. I'm CC'd on the bug now and will follow its progress. In the meantime, I've imported that gimp widget (well, with HWrapBox too as apparantly WrapBox cannot be used on its own) and I've got it working! I will use this for now, but I'll probably convert it into C++ in order to fit in with the project more. My needs for the container are a bit trimmed down too, I don't really need it as a general purpose container, it will only contain a certain type of widget, so perhaps I can take some shortcuts. I don't see the point in making this nice big generic class that no one will use becuase it's not part of some library. I'll just wait for the changes talked about in the bug to get propogated in and then do something from there. thanks again guys. dave On Tue, Jul 8, 2008 at 1:08 PM, Robert Staudinger < [EMAIL PROTECTED]> wrote: > Hi, > > look at http://developer.gimp.org/api/2.0/app/GtkWrapBox.html . > This is what the gimp toolbox uses. > > - Rob > > On Tue, Jul 8, 2008 at 7:06 PM, Robert Staudinger > <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > Forgive me if this should be on the app devel list. I have a need in > > my application for a "flow container", a concept I first learned about > > when working with Java (swing, I think). It also exists in > > Windows.Forms and QT. Essentially, it is a container that contains > > widgets, in order of addition from left to right, similar to an HBox, > > but once it exhausts all its available horizontal space, it creates > > another row and continues the same pattern. > > > > Here's some terrible ASCII art: > > | [ Button ] [ Button 2 ] [ Button 3 ] | > > | [ Button 4] [ Button 5 ] | > > > > The problem I see with implementing such a container in GTK is that > > on_size_request (I'm a C++ developer, so bear with me on the gtkmm > > talk) doesn't give any hints as to an idea of the dimensions that I > > will have to work with. The flow container is more of a "give me one > > dimension and i'll give you the other" container, so if I am given an > > approximate width, I can compute the height. > > > > Does anyone see a way to accomplish this? > > > > oh, btw, for completeness I tried Murray Cumming's FlowTable [1] in > > Glom but it's not quite the same idea. In that implementation, you > > have to know the number of columns you want to break it into before > > hand. > > > > thanks, and cheers to those at GUADEC. > > dave > > > > > > [1] > http://svn.gnome.org/viewvc/glom/trunk/glom/utility_widgets/flowtable.cc?view=markup > > > ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
flow layout container possible?
Hi all, Forgive me if this should be on the app devel list. I have a need in my application for a "flow container", a concept I first learned about when working with Java (swing, I think). It also exists in Windows.Forms and QT. Essentially, it is a container that contains widgets, in order of addition from left to right, similar to an HBox, but once it exhausts all its available horizontal space, it creates another row and continues the same pattern. Here's some terrible ASCII art: | [ Button ] [ Button 2 ] [ Button 3 ] | | [ Button 4] [ Button 5 ] | The problem I see with implementing such a container in GTK is that on_size_request (I'm a C++ developer, so bear with me on the gtkmm talk) doesn't give any hints as to an idea of the dimensions that I will have to work with. The flow container is more of a "give me one dimension and i'll give you the other" container, so if I am given an approximate width, I can compute the height. Does anyone see a way to accomplish this? oh, btw, for completeness I tried Murray Cumming's FlowTable [1] in Glom but it's not quite the same idea. In that implementation, you have to know the number of columns you want to break it into before hand. thanks, and cheers to those at GUADEC. dave [1] http://svn.gnome.org/viewvc/glom/trunk/glom/utility_widgets/flowtable.cc?view=markup ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
Re: gdk_display_close segfault?
ok, thank you Matthias.daveOn 6/28/06, Matthias Clasen <[EMAIL PROTECTED]> wrote: On 6/28/06, Dave Foster <[EMAIL PROTECTED] > wrote:> Hi,>> I've been trying to write a small section of code in my program which> makes a second connection to the X display, using gtkmm.. I kept having> problems, after rewriting it about 5 or 6 times, I tried writing it in > straight gdk, and STILL got the problems.>> I seem to get a segfault whenever I call gdk_display_close(). Here is a> rediculously simple example that gives the problem:>> Glib::ustring disp = ": 0.0";> GdkDisplay* gdisp = gdk_display_open(disp.c_str());> if (!gdisp) ...> gdk_display_close(gdisp);>> /*> Program received signal SIGSEGV, Segmentation fault.> [Switching to Thread -1224202560 (LWP 5689)] > 0xb7b413d0 in gdk_display_x11_dispose () from /usr/lib/libgdk-x11-2.0.so.0> (gdb) bt> #0 0xb7b413d0 in gdk_display_x11_dispose () from /usr/lib/libgdk-x11-2.0.so.0> #1 0xb7a11f2b in g_object_unref () from /usr/lib/libgobject- 2.0.so.0> #2 0xb7b20c04 in gdk_display_close () from /usr/lib/libgdk-x11-2.0.so.0> #3 0x080571d5 in SetBG::set_bg ([EMAIL PROTECTED], [EMAIL PROTECTED],> mode=SetBG::SET_SCALE, [EMAIL PROTECTED]) at SetBG.cc:67> ...> */>> The display is opening fine. I'm running:>> gtk: 2.8.17-1> glib: 2.10.2-1>> (hmm, didn't notice that before,t he 2.8 vs 2.10 thing, could that be it?) >> Anyway, I've spent all night trying to debug this and weeks trying to> sort this problem out in my program. What is up with this, what can I> do?gdk_display_close has been fixed in GTK+ 2.10, which should beavailable soon. ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list
gdk_display_close segfault?
Hi, I've been trying to write a small section of code in my program which makes a second connection to the X display, using gtkmm.. I kept having problems, after rewriting it about 5 or 6 times, I tried writing it in straight gdk, and STILL got the problems. I seem to get a segfault whenever I call gdk_display_close(). Here is a rediculously simple example that gives the problem: Glib::ustring disp = ":0.0"; GdkDisplay* gdisp = gdk_display_open(disp.c_str()); if (!gdisp) ... gdk_display_close(gdisp); /* Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1224202560 (LWP 5689)] 0xb7b413d0 in gdk_display_x11_dispose () from /usr/lib/libgdk-x11-2.0.so.0 (gdb) bt #0 0xb7b413d0 in gdk_display_x11_dispose () from /usr/lib/libgdk-x11-2.0.so.0 #1 0xb7a11f2b in g_object_unref () from /usr/lib/libgobject-2.0.so.0 #2 0xb7b20c04 in gdk_display_close () from /usr/lib/libgdk-x11-2.0.so.0 #3 0x080571d5 in SetBG::set_bg ([EMAIL PROTECTED], [EMAIL PROTECTED], mode=SetBG::SET_SCALE, [EMAIL PROTECTED]) at SetBG.cc:67 ... */ The display is opening fine. I'm running: gtk: 2.8.17-1 glib: 2.10.2-1 (hmm, didn't notice that before,t he 2.8 vs 2.10 thing, could that be it?) Anyway, I've spent all night trying to debug this and weeks trying to sort this problem out in my program. What is up with this, what can I do? thanks all. dave ___ gtk-devel-list mailing list gtk-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-devel-list