C++/Gtkmm/XML compared to C#/WPF/XAML

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

C++/Gtkmm/XML compared to C#/WPF/XAML

Bill William
I'm wondering if there are any examples online somewhere on how to code XML describing the GUI objects in an gtkmm program, similar to the way that WPF/XAML with C#. 

C#/WPF example:

<Grid>
<Grid.ColumnDefinitions>
 
<ColumnDefinition Width="2*" />
   
<ColumnDefinition Width="1*" />
   
<ColumnDefinition Width="1*" />
  <
/Grid.ColumnDefinitions>
 
<Grid.RowDefinitions>
 
<RowDefinition Height="2*" />
   
<RowDefinition Height="1*" />
   
<RowDefinition Height="1*" />
 
</Grid.RowDefinitions>
 
<Button>Button 1</Button>
  <
Button Grid.Column="1">Button 2</Button>
 
<Button Grid.Column="2">Button 3</Button>
 
<Button Grid.Row="1">Button 4</Button>
 
<Button Grid.Column="1" Grid.Row="1">Button 5</Button>
 
<Button Grid.Column="2" Grid.Row="1">Button 6</Button>
 
<Button Grid.Row="2">Button 7</Button>
 
<Button Grid.Column="1" Grid.Row="2">Button 8</Button>
 
<Button Grid.Column="2" Grid.Row="2">Button 9</Button>
</Grid>
I really like the way you can just code WPF XAML in C# without needing the GUI tool to draw the gui similar to a gnome "glade tool" tool... really wish gtkmm would specific an XML language for specifying the instantiation of gtkmm GUI objects without the need of glade,  I'm think the way that Adobe Dreamweaver works, and the way SharpDeveloper works,  you get an HTML or XAML code window and you can directly code the XML code describing your gui and then switch back and forth bewteen preview and XML code to see how your GUI is rendering... I find this way of developing GUI's workers really well,it makes your code inherently easier to maintain because its similar to HTML...Really wish glade and GTKMM would get together and clone this aspect of C#/WPF in a way similar to SharpDeveloper.

The problem I have with all these GUI automation tools like glade, etc... is that they are all based on the old winforms model ofdragging and dropping everything with a graphical tool with X,Y coordinates...  which I think just is messy and makes your code turn into spagetti...epecially the old win32/winforms approach in C#....  I think glade and gtkmm needs to move beyond that and adopt a SharpDeveloper/WPF/C#/XAML approach to defining the GUI.



_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++/Gtkmm/XML compared to C#/WPF/XAML

Murray Cumming-5
On Thu, 2017-04-27 at 09:09 -0400, Bill William wrote:
> The problem I have with all these GUI automation tools like glade,
> etc... is that they are all based on the old winforms model
> ofdragging and dropping everything with a graphical tool with X,Y
> coordinates.

GTK+ uses automatic layout and always has.

--
Murray Cumming
[hidden email]
www.murrayc.com

_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++/Gtkmm/XML compared to C#/WPF/XAML

Murray Cumming-5
On Thu, 2017-04-27 at 12:27 -0400, Bill William wrote:
> fair enough... but, which part of gtk defines how the XML maps to the
> GUI objects?  gtk+, gtkmm, or glade?

GtkBuilder in GTK+, and probably parts of the widgets themselves.

--
Murray Cumming
[hidden email]
www.murrayc.com

_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: C++/Gtkmm/XML compared to C#/WPF/XAML

Daniel Boles
In reply to this post by Bill William
Just for emphasis

On 27 April 2017 at 14:09, Bill William <[hidden email]> wrote:
really wish gtkmm would specific an XML language for specifying the instantiation of gtkmm GUI objects without the need of glade

It does. It's called Gtk::Builder (i.e. GtkBuilder).

 
Really wish glade and GTKMM would get together and clone this aspect of C#/WPF in a way similar to SharpDeveloper.

Well, Glade is an upstream GTK+ targeted utility, so it doesn't care about bindings. gtkmm is perfectly happy to consume the files produced by Glade, however.

 
The problem I have with all these GUI automation tools like glade, etc... is that they are all based on the old winforms model ofdragging and dropping everything with a graphical tool with X,Y coordinates...

This is not true. GTK+ uses relative positioning and sizing (unless you punish yourself with GtkFixed or other old baggage).
 

_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Loading...