Re: sizeGroup in a table...
- From: z pekar gmail com
- To: "Tadej Borovšak" <tadeboro gmail com>
- Cc: gtk-list gnome org
- Subject: Re: sizeGroup in a table...
- Date: Tue, 18 Nov 2008 14:34:04 +0200
thank you!!! it did work!
the only problem I still have is related to "motion_notify_event" of
the canvas. Triangles on the rulers that show mouse pointer position
function as expected only if the scrollbars are in their initial
positions, but if I scroll down the vertical scrollbar the triangle on
the vertical ruler doesn't show proper mouse pointer position anymore,
but is beyond the place were the mouse pointer(it's vertical
projection) is...
any good advice on this issue?
and thank you once again...
here is the related code part:
table = gtk_table_new (3, 3, FALSE);
gtk_widget_set_events (canvas, GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK);
hRuler = gtk_hruler_new ();
g_ptr_array_add (s->getGui()->parametersPage.imageEntry.hRuler, hRuler);
gtk_ruler_set_metric (GTK_RULER (hRuler), GTK_PIXELS);
g_signal_connect_swapped (G_OBJECT (canvas), "motion_notify_event",
G_CALLBACK (EVENT_METHOD (hRuler, motion_notify_event)),
G_OBJECT (hRuler));
gtk_table_attach (GTK_TABLE (table), hRuler, 1, 2, 0, 1,
(GtkAttachOptions)(GTK_EXPAND|GTK_SHRINK|GTK_FILL),
GTK_FILL, 0, 0);
vRuler = gtk_vruler_new ();
g_ptr_array_add (s->getGui()->parametersPage.imageEntry.vRuler, vRuler);
gtk_ruler_set_metric (GTK_RULER (vRuler), GTK_PIXELS);
g_signal_connect_swapped (G_OBJECT (canvas), "motion_notify_event",
G_CALLBACK (EVENT_METHOD (vRuler, motion_notify_event)),
G_OBJECT (vRuler));
gtk_table_attach (GTK_TABLE (table), vRuler, 0, 1, 1, 2,
GTK_FILL,
(GtkAttachOptions)(GTK_EXPAND|GTK_SHRINK|GTK_FILL),
0, 0);
On Mon, Nov 17, 2008 at 10:54 PM, Tadej Borovšak <tadeboro gmail com> wrote:
> Hi,
>
> you may need to create a separate set of scrollbars and then attach
> them to the GtkScrolledWindow.
>
> I would do it like this:
> 1. disable GtkScrolledWindow's scrollbars with
> gtk_scrolled_window_set_policy( swindow, GTK_POLICY_NEVER,
> GTK_POLICY_NEVER )
> 2. create separate set of scrollbars with hscroll =
> gtk_hscrollbar_new( gtk_scrolled_window_get_hadjustment( swindow ) )
> and vscroll = gtk_vscrollbar_new( gtk_scrolled_window_get_vadjustment(
> swindow ) )
> 3. pack those two in separate compartment inside table/box
>
> After that your size group should function properly.
>
>
> 2008/11/17 <z pekar gmail com>:
>> On Mon, Nov 17, 2008 at 6:55 PM, Tristan Van Berkom
>> <tristan van berkom gmail com> wrote:
>>> On Mon, Nov 17, 2008 at 10:59 AM, <z pekar gmail com> wrote:
>>>> Hi,
>>>> I have problems packing widgets into a table using sizeGroup. Here I
>>>> try to pack 2 gtkRulers around a scrolled window, so that rulers cover
>>>> only scrolled window's container and not the scrollbars (like in
>>>> gimp), I try to achieve this by putting rulers in the same sizeGroup
>>>> with scrolled window's container. But it doesn't seem to work -
>>>> instead rulers "cover" also the scrollbars :( what do I do wrong?
>>>
>>> Size groups group widgets together so that they all request the
>>> same size, they cannot break the rules of container packing positions.
>>>
>>> I didnt look at your ui code, but you need your scroll bars to be in
>>> different table columns than your rulers and scrolled windows.
>>
>> I have a 3x3 table
>> the vertical ruler is in the column 0-1, the horz. ruler is in columnt
>> 1-2, and the scrolled window got 2 columns - 1-3... so there is space
>> of the third column for the vert. scrollbar...
>> and how can I separate scrollbars from scrolled window - its one widget?
>>
>> thank you
>> Zeev
>> _______________________________________________
>> gtk-list mailing list
>> gtk-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gtk-list
>>
>
>
>
> --
> Tadej Borovšak
> tadeboro gmail com
> tadej borovsak gmail com
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]