Re: Notebooks and GLists



I figured I would need a separate glist, I can get the last know order from
the order of the original glist.

When I get the reorder signal it appears to be run after the reorder event
has taken place. So I see the need for a unique id. I assume this is where
g_object_set_data comes in?

How would I use such an id system though?

Also sorry if this top posts its being composed on my phone, I don't know
how it copes yet.
On 30 Aug 2011 23:49, "Michal Suchanek" <hramrach centrum cz> wrote:
On 30 August 2011 23:08, Neil Munro <neilmunro gmail com> wrote:
Hi folks
          Not a very descript title, but I fail to come up with a better
one. Anyway my problem is as follows.

I have a notebook with reorderable tabs which each displays a sourceview
widget.
Each sourceview widget represents a document where a document is an
instance
of an object/struct.
When the tabs are re-ordered the glist becomes out of order with the tabs
and needs to be updated to reflect the new page positions.

Using the page-reordered signal and callback I can get the new page
position
but not the old position.

If there is a better way to go about implementing a system like this, I
would be willing to hear it and any help is appreciated.

Finally you can get the code here: https://gitorious.org/x2

You did not implement any Reorder. In absence of any code to comment
on I suggest you save the old order (= the last order known to your
code) in another GList and when you receive a reorder event you can
compare the new position with the saved position.

You need these two GLists to hold the same (or convertible) unique
values. eg. pointer to tab is one sufficiently unique value.

Pointer to tab and pointer a struct containing a pointer to tab is an
example of trivially convertible (and often very useful) unique
values.

HTH

Michal



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