www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - gtkDcoding Blog Post # 26 - Menu Basics

reply Ron Tarrant <rontarrant gmail.com> writes:
Today starts a series on GtkD menus. Over the next four weeks, 
we'll cover enough ground to get you up-n-running with most 
menu-related topics. And it all starts right here: 
http://gtkdcoding.com/2019/04/12/0026-menu-basics.html
Apr 12 2019
next sibling parent reply number <putimalitze gmx.de> writes:
On Friday, 12 April 2019 at 09:05:11 UTC, Ron Tarrant wrote:
 Today starts a series on GtkD menus. Over the next four weeks, 
 we'll cover enough ground to get you up-n-running with most 
 menu-related topics. And it all starts right here: 
 http://gtkdcoding.com/2019/04/12/0026-menu-basics.html
Thanks, I'm still a reader! Are you planning to cover messagebox-like stuff (i.e. gtkdialog.. i guess?)
Apr 12 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Friday, 12 April 2019 at 13:56:51 UTC, number wrote:

 Thanks, I'm still a reader!
Excellent. Thanks for letting me know.
 Are you planning to cover messagebox-like stuff (i.e. 
 gtkdialog.. i guess?)
Yes. Right after this series on menus, I start on Dialogs. The first couple of those are already in the grist mill (HelpDialog, FileChooserDialog) giving that series five articles so far. But I'll put MessageDialog next on the list which means it'll be posted on May 31st.
Apr 12 2019
parent reply number <putimalitze gmx.de> writes:
On Saturday, 13 April 2019 at 00:25:21 UTC, Ron Tarrant wrote:
 On Friday, 12 April 2019 at 13:56:51 UTC, number wrote:

 Are you planning to cover messagebox-like stuff (i.e. 
 gtkdialog.. i guess?)
Yes. Right after this series on menus, I start on Dialogs. The first couple of those are already in the grist mill (HelpDialog, FileChooserDialog) giving that series five articles so far. But I'll put MessageDialog next on the list which means it'll be posted on May 31st.
I'm asking because there was discussion elsewhere on the net about another programming language where a [gtk] messagebox title was too long so the text could not be read completely because the messagebox sized itself to the shorter text in the content area. They said it's an OS limitation (meaning gtk standard dialogs). It also seems dialogs are not user-resizable by default, which seems strange to me. So I thought to roll my own dialog, but didn't get to it yet. I also wonder why I often encounter gtk apps/windows that are unresizable, but still have the resize-icon cursor when hovering the bottom-right window edge, which when used moves the window instead.
Apr 13 2019
parent reply Ron Tarrant <rontarrant gmail.com> writes:
On Saturday, 13 April 2019 at 09:49:47 UTC, number wrote:
 On Saturday, 13 April 2019 at 00:25:21 UTC, Ron Tarrant wrote:
 I'm asking because ... the messagebox sized itself to the 
 shorter text in the content area. They said it's an OS 
 limitation (meaning gtk standard dialogs).
Because the Dialog class inherits from Window, you can size it with setSizeRequest(). On Windows, at least. I'm not sure about Linux. I'm about to go out for a few hours, so perhaps you could test this.
 It also seems dialogs are not user-resizable by default, which 
 seems strange to me. So I thought to roll my own dialog, but 
 didn't get to it yet.
That's another topic I have on my list for the dialog series.
 I also wonder why I often encounter gtk apps/windows that are 
 unresizable, but still have the resize-icon cursor when 
 hovering the bottom-right window edge, which when used moves 
 the window instead.
It's because there are two flags controlling resize-ability, both found in generated\gtkd\gdk\c\types.d: - a window decorations flag (GdkWMDecoration), and - another that controls whether or not the window is allowed to resize (GdkWMFunction). If the programmer turns off the resize flag, but not the decorator flag, well... there's your answer. Hope that helps, number.
Apr 13 2019
parent number <putimalitze gmx.de> writes:
On Saturday, 13 April 2019 at 12:42:36 UTC, Ron Tarrant wrote:
 On Saturday, 13 April 2019 at 09:49:47 UTC, number wrote:
 On Saturday, 13 April 2019 at 00:25:21 UTC, Ron Tarrant wrote:
 I'm asking because ... the messagebox sized itself to the 
 shorter text in the content area. They said it's an OS 
 limitation (meaning gtk standard dialogs).
Because the Dialog class inherits from Window, you can size it with setSizeRequest(). On Windows, at least. I'm not sure about Linux. I'm about to go out for a few hours, so perhaps you could test this.
Yes, this work on Linux, too.
 It also seems dialogs are not user-resizable by default, which 
 seems strange to me. So I thought to roll my own dialog, but 
 didn't get to it yet.
That's another topic I have on my list for the dialog series.
Sorry, I was unclear. By rolling my own I meant to not use a predefined library function MessageRequester() that exists in that language, but instead using gtk dialog directly which would be more customizable. Anyway that would only be for learning purposes, nothing I desperately need.
 I also wonder why I often encounter gtk apps/windows that are 
 unresizable, but still have the resize-icon cursor when 
 hovering the bottom-right window edge, which when used moves 
 the window instead.
It's because there are two flags controlling resize-ability, both found in generated\gtkd\gdk\c\types.d: - a window decorations flag (GdkWMDecoration), and - another that controls whether or not the window is allowed to resize (GdkWMFunction). If the programmer turns off the resize flag, but not the decorator flag, well... there's your answer. Hope that helps, number.
Ok, I understand. But then it seems still strange that the window can be moved by dragging the edge if it's only a decoration that is active. Thanks for your explanations.
Apr 14 2019
prev sibling parent Ron Tarrant <rontarrant gmail.com> writes:
It being Tuesday, it's time for another gtkDcoding Blog Post. 
Today, we continue our exploration of menu topics by looking at 
mnemonics and separators. You can find it here: 
http://gtkdcoding.com/2019/04/16/0027-mnemonic-shortcut-key.html
Apr 16 2019