Re: [pygtk] DND to/from CList

1999-11-22 Thread Jozsa Kristof

> > list only changes its active row.. nothing else. Same when I try to drop to
> > the list from elsewhere. Any ideas? Or is it inpossible?
> Here is the simple example for using dnd in clist.
> Hope this will help you.

Thank you very much for your help.. i've cleaned up the problem successfully
based on your example code :)

Anyone can answer my other question please? Why do I get such a critical
warning message like the one below? Every time I start my code it dumps
this, but I'm not sure it's an error or it's my fault - my app seems to work
ok.. can I do anything to make this disappear?

Gtk-CRITICAL **: file gtkwidget.c: line 1584 (gtk_widget_map): assertion
TK_WIDGET_VISIBLE (widget) == TRUE' failed.

Gtk-CRITICAL **: file gtkwidget.c: line 1584 (gtk_widget_map): assertion
TK_WIDGET_VISIBLE (widget) == TRUE' failed.

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] DND to/from CList

1999-11-16 Thread Jozsa Kristof


Is it possible to use drag'n'drop from and to a CList? I tried in a similar
way then in pygtk/examples/simple/dnd.py but failed miserably. Even if I set
the selection mode to SELECTION_SINGLE, if I try to drag from the list, the
list only changes its active row.. nothing else. Same when I try to drop to
the list from elsewhere. Any ideas? Or is it inpossible?

Yeah and something else: is it normal or acceptable to get messages like
this at a pygtk program startup? Can I do anything in my code to fix it? (my
stuff seem to work ok, it just dump this)
-
Gtk-CRITICAL **: file gtkwidget.c: line 1584 (gtk_widget_map): assertion
TK_WIDGET_VISIBLE (widget) == TRUE' failed.

Gtk-CRITICAL **: file gtkwidget.c: line 1584 (gtk_widget_map): assertion
TK_WIDGET_VISIBLE (widget) == TRUE' failed.
-

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] applet's icon w/transparency

1999-11-09 Thread Jozsa Kristof

Hello,

   I wonder what's the decent way of setting an xpm pic to be the pygnome
applet's icon. My xpm is transparent of course, but if I put it out to a
GtkPixmap and out to the applet's frame; it wont be transparent. I'd like to
have a transparent applet look similar to any gnome app launcher with the
standard grey background tile. Anyone can show me the way to do this please?

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] New signal

1999-10-26 Thread Jozsa Kristof

On Tue, Oct 26, 1999 at 08:52:35AM +0800, James Henstridge wrote:
> different from GTK+ signals).  It may work or it may not.  I don't think
> gtk uses alarm(), so you could probably use it to perform actions at
> certain intervals during long calculations.

I've looked after it a bit: gtk.timeout_add() seems to do the job quite
fairly; so I don't have to use the standard SIGALRM signal.

Thanks,
Christopher

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] New signal

1999-10-25 Thread Jozsa Kristof

On Mon, Oct 25, 1999 at 05:35:31PM +0200, WroBELL wrote:
> On Mon, 25 Oct 1999, Bernhard Herzog wrote:
> > If you already have Sketch, it's in Sketch/Base/connector.py. If there's
> > enough interest, I can make it available separately and write up some
> > documentation.
>  I think it would a great idea.

Well, talking about signals; can I set up my SIGALRM signal handler function
to get called when it's timeout is reached and not only when the timeout is
reached *and* an another gtk event occurs? Using the standard way my
own signal handler funtion is called only when I click on the window or
generate any event in a similar way, not at the moment of the alarm.

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Re: how to kill run_and_close()

1999-10-24 Thread Jozsa Kristof

Erm..

"..although non-modal dialog boxes tend to have problems associated with
them, and sometimes can cause strange bugs, for example if a non-modal
dialog box is associated with a window, you'd better bind the destroy signal
of the window and set it to destroy the dialog box as well, since otherwise
it could hang around even though the window or document it was supposed to
act on is already dead." /using-the-libgnomeui-library.html#AEN1042/

I guess that was what we're trying to figure out.

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Re: how to kill run_and_close()

1999-10-24 Thread Jozsa Kristof

On Sun, Oct 24, 1999 at 06:21:28PM +0800, James Henstridge wrote:
> If you remove the line:
>   win.connect("delete_event", mainquit)
> Does it make any difference?  

Makes no difference at all. The gnome dialog box will be destroyed
automatically, just the program cant exit (try it).

> The call to create a GnomeAbout() widget and call run_and_close() displays
> the dialog application modal and waits til a dialog button is pressed or
> the window is closed.  (this is documented in the gnome-libs documentation
> about gnome_dialog_run and gnome_dialog_run_and_close).
> 
> If you don't want the GnomeAbout widget to be modal, use the following:
>   about = GnomeAbout(...)
>   about.set_close(TRUE)   # close the dialog when a button is pressed
>   about.show()

Using it that way it works ok; mainquit can clean up these and exit
properly. Does that mean up that modal windows cant be destroyed by mainquit
without getting in trouble? 

(I'd need modal dialog windows in my code if possible anyway.) Do you know what
gnome-python tries to do when it 'hangs' after closing the modal dialog box?

> The dialog will be destroyed when the user closes it, and you don't have
> to worry about it.

OK, it just seems to have no point having a dialog box on the screen after
the program had been quit..

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Re: how to kill run_and_close()

1999-10-24 Thread Jozsa Kristof

OK, I've tried to simplify the problem as much as I could, I'll try to show
what the root of the problem seems to be. (I've used GtkWindow as the main
window here not GnomeApp as previously, but it's the same effect). 

I open a subwindow or a Gnome About box from the main window (uncommenting
the right line). If I open it using the button, it shows up. Then I close
the main window using the window manager (destroy signal is used I guess so
mainquit will start). If the opened window was the GtkWindow(), both will
close and the program returns. If the Gnome AboutBox was opened, both
window will close again and the code 'hangs', I do not get back the prompt;
it has to be killed to return.

--
from gnome.ui import *
from gtk import *
def butt(w, e=None):
#   this one cant be cleaned:
#GnomeAbout('a', '0', 'R', ['a'], "T").run_and_close()
#   this one works ok:  
   GtkWindow().show()
class mwin(GtkWindow):
def __init__(self):
GtkWindow.__init__(self)
box = GtkVBox()
self.add(box)
box.show()
b = GtkButton("Test Dialog")
b.connect("clicked", butt)
box.add(b)
b.show()
win= mwin()
win.connect("destroy", mainquit)
win.connect("delete_event", mainquit)
win.show()
mainloop()
--
Soz for the much hassle I cause with this thread, I'm just completely lost
on this prob :(

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] Re: how to kill run_and_close()

1999-10-22 Thread Jozsa Kristof

On Fri, Oct 22, 1999 at 09:39:43AM +0800, James Henstridge wrote:
> The run_and_close() routine creates another mainloop to run the dialog.
> This mainloop will finish when the dialog is closed or one of the buttons
> is pressed.  You probably shouldn't connect a handler that calls
> mainquit() to one of the dialog's widgets, as this may cause problems with
> the run_and_close() function.  Calling mainquit() outside of the
> run_and_close() call should make the outer mainloop return though.
> 
> James.

okie. I guess this should work then this way:

 --
from gnome.ui import *
from gtk import *
class hqWin(GnomeApp):
def about(self, moo):
GnomeAbout('a', '0', 'R', ['a'], "T").run_and_close()
def __init__(self):
GnomeApp.__init__(self)
self.create_toolbar([UIINFO_ITEM_STOCK('Help', '',
  self.about, STOCK_PIXMAP_HELP)])
hq= hqWin()
hq.connect("destroy", mainquit)
hq.connect("delete_event", mainquit)
hq.show()
mainloop()
 --

but it still cant exit properly after cleaning up the main win and the dialog box

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] Re: a few questions

1999-10-21 Thread Jozsa Kristof

On Thu, Oct 21, 1999 at 06:30:12PM +0200, Jozsa Kristof wrote:
> destroy the dialog box; and do mainquit(). Trying it out it works fine when
> there's no dialog opened. If the dialog box was opened it'll shut down as
> expected; but mainquit() does not end the application (it closes the main
> window but i do not get back the prompt where the python script was started
> from). I dont really know what I'm doing wrong in that case..

oh well and it was started using run_and_close(). I dunno if that matters or
not..

Christopher
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] a few questions

1999-10-21 Thread Jozsa Kristof

Hello,

  I've got a bunch of problems therearound. Can anyone help me in one or all
of the followings please?

- How can I set an xpm to be my pygnome applet's icon?

- Is GtkWindow._raise() implemented yet? I've learned about it in the
mailinglist archive, and I really need to raise a window

- What's the decent way of closing all dialog windows of an application when
the app is closed from the window manager? I've connected the destroy and
delete_event signals of the window to my own function, where I close and
destroy the dialog box; and do mainquit(). Trying it out it works fine when
there's no dialog opened. If the dialog box was opened it'll shut down as
expected; but mainquit() does not end the application (it closes the main
window but i do not get back the prompt where the python script was started
from). I dont really know what I'm doing wrong in that case..

Regards,
Christopher

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] GtkTreeItem boggle

1999-10-08 Thread Jozsa Kristof

Hello,

   I'm new on the list so a short introduction goes here: I'm a newbie both
in python and pygtk (means a few week experiences - I guess that counts as
newbie ;), but programmed on several other languages including C/C++, Java,
PHP3 and a bit Perl. I'm also studying IT in Hungary. /oh well, and sorry
for my bad English sometimes/

   I've got confused around GtkList and GtkListItem-s 2 days before and
seems I cannot figure out what I'm doing wrong. I've defined a GtkList and
put it out to my GUI. I've filled it with a couple of GtkListItems, and
stored the references for myself for future use. Later, when I query which
item of the list is selected, I get an instance of a GtkListItem, which does
not match with any of the stored instances. 

"""See the code if that's not clear:
self.dlbox = dlbox = GtkList()
self.inbox = list_item = GtkListItem("INBOX")
dlbox.add(list_item)
list_item.show()

# later, after selecting the item INBOX from the list visually
selected = self.dlbox.get_selection()
selected[0] == self.inbox  # that's false

The two instances when I print out refer to different memory addresses,
and (no surprise after that), there's no such instance in my stored
instances what's get_selection() returns. 

I guess I'm doing some trivial stupidity, but cant see what's it :(
Can anyone help please?

Christopher

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]