[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Keeping Track of More Than One Window in an App
- From: Emmanuel DELOGET <pixel DotCom FR>
- To: gtk-app-devel-list redhat com
- Subject: Re: Keeping Track of More Than One Window in an App
- Date: Thu, 24 Jun 1999 19:01:49 +0200 (MET DST)
Sean Nichols said...
->> [got a battle axe, and cut a lot of stuff here, sorry]
>
-> You slightly misunderstood the bit about the base struct. base isn't
->actually a window at all, but just a struct to hold the "real" windows...
->which means that I actually don't have the problem of mistakenly closing the
->whole app like that. In my particular case, I also don't have to worry about
->dynamically adding windows, so that's not an issue either.
->
-> But anyway, aside from that one difference (base struct as opposed to
->linked list), the solutions sound like they're pretty much the same. Which
->doesn't help my primary problem, in that I'm carrying this huge global
->dataset around, which I don't like. But it does seem as if this is a
->more-or-less "standard" way of doing things.
->
-> Well... thanks anyway.
->
-> If anyone else has another way of doing it, I'd love to hear about it!
Of course, you cannot avoid big structure/lists if you want to
reference all your objects.
[this is only a strange idea, which work for me and may not work
for you...]
I had a strange idea one day. Each time I create a gtk object in my
app, this object goes in a linked list in a base struct (whaoh...
got the 2 at the same time). Each node (call it a Lise(1) node) of the
linked lists has at least two pointers :
* a pointer on the object itself
* and a pointer which point back to the base structure.
When some widget has some associated signal that are connected, the
'gpointer data' that is used as the parameter is allways a Lise node.
So I can access *directly* both to the base struct and the gtk object.
Notice that the base struct is not global to the project. It is
local to the main() function, and is used as a parameter every
time it is needed.
If you are OK, I can send you some code in the next few days
(have a bug to track down and I have very important stuff to do this
week end... say between Mon and Wed next week :)
Yours,
-> - Sean
(1) Lise stands for... no, I'll tell you later :) I should get a
first pre-dist in a month or two.
--
__________________________________________________________________________
Emmanuel DELOGET [pixel] pixel@{dotcom.fr,epita.fr} ---- DotCom SA
http://www.epita.fr/~pixel | http://www.dotcom.fr/~pixel
"On the last day, God created Linux. And Microsoft won its antitrust case"
--------------------------------------------------------------------------
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]