Re: [pygtk] expose event for Gtk.DrawingArea?

2011-10-01 Thread Iñigo Serna
Hi,

On 1 October 2011 01:47, Steven I Usdansky  wrote:
> I think I missed something in the transition to GObject introspection.
> How do I now get my drawing area to respond to an expose event (or what
> is the new way of doing things)? The old way works:
>
[...]
>
> The "new" way, or my interpretation of it, does not work; it claims
> TypeError:  (GtkDrawingArea at 0xa74980)>: unknown signal name: expose-event
> The "new" way:
>
> #!/usr/bin/env python
> from gi.repository import Gtk, Gdk
> class MyExample(object):
>   def __init__(self, user_data=None):
>     window = Gtk.Window()
>     window.connect("destroy", Gtk.main_quit)
>     drawing_area = Gtk.DrawingArea()
>     drawing_area.set_size_request(300,300)
>     drawing_area.connect('expose-event',self.expose)
>     window.add(drawing_area)
>     window.show_all()
>   def expose(self,widget,data):
>     print ("self_exposed")
> # ===
> if __name__ == "__main__":
>     app = MyExample()
>     Gtk.main()

In Gtk+ v3 the expose_event is now called 'draw', so change this line:
- drawing_area.connect('expose-event',self.expose)
with:
+ drawing_area.connect('draw',self.expose)

and it should work.

Greetings,
Iñigo Serna
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] Left align a widget in a VBox

2011-09-18 Thread Iñigo Serna
Hi,

gtk.Label inherits from gtk.Misc and there you have a
gtk.Misc.set_alignment() method [1], so you could do:

label.set_alignment(0, 0.5)

[1] 
http://www.pygtk.org/docs/pygtk/class-gtkmisc.html#method-gtkmisc--set-alignment


Hope it helps,
Iñigo Serna

On 18 September 2011 05:40, Abhijeet Rastogi  wrote:
> I have just started developing GUI using pygtk & as a part of learning
> pocess, I made this simple GUI to add two numbers.
>
> http://i.imgur.com/tIT7A.png
>
> Now, I want the "Result is: 14" to come to the left most area (right now, as
> you can see, its in the middle). How can I achieve that?
>
> My layout is like this:
>
> 1. All widgets are in VBox layout.
> 2. The two buttons at the bottom are in HBox layout which are then packed in
> Vox.
>
> My complete code to the program: http://sprunge.us/KDgd?python   (remove
> ?python if you want to see textonly version).
>
> I have also tried using self.label_result.set_justify() but I guess, its
> just for the text inside the label widget.
>
> So, what is it that I should do to solve the problem?
>
> --
> Regards,
> Abhijeet Rastogi (shadyabhi)
> http://www.google.com/profiles/abhijeet.1989
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] catch key_press_event on gtk.CellRendererText (or gtk.TreeViewColumn)

2011-03-23 Thread Iñigo Serna
Hi,

On 23 March 2011 18:59, Giuseppe Penone  wrote:
> Hi,
> I have a table with editable cells implemented with liststore+treeview in my
> application http://giuspen.com/cherrytree .
> I'm trying to connect a callback to any char inserted in a editable
> liststore cell but I cannot find a way since
>
[...]
>
> If anybody has an example to provide or a clue please help me.
> Thanks & best regards,
> Giuseppe.

Take a look at:
https://bitbucket.org/inigoserna/bidebarrieta/src/517f2cbc48d8/ui/listview.py

* definition: method __add_tvcol(), lines 87-95
* action callbacks: methods on_text_edited_started() and
on_text_edited(), lines 336-394


Hope it helps,
Iñigo Serna
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] gtk.IconView and set_cell_data_func doesn't work together

2010-11-21 Thread Iñigo Serna
Hi again,

ok, I found it.
Here you have the answer:

class IconView(gtk.Iconview):
def __init__(self):
...
crpb = gtk.CellRendererPixbuf()
self.pack_start(crpb, False)
self.set_cell_data_func(crpb, self.cell_pixbuf_func)

# self.set_text_column(6)
crtxt = gtk.CellRendererText()
crtxt.set_property('width', ITEM_WIDTH-10)
crtxt.set_property('ellipsize', pango.ELLIPSIZE_END)
crtxt.set_property('alignment', pango.ALIGN_CENTER)
crtxt.set_property('scale', 0.8)
self.pack_start(crtxt, False)
self.set_attributes(crtxt, text=6)
...

def cell_pixbuf_func(self, celllayout, cell, model, iter):
pb = get_cover(model.get_value(iter, 1), 'huge') # book file path
cell.set_property('pixbuf', pb)


Sorry for the noise,
Iñigo Serna



2010/11/21 Iñigo Serna :
> Hi,
>
> I'm trying to set a custom function to render the images on a
> gtk.IconView, instead of the usual "gtk.IconView.set_pixbuf_column()"
> method.
>
> To do it, I'm using "set_cell_data_func" method that gtk.IconView
> inherits from gtk.CellLayout [1] and [2].
>
> It doesn't work, reporting next error.
> """
> iconview.py:19: GtkWarning:
> gtk_icon_view_cell_layout_set_cell_data_func: assertion `info != NULL'
> failed
>  self.set_cell_data_func(crpb, self.cell_pixbuf_func)
> """
> See the attached example.
>
> Any idea?
>
> I succesfully use "set_cell_data_func" method with treeviews, so the
> issue comes within gtk.IconView...
>
>
> My purpose is to render the pixbufs according to some "size"
> preference so images are shown smaller or bigger.
> The option of filling the store each time "size" preference is changed
> is not a valid solution as there a lot of rows there so it would be
> very slow.
>
>
> Thanks,
> Iñigo Serna
>
>
> [1] http://www.pygtk.org/docs/pygtk/class-gtkiconview.html
> [2] 
> http://www.pygtk.org/docs/pygtk/class-gtkcelllayout.html#method-gtkcelllayout--set-cell-data-func
>



-- 
Iñigo Serna
Katxijasotzaileak
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

[pygtk] gtk.IconView and set_cell_data_func doesn't work together

2010-11-21 Thread Iñigo Serna
Hi,

I'm trying to set a custom function to render the images on a
gtk.IconView, instead of the usual "gtk.IconView.set_pixbuf_column()"
method.

To do it, I'm using "set_cell_data_func" method that gtk.IconView
inherits from gtk.CellLayout [1] and [2].

It doesn't work, reporting next error.
"""
iconview.py:19: GtkWarning:
gtk_icon_view_cell_layout_set_cell_data_func: assertion `info != NULL'
failed
  self.set_cell_data_func(crpb, self.cell_pixbuf_func)
"""
See the attached example.

Any idea?

I succesfully use "set_cell_data_func" method with treeviews, so the
issue comes within gtk.IconView...


My purpose is to render the pixbufs according to some "size"
preference so images are shown smaller or bigger.
The option of filling the store each time "size" preference is changed
is not a valid solution as there a lot of rows there so it would be
very slow.


Thanks,
Iñigo Serna


[1] http://www.pygtk.org/docs/pygtk/class-gtkiconview.html
[2] 
http://www.pygtk.org/docs/pygtk/class-gtkcelllayout.html#method-gtkcelllayout--set-cell-data-func
import gtk

class IconView(gtk.IconView):
def __init__(self):
super(IconView, self).__init__()
# populate model
model = gtk.ListStore(str, gtk.gdk.Pixbuf)
for attr in dir(gtk):
if attr.startswith('STOCK_'):
stock_id = getattr(gtk, attr)
pixbuf = self.render_icon(stock_id,
  size=gtk.ICON_SIZE_BUTTON, detail=None)
if pixbuf:
model.append(['gtk.%s' % attr, pixbuf])
# drawing section
self.set_text_column(0)
# self.set_pixbuf_column(1) # use a function to fill the image
crpb = gtk.CellRendererPixbuf()
self.set_cell_data_func(crpb, self.cell_pixbuf_func)
# set model
self.set_model(model)


def cell_pixbuf_func(self, celllayout, cell, model, iter, user_data):
print self, celllayout, cell, model, iter, user_data
cell.set_property('pixbuf', model[0][1])


win = gtk.Window()
win.set_default_size(400, 400)
win.connect("destroy", lambda w: gtk.main_quit())
view = IconView()
sw = gtk.ScrolledWindow()
sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
sw.add_with_viewport(view)
win.add(sw)
win.show_all()
gtk.main()
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] Drawing on a gdk.Pixbuf using Cairo.

2010-03-05 Thread Iñigo Serna
Hi,

On 2 March 2010 10:59, Osmo Maatta  wrote:
>
> [...]
>
>
> 1) What is the best way to draw onto gdk.Pixbuf? (most likely using Cairo,
> other means also welcomed)
>

For simple and fast drawings you can use gdk.Drawable [1] too, but cairo is
usually a better and much powerful option.

[1] http://www.pygtk.org/docs/pygtk/class-gdkdrawable.html

Best regards,
Iñigo Serna
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] Scrollbar Width

2009-12-13 Thread Iñigo Serna
Hello,

2009/12/12 Art Hunkins :
> style "wide_range"
> {
>    GtkRange::slider-width = 40
> }
> class "GtkRange" style "wide_range"

try slider_width instead of slider-width.

Regards,
Iñigo Serna


2009/12/12 Art Hunkins :
> I'm working in the context of Sugar-on-a-Stick, which defaults scrollbars to
> a (narrow) width of 14. In my two activities, which use a full-screen
> gtk.ScrolledWindow, I'd like to widen the bars to, say, 40. It seems that
> the only way to do so is via an .rc file.
>
> Following specific instructions for setting scrollbar width found here:
> http://bytes.com/topic/python/answers/710473-how-use-styles-pygtk
> I constructed the following scrollwidth.rc file:
> __
> style "wide_range"
> {
>    GtkRange::slider-width = 40
> }
>
> class "GtkRange" style "wide_range"
> __
>
> I placed the file in my activity folder, then added the following line
> toward the beginning of the init segment of my activity (.py):
>
>   gtk.rc_parse("scrollwidth.rc")
>
> The activity runs fine and its log reflects no errors. However, the window's
> scrollbars remain the default
> width. (They are fully viewable as well.)
>
> (I did try:
>   gtk.rc_parse("~/Activities/OurMusic.activity/scrollwidth.rc")
> as well; identical result. This is the complete path to the .rc file.)
>
> Does anyone see the flaw(s) here?
>
> Art Hunkins
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] Pb with changin color of alternate row shading on treeview widget

2005-08-31 Thread Iñigo Serna
Hi Philippe,

On Wed, Aug 31, 2005 at 04:32:32PM +0200, [EMAIL PROTECTED] wrote:
> Hi list,
> 
> I want to alternate color for the row i have in a treeview. 

Look at 
http://www.pygtk.org/pygtk2reference/class-gtktreeview.html#method-gtktreeview--set-rules-hint

Iñigo


pgpJt4kp5F700.pgp
Description: PGP signature
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gnome canvas becomes unresponsive

2003-12-17 Thread Iñigo Serna
Hi,

El mar, 16-12-2003 a las 15:28, [EMAIL PROTECTED] escribió:
> > Doug, you might want to look at http://www.pythoncad.org/
> 
> Actually, that's where I started. I have been corresponding with Art Haas, 
> pythonCAD's lead developer. As I have been studying the pythonCAD code, 
> and have been coming up to speed on pygtk, it occurred to me that there 
> might be an opportunity for the code to be simpler by using the gnome 
> canvas, rather than the gtk drawingArea. Art has encouraged me to explore 
> this further.

Think that AFAIK gnomecanvas hasn't been ported to other platforms
different than linux/*BSD/UNIX.

Maybe the best way is to use OpengGL with gtkglext, which has a python
wrapper and is multiplatform too [1].

Some months ago, before knowing Art's work, I've played with the idea of
writing a cad app in python too. See [2] for my pre-alpha code.
I've thought to email Art several times, but there are a lot of interest
projects and I don't have enough time...

Best regards,
Iñigo

[1] http://gtkglext.sourceforge.net
[2] http://inigo.katxi.org/devel/misc/pycad.tar.gz

-- 
Iñigo Serna <[EMAIL PROTECTED]>
Katxijasotzaileak


signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada	digitalmente
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] 2 problems: gtk widgets [solved] and gnomecanvas group children [unsolved]

2003-09-09 Thread Iñigo Serna
ok, ok, it works, 2 minutes after answering I've understood where to put
the if-clause. It seems gtk just needs to call the callback to update
the visual look of the widget, although it doesn't execute anything.

Sorry for previous mail and thanks a lot Christian.

So here is the code:

import gtk

class App:
  def __init__(self):
self.opt = 1
win = gtk.Window()
win.set_size_request(100, 100)
vbox = gtk.VBox()
self.label = gtk.Label('Option: %d' % self.opt)
vbox.pack_start(self.label)
self.check = gtk.CheckButton('Check')
self.check.set_active(self.opt)
self.check.connect('toggled', self.onCheckToggled)
vbox.pack_start(self.check)
self.toggle = gtk.ToggleButton('Toggle')
self.toggle.set_active(self.opt)
self.toggle.connect('toggled', self.onToggleToggled)
vbox.pack_start(self.toggle)
win.add(vbox)
win.show_all()
self.block_toggle = 0

  def onCheckToggled(self, check):
print self.opt,
if not self.block_toggle:
  self.block_toggle = 1
  if self.opt:
self.opt = 0
  else:
self.opt = 1
  self.label.set_text('Option: %d' % self.opt)
  self.toggle.set_active(self.opt)
  self.block_toggle = 0
print self.opt

  def onToggleToggled(self, toggle):
print self.opt,
if not self.block_toggle:
  self.block_toggle = 1
  if self.opt:
self.opt = 0
  else:
self.opt = 1
  self.label.set_text('Option: %d' % self.opt)
  self.check.set_active(self.opt)
  self.block_toggle = 0
print self.opt

  def run(self):
gtk.mainloop()

app = App()
app.run()

--
Iñigo


signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada	digitalmente
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] 2 problems: gtk widgets and gnomecanvas group children

2003-09-09 Thread Iñigo Serna
first, thanks for the help, but it doesn't work.

El mar, 09-09-2003 a las 16:36, Christian Reis escribió:
> The correct answer to your inquiry is, of course, "Why do you want to do
> that?"; however:

I want to control the state of a varible (in fact, the visibility of the
grid of the second question) from two places: CheckButton in a menu
entry and ToggleButton in the UI.

> On Tue, Sep 09, 2003 at 04:28:36PM +0200, Iñigo Serna wrote:
> > I have a problem when sharing a value depending on the state of 2
> > widgets. 
> 
> You have the answer in your hand: you need to use a shared lock
> variable.
> 
> > def onCheckToggled(self, check):
> > print self.opt,
> > if self.opt:
> > self.opt = 0
> > else:
> > self.opt = 1
> > print self.opt,
> > self.label.set_text('Option: %d' % self.opt)
> 
> if not self.block_toggle:
> 
> self.block_toggle = 1
> 
> > self.toggle.set_active(self.opt)
> 
> self.block_toggle = 0
> 
> > print self.opt
> 
> -- and the same code here
> 
> > def onToggleToggled(self, toggle):
> > print self.opt,
> > if self.opt:
> > self.opt = 0
> > else:
> > self.opt = 1
> > self.label.set_text('Option: %d' % self.opt)
> 
> if not self.block_toggle:
> 
> self.block_toggle = 1
> 
> > self.check.set_active(self.opt)
> 
> self.block_toggle = 0
> 

The problem comes because when self.toggle.set_active(self.opt) is
executed in onCheckToggled method, self.opt value has already changed to
the new value, but self.toggle.set_active(self.opt) calls
onToggleToggled method, which changes self.opt a second time.

What I want is to update the visual aspect of the 2nd widget
(ToggleButton), but do so I have to call widget.set_active or
widget.set_property which calls onToggleButton and this modifies opt
variable a second time.

There is also a problem about cyclical calls between onCheckButton and
onToggleButton methods.

Any idea?


Thanks,
Iñigo


signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada	digitalmente
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] 2 problems: gtk widgets and gnomecanvas group children

2003-09-09 Thread Iñigo Serna
Hi all,

[Python 2.3, pygtk & gnome-python 2.0.0, Linux 2.4.18]

I have a problem when sharing a value depending on the state of 2
widgets. 

For example, there is a variable called self.opt, whose value is
controlled by a CheckButton and by a ToogleButton.
When I change the value with one widget I want the other changes its
state too, i.e. if I uncheck CheckButton, ToggleButton would have to
become unpressed, and viceversa.
But if I include code in the first callback to change the state of the
other, the second widget callback is also executed, so the variable gets
a bad value. Any ideas?

See the code below:

## PROBLEM EXAMPLE ##
import gtk

class App:
def __init__(self):
self.opt = 1
win = gtk.Window()
win.set_size_request(100, 100)
vbox = gtk.VBox()
self.label = gtk.Label('Option: %d' % self.opt)
vbox.pack_start(self.label)
self.check = gtk.CheckButton('Check')
self.check.set_active(self.opt)
self.check.connect('toggled', self.onCheckToggled)
vbox.pack_start(self.check)
self.toggle = gtk.ToggleButton('Toggle')
self.toggle.set_active(self.opt)
self.toggle.connect('toggled', self.onToggleToggled)
vbox.pack_start(self.toggle)
win.add(vbox)
win.show_all()

def onCheckToggled(self, check):
print self.opt,
if self.opt:
self.opt = 0
else:
self.opt = 1
print self.opt,
self.label.set_text('Option: %d' % self.opt)
# FIXME: this calls onToggleToggled, changing self.opt again
# how can I redraw the other widget state without calling the
# toggled callback? Indeed, does not this create an infinite
loop?
self.toggle.set_active(self.opt)
print self.opt

def onToggleToggled(self, toggle):
print self.opt,
if self.opt:
self.opt = 0
else:
self.opt = 1
self.label.set_text('Option: %d' % self.opt)
# FIXME: this calls onCheckToggled, changing self.opt again
# how can I redraw the other widget state without calling the
# toggled callback? Indeed, does not this create an infinite
loop?
self.check.set_active(self.opt)
print self.opt

def run(self):
gtk.mainloop()

app = App()
app.run()
## END ##


**

And a second problem: libgnomecanvas.

I want to create a grid, so I add a group to the root canvas, keeping a
reference to be able to hide and show it. Then I create some "points"
(in fact short lines, btw why there si no GnomeCanvasPoint ;-) to
simulate the grid points, but I don't want to maintain references of
these items:

group_grid = canvas.root().add('GnomeCanvasGroup', x = 0, y = 0)
for i in xrange(0, 1280+1, 25):
for j in xrange(0, 1024+1, 25):
group_grid.add('GnomeCanvasLine',
   points = (i, j, i+0.5, j+0.5),
   fill_color = 'black',
   width_pixels = 1)

Afterwards, I want to change the color of grid "points", but how can I
get references to canvas items? 
group_grid.get_property('children') does not exist...
In C API struct GnomeCanvasGroup struct includes GList *item_list, but
it doesn't seem to be exposed to python bindings.

The solution I use now is to delete and re-create the grid, but I guess
it should be a better way.

Thanks in advance,
Iñigo



signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada	digitalmente
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] sample applet

2003-07-23 Thread Iñigo Serna
Hi again

I've filled a new bugzilla entry with a sample applet I think may be
useful for others.

http://bugzilla.gnome.org/show_bug.cgi?id=118148

Best regards,
Iñigo Serna



signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmadadigitalmente
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] fullscreen patch

2003-07-20 Thread Iñigo Serna
bug filled: http://bugzilla.gnome.org/show_bug.cgi?id=117929 ;-)

Iñigo

El dom, 20-07-2003 a las 22:08, Christian Reis escribió:
> On Sun, Jul 20, 2003 at 10:05:51PM +0200, Iñigo Serna wrote:
> > 
> > some months ago [1] there were some questions about fullscreen support
> > in pygtk2, but it seems fullscreen & unfullscreen haven't been wrapped
> > yet, neither pygtk-1.99.16 nor in current cvs HEAD.
> 
> Thanks for the patch! I'm not the best person to comment, since I don't
> know that code very well, but I'll offer a bit of advice: when
> submitting a patch to PyGTK, posting to the mailing list is fine for
> review, but it's best to open a bug report on bugzilla.gnome.org to make
> sure it doesn't get lost or deleted accidentally.
> 
> You can send the bug link to the mailing list if you like, after. 
> 
> Take care,
> --
> Christian Reis, Senior Engineer, Async Open Source, Brazil.
> http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
> ___
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Iñigo Serna <[EMAIL PROTECTED]>
Katxijasotzaileak


signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmadadigitalmente
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] fullscreen patch

2003-07-20 Thread Iñigo Serna
Hello,

some months ago [1] there were some questions about fullscreen support
in pygtk2, but it seems fullscreen & unfullscreen haven't been wrapped
yet, neither pygtk-1.99.16 nor in current cvs HEAD.

The attached patch adds this two simple functions.

Best regards,
Iñigo

[1] Mon, 03 Mar 2003 06:50:51 GMT, in an answer from David Cook to
kkennedy.
diff -ur pygtk.orig/gtk/gdk.c pygtk/gtk/gdk.c
--- pygtk.orig/gtk/gdk.c	2003-07-20 21:44:23.0 +0200
+++ pygtk/gtk/gdk.c	2003-07-20 21:47:28.0 +0200
@@ -4181,6 +4181,22 @@
 }
 
 static PyObject *
+_wrap_gdk_window_fullscreen(PyGObject *self)
+{
+gdk_window_fullscreen(GDK_WINDOW(self->obj));
+Py_INCREF(Py_None);
+return Py_None;
+}
+
+static PyObject *
+_wrap_gdk_window_unfullscreen(PyGObject *self)
+{
+gdk_window_unfullscreen(GDK_WINDOW(self->obj));
+Py_INCREF(Py_None);
+return Py_None;
+}
+
+static PyObject *
 _wrap_gdk_window_register_dnd(PyGObject *self)
 {
 gdk_window_register_dnd(GDK_WINDOW(self->obj));
@@ -4339,6 +4355,8 @@
 { "unstick", (PyCFunction)_wrap_gdk_window_unstick, METH_NOARGS },
 { "maximize", (PyCFunction)_wrap_gdk_window_maximize, METH_NOARGS },
 { "unmaximize", (PyCFunction)_wrap_gdk_window_unmaximize, METH_NOARGS },
+{ "fullscreen", (PyCFunction)_wrap_gdk_window_fullscreen, METH_NOARGS },
+{ "unfullscreen", (PyCFunction)_wrap_gdk_window_unfullscreen, METH_NOARGS },
 { "register_dnd", (PyCFunction)_wrap_gdk_window_register_dnd, METH_NOARGS },
 { "begin_resize_drag", (PyCFunction)_wrap_gdk_window_begin_resize_drag, METH_VARARGS|METH_KEYWORDS },
 { "begin_move_drag", (PyCFunction)_wrap_gdk_window_begin_move_drag, METH_VARARGS|METH_KEYWORDS },
diff -ur pygtk.orig/gtk/gdk.defs pygtk/gtk/gdk.defs
--- pygtk.orig/gtk/gdk.defs	2003-07-20 21:44:18.0 +0200
+++ pygtk/gtk/gdk.defs	2003-07-20 21:45:16.0 +0200
@@ -2756,6 +2756,18 @@
   (return-type "none")
 )
 
+(define-method fullscreen
+  (of-object "GdkWindow")
+  (c-name "gdk_window_fullscreen")
+  (return-type "none")
+)
+
+(define-method unfullscreen
+  (of-object "GdkWindow")
+  (c-name "gdk_window_unfullscreen")
+  (return-type "none")
+)
+
 (define-method register_dnd
   (of-object "GdkWindow")
   (c-name "gdk_window_register_dnd")
diff -ur pygtk.orig/gtk/gtk.c pygtk/gtk/gtk.c
--- pygtk.orig/gtk/gtk.c	2003-07-20 21:37:18.0 +0200
+++ pygtk/gtk/gtk.c	2003-07-20 21:48:19.0 +0200
@@ -31167,6 +31167,22 @@
 }
 
 static PyObject *
+_wrap_gtk_window_fullscreen(PyGObject *self)
+{
+gtk_window_fullscreen(GTK_WINDOW(self->obj));
+Py_INCREF(Py_None);
+return Py_None;
+}
+
+static PyObject *
+_wrap_gtk_window_unfullscreen(PyGObject *self)
+{
+gtk_window_unfullscreen(GTK_WINDOW(self->obj));
+Py_INCREF(Py_None);
+return Py_None;
+}
+
+static PyObject *
 _wrap_gtk_window_begin_resize_drag(PyGObject *self, PyObject *args, PyObject *kwargs)
 {
 static char *kwlist[] = { "edge", "button", "root_x", "root_y", "timestamp", NULL };
@@ -31364,6 +31380,8 @@
 { "unstick", (PyCFunction)_wrap_gtk_window_unstick, METH_NOARGS },
 { "maximize", (PyCFunction)_wrap_gtk_window_maximize, METH_NOARGS },
 { "unmaximize", (PyCFunction)_wrap_gtk_window_unmaximize, METH_NOARGS },
+{ "fullscreen", (PyCFunction)_wrap_gtk_window_fullscreen, METH_NOARGS },
+{ "unfullscreen", (PyCFunction)_wrap_gtk_window_unfullscreen, METH_NOARGS },
 { "begin_resize_drag", (PyCFunction)_wrap_gtk_window_begin_resize_drag, METH_VARARGS|METH_KEYWORDS },
 { "begin_move_drag", (PyCFunction)_wrap_gtk_window_begin_move_drag, METH_VARARGS|METH_KEYWORDS },
 { "set_policy", (PyCFunction)_wrap_gtk_window_set_policy, METH_VARARGS|METH_KEYWORDS },
diff -ur pygtk.orig/gtk/gtk.defs pygtk/gtk/gtk.defs
--- pygtk.orig/gtk/gtk.defs	2003-07-20 21:37:04.0 +0200
+++ pygtk/gtk/gtk.defs	2003-07-20 21:38:17.0 +0200
@@ -16922,6 +16922,18 @@
   (return-type "none")
 )
 
+(define-method fullscreen
+  (of-object "GtkWindow")
+  (c-name "gtk_window_fullscreen")
+  (return-type "none")
+)
+
+(define-method unfullscreen
+  (of-object "GtkWindow")
+  (c-name "gtk_window_unfullscreen")
+  (return-type "none")
+)
+
 (define-method begin_resize_drag
   (of-object "GtkWindow")
   (c-name "gtk_window_begin_resize_drag")


signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmadadigitalmente
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] OpenGL in PyGTK2

2003-01-06 Thread Iñigo Serna
Hi,

Last versions of pygtk2 works with gtkglarea-1.99.0.tar.gz [1]
Try to compile it and the pygtk2 [2] from sources and then check the
examples in pygtk.

It seems gtkglext is better than gtkglarea for gtk v2, but as far as I
know there aren't python wrappers for gtkglext. In fact I've been
thinking in coding it myself, but it's too hard for me ;-)

[1]http://ftp.gnome.org/pub/GNOME/sources/gtkglarea/1.99/gtkglarea-1.99.0.tar.gz
[2]http://ftp.gnome.org/pub/GNOME/sources/pygtk/1.99/pygtk-1.99.14.tar.gz

Best regards,
Iñigo Serna


El jue, 02-01-2003 a las 19:25, Viktor Hornak escribió:
> Hello,
> 
> does anyone know if it's possible to use an OpenGL widget in PyGTK? I'am
> using pygtk2-1.99 (RedHat 8.0). I need to draw thousands of lines/points
> and gtk.DrawingArea is very slow for that. I am rather confused about
> the status of gtkglarea and gtkGLext (would they both work with
> pygtk2?). Are there bindings for any of the two? How would I make calls
> to OpenGL?
> I'd appreciate any insights into where these things are, it's kind of
> difficult to figure it out from google search...
> 
> Thanks,
> -Viktor





signature.asc
Description: Esta parte del mensaje esta firmada digitalmente