Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Oct. 21, 2005 00:07:17

Juan P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] Hello Menu!!!


Hello this patch adds menu load/save support
It should load any menu create with glade-2.

Notes:

* GtkRadioMenuItems do not work for now.

* Accelerators ???????

* Clicking over a menuitem selects the GladeWidget but do not let the
menuitem be activated except for the first one (middle click works OK)
Any idea?

* GktImage: in glade-3 the "file" property is used as the filename
instead of "pixbuf" as is in glade-2 :(
Maybe we are going to need some sort of "alias" property tag to fix
this.

* Properties are not set insensitive when a project is loaded.

Not related with menus:
It seems project manipulation (load/save open/close) is unstable.
For example, If you close every project and try to save, it will crash.
(active_project is not valid)
Also if you have more than one project open at the same time and you try
to select some widget from the project view sometimes it crash or widget
properties do not appear in the property editor (they do if you select
the widget itself).

thanks

Juan Pablo

PD: There is also the glade-2 project which I use to test. (I replaced
"pixbuf" with "file" in the GtkImage)

Changelog:

2005-10-20 Juan Pablo Ugarte <>

* src/glade-gtk.c: GtkMenuBar Load/Save Support.
GtkImage loading fixes. glade_gtk_image_set_icon_name(),
glade_gtk_image_set_file()

* widgets/gtk+.xml: New classes. GtkMenuItem GtkCheckMenuItem
GtkImageMenuItem and GtkSeparatorMenuItem.

* src/glade-builtins.c: Added glade_standard_boolean_spec()

* src/glade-project-window.c: Added About icon.

* src/glade-widget.c: in glade_widget_button_press()
glade_widget_retrieve_from_position() can return NULL,
added check.menu.tar.bz2Description:application/bzip-compressed-tar_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Attachments:
attachment menu.tar.bz2 (11.1 KB)

Offline

#2 Oct. 24, 2005 15:41:59

Tristan V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] Hello Menu!!!


Juan Pablo Ugarte wrote:Hello this patch adds menu load/save support
It should load any menu create with glade-2.

Notes:

* GtkRadioMenuItems do not work for now.Hmmm, do you think this bug is related:http://bugzilla.gnome.org/show_bug.cgi?id=310143?

For some reason, I havent got a dynamic GtkRadioMenuIem group
to function properly.* Accelerators ???????

* Clicking over a menuitem selects the GladeWidget but do not let the
menuitem be activated except for the first one (middle click works OK)
Any idea?Hmmm, maybe the logic around glade_widget_retrieve_from_position(); is
borked, just a hunch...* GktImage: in glade-3 the "file" property is used as the filename
instead of "pixbuf" as is in glade-2 :(
Maybe we are going to need some sort of "alias" property tag to fix
this.I think that we just need to implement "filename" properties better;
we should have a filechooser button for them... we'll just need to
give it a little thought as to where the file is to be retrieved
by glade-3/Anjuta and where it is to be retrieved by libglade/gtk+.

One other thing I noticed is that GtkImage "type" doesn't seem to be
resolved properly on the load :
(i.e. type = filename || icon theme || stock )

I wonder if I broke that while writing glade-editor-property.c or
maybe you broke it with "GtkImage loading fixes", I'll let you know
after taking a look at the code :-/* Properties are not set insensitive when a project is loaded.I dont think I follow; when I have one project open (with a selected
widget) and I load a second project; the selected widget is cleared
and I have nothing in the property editor.Not related with menus:
It seems project manipulation (load/save open/close) is unstable.
For example, If you close every project and try to save, it will crash.
(active_project is not valid)Ok, the code should be protected from those crashes; and arguably,
the save/undo/redo buttons should be insensitive when no projects
are loaded.

I'll try to get a fix in today; if I dont have time I'll bugzilla it.Also if you have more than one project open at the same time and you try
to select some widget from the project view sometimes it crash or widget
properties do not appear in the property editor (they do if you select
the widget itself).The graphist here at touchtunes has been experiencing similar problems;
but he says that sometimes glade-3 crashes when using left-click
selection on the widgets, he always uses right-click "select" via
the widget tree to avoid crashes. (since we're using a custom toolkit
plugin and the tool is running large/complex projects for long periods
of time and I cant get any steps to reproduce it, its not in bugzilla)

It would be great if you could find out a way to reproduce the crash
consistantly :-/

I'll take a closer look at the actual patch and probably get it into
cvs later on today.

Cheers,
-Tristan

_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Offline

#3 Oct. 27, 2005 20:57:35

Juan P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] Hello Menu!!!


Hello everyone...
This patch should add full load/save menu support while maintaining full
compatibility with glade-2, at least that's the idea :)

libglade assumes every path is relative to the .glade file, in fact
if you utilize glade_xml_new_from_buffer(), libglade will fail to load
pixmaps since path is NULL.
So I think setting the current directory to the project directory and
managing every file as relative should be enough for now.

It is memory leak proof.
Memprof is not working with glade (I use debian unstable)
So I have to check for every pixbuf created be destroyed using a
g_object_weak_ref in glade_property_class_make_gvalue_from_string()
And it seems to work ok.

greets

Juan Pablo

PD:

2005-10-27 Juan Pablo Ugarte <>

* src/glade-app.c: glade_app_set_project() Sets the
current/working directory to the project's directory.

* src/glade-builtins.c: Added glade_standard_boolean_spec().

* src/glade-editor-property.c: New Glade Editor Property Class
GladeEPropPixbuf. (GdkPixbuf properties)

* src/glade-gtk.c: GtkMenuBar Load/Save Support.
GtkImage loading fixes. glade_gtk_image_set_icon_name().
GtkLabel added glade_gtk_label_set_label().

* src/glade-project-window.c: Added About icon.

* src/glade-project.c: glade_project_new_from_interface() make
project's path always absolute.

* src/glade-property-class.c: Added pixbuf property support in
glade_property_class_make_string_from_gvalue() and
glade_property_class_make_gvalue_from_string().

* src/glade-property.c: Added pixbuf property support in
glade_property_set_va_list() and glade_property_get_va_list().

* widgets/gtk+.xml: New classes. GtkMenuItem GtkCheckMenuItem
GtkImageMenuItem and GtkSeparatorMenuItem.menu_support.patch.gzDescription:GNU Zip compressed data_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Attachments:
attachment menu_support.patch.gz (7.1 KB)

Offline

#4 Oct. 30, 2005 19:37:00

Tristan V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] Hello Menu!!!


Juan Pablo Ugarte wrote:Hello everyone...
This patch should add full load/save menu support while maintaining full
compatibility with glade-2, at least that's the idea :)Well I'm back on the map, I have very little time this week
(since I'm dealing with a room-mate change up which is always
a little complex ;-), but I'll be sure to try it out and review
the patch in detail some time this week.

Cheers,
-Tristan

_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Offline

#5 Oct. 31, 2005 15:09:08

Juan P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] Hello Menu!!!


On Sun, 2005-10-30 at 14:40 -0500, Tristan Van Berkom wrote:

> Well I'm back on the map, I have very little time this week
> (since I'm dealing with a room-mate change up which is always
> a little complex ;-), but I'll be sure to try it out and review
> the patch in detail some time this week.

OK, no problem.

I have started with the editor itself and currently I am writing
everything in glade-gtk.c so...
What should I do with glade-menu-editor. ?

* remove them and keep writing everything in glade-gtk.c
* remove the content and move everything related to the menu editor into
them
* remove them, and start a new file dedicated for menu support

besides that, glade-menu-editor.c is been included in libgladeui instead
of ligladegtk.

greets

Juan Pablo






___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundohttp://correo.yahoo.com.ar_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Offline

#6 Oct. 31, 2005 16:03:13

Tristan V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] Hello Menu!!!


Juan Pablo Ugarte wrote:On Sun, 2005-10-30 at 14:40 -0500, Tristan Van Berkom wrote:
I have started with the editor itself and currently I am writing
everything in glade-gtk.c so...
What should I do with glade-menu-editor. ?

* remove them and keep writing everything in glade-gtk.cThat sounds good, lets spike it in glade-gtk.c and depending on
how much code is needed; we could put it all in another file
at the end (also this way we can decide to keep any code that
might be shared with other editors in libgladeui).

I started looking at glade-project-view.c, since I thought it
would be nice to re-use it inside the menu/toolbar editors.

This is what I think needs to be done to dissociate the
project-view code:

* glade_project_view_selection_changed_cb needs to fire
a signal on the GladeProjectViewClass to notify the client
of selection changes (item_selected has been declared in
the header for this purpose, but we could use a different
name).

* glade_project_view_item_activated_cb() should also delegate
action to the client for the same reasons.

* GladeProjectView should have a method to retrieve the view's
selection (both for use in editors & glade-app; glade-app
should use this to update the active project's selection)
and a method to modify its selection respectivly (in order
for glade-app to update its view based on the project
selection).

* GladeProjectView needs methods to populate itself with;
something like gpv_populate_from_project() &
gpv_populate_from_object(); where _from_project() would do
what the GladeProjectView usually does & _from_object() would
take an object and populate the project view with that object
as the toplevel (i.e. only add the children).

If you can work around the project view for the moment (maybe work
with single menu-bar menu-item selection at first, I dont know if
thats realistic) then I'll try to revamp the project-view code
this weekend.

Regardless if you wait on me or not; please let me know what
you think of the plan, this is a good time to "get it right the
first time" :)

Cheers,
-Tristan

_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Offline

#7 Oct. 31, 2005 18:59:46

Juan P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] Hello Menu!!!


On Mon, 2005-10-31 at 12:11 -0500, Tristan Van Berkom wrote:

> If you can work around the project view for the moment (maybe work
> with single menu-bar menu-item selection at first, I dont know if
> thats realistic) then I'll try to revamp the project-view code
> this weekend.

Yes I can, In fact when I begin with the editor the first thing I did
was to look up the project-view but finally i decided to make a
recursive function that fills a tree model. (it takes no more than ten
lines)
The model columns are
GLADEGTK_MENU_OBJECT,
GLADEGTK_MENU_GWIDGET,
GLADEGTK_MENU_TYPE,
GLADEGTK_MENU_LABEL,
GLADEGTK_MENU_TYPE_NAME,
GLADEGTK_MENU_NAME,

TYPE_NAME is a GtkCellRendererCombo with these options "Normal",
"Image", "Check", "Separator" ("Radio" will be added when the class
loading issue is solved)

The idea is that the editor will let you add, remove, reorder and
change the type of menu items within the tree view. And show the
significant glade properties of the selected item on a side.

The tree view is working fine and now I have to take a decision on the
behavior of the editor, should it be "real time" or have an apply button
as in glade 2 (I prefer the "real time" approach). In both cases I don't
know what will happen with the undo/redo system.

> Regardless if you wait on me or not; please let me know what
> you think of the plan, this is a good time to "get it right the
> first time" :)

I think I don't understand quite well if the only benefit is that we do
not have to build the tree model I think it is not necessary but (there
is always a but) if you are thinking to do so, so the editor tree view
will be updated when something is modified from outside (deleting a
widget from the project-view)... well in that case it is a great idea.

greets

Juan Pablo







___________________________________________________________
1GB gratis, Antivirus y Antispam
Correo Yahoo!, el mejor correo web del mundohttp://correo.yahoo.com.ar_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Offline

#8 Oct. 31, 2005 20:22:05

Tristan V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Glade-devel] Hello Menu!!!


Juan Pablo Ugarte wrote:On Mon, 2005-10-31 at 12:11 -0500, Tristan Van Berkom wrote:
The idea is that the editor will let you add, remove, reorder and
change the type of menu items within the tree view. And show the
significant glade properties of the selected item on a side.Since you are embedding all of this functionality into the
actual treeview, which I think is a good approach; no need to
re-use the project-view code.The tree view is working fine and now I have to take a decision on the
behavior of the editor, should it be "real time" or have an apply button
as in glade 2 (I prefer the "real time" approach). In both cases I don't
know what will happen with the undo/redo system.Basicly; If you create your GladeEditorProperties with the
use_command arg as TRUE, then all property changes will be stacked
on the undo/redo stack; in either case, the property values will
be applied to the object real-time, other than that; just make
sure that all menu items are removed/created through the
glade_command API.

I think that its pretty pointless to have an Apply/Cancel button;
glade-2 had it but didn't have undo/redo, so there was purpose.Regardless if you wait on me or not; please let me know what
you think of the plan, this is a good time to "get it right the
first time" :)I think I don't understand quite well if the only benefit is that we do
not have to build the tree model I think it is not necessary but (there
is always a but) if you are thinking to do so, so the editor tree view
will be updated when something is modified from outside (deleting a
widget from the project-view)... well in that case it is a great idea.Hmmm,
I think its probably best for custom editors to be mutually
exclusive with the default glade editor (shouldn't be able to modify
properties add or delete widgets while the editor is in use).

Cheers,
-Tristan
_______________________________________________
Glade-devel maillist - Glade-devel@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/glade-devel

Offline

Board footer

Moderator control

Enjoy the 20th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support